# Microsoft Copilot Prompt API Harness

> AWS Lambda harness that injects test prompts into M365 Copilot for Tenable AI Exposure security testing

- Type: Skill
- Author: sbarasch-pub-git
- License: MIT
- Trust tier: contributed (passed automated validation and a baseline maintainer review)
- Last reviewed: 2026-07-31
- Source repository: https://github.com/sbarasch-pub-git/msft_copilot_prompt_api_harness
- Repo state: not archived
- Last push: 2026-07-27T20:08:38Z
- Stars: 0 (a popularity signal, not a safety signal)
- Forks: 0 (a popularity signal, not a safety signal)
- Open issues: 0
- Language: Python
- Health checked at: 2026-11-05T20:35:15.821Z
- Integrations: AWS, Azure, Tenable
- Domains: ai-security, application-security
- Tags: microsoft-copilot, m365, security-testing, ai-exposure, prompt-testing, aws-lambda, graph-api
- Date added: 2026-07-27
- Compatible platforms: Claude Code, Claude Desktop, Claude Cowork, Cline, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf
- Invocation: `/copilot-prompt-harness`
- Listing page: https://exchange.tenable.com/skills/microsoft-copilot-prompt-api-harness
- Source file: https://github.com/tenable/cyberagents-exchange/blob/main/skills/microsoft-copilot-prompt-api-harness.md

The Microsoft Copilot Prompt API Harness is an AWS Lambda-based security testing tool that programmatically injects test prompts into Microsoft 365 Copilot via the Microsoft Graph API. Designed to work alongside Tenable AI Exposure, it provides automated, repeatable coverage for validating AI threat detection in M365 environments.

## What it does

- Authenticates to Microsoft 365 using Azure AD (MSAL ROPC flow) with configurable service account personas
- Creates Copilot conversations and injects categorized test prompts spanning data exfiltration, system prompt disclosure, and jailbreak scenarios
- Runs on schedule via AWS EventBridge or on-demand via direct Lambda invocation
- Returns structured per-prompt results with conversation IDs for cross-referencing with M365 audit logs and Tenable AI Exposure alerts

## How it works

The harness is deployed as an AWS Lambda function triggered by EventBridge. It authenticates to the Microsoft Graph API using MSAL's Resource Owner Password Credential (ROPC) flow with a pool of M365 service account personas. Each invocation creates Copilot conversations in batches, injects prompts with configurable delays, and returns a structured JSON summary. The built-in prompt categories (data exfiltration, system prompt disclosure, jailbreak) serve as a starting template — operators replace them with their actual test prompt library.

This is the Markdown version of one of 140 listings on CyberAgents Exchange. The same listing as JSON: https://exchange.tenable.com/api/skills/microsoft-copilot-prompt-api-harness.json. The full index and how to read it: https://exchange.tenable.com/llms.txt
