Clone and inspect the public bundle
The bundle contains public threat-pattern records, example policy scope, a synthetic target profile, past findings, and MCP examples.
git clone https://github.com/knowledge2-ai/k2-adversarial-context-demo.git
Developer path
Load the public adversarial corpora bundle, connect the K² MCP server to an existing generator, and inspect a cited evaluation plan before any adversarial input is generated.
Commands are illustrative until the public repo is published and the pipeline schema is finalized.
The bundle contains public threat-pattern records, example policy scope, a synthetic target profile, past findings, and MCP examples.
git clone https://github.com/knowledge2-ai/k2-adversarial-context-demo.git
Use a K² project and keep credentials in environment variables or a local ignored file. Public examples use placeholders only.
export K2_API_KEY="<your-k2-api-key>" export K2_API_HOST="https://api.knowledge2.ai" python scripts/load_adversarial_demo_k2.py --execute
The quickstart uses PyRIT as a vendor-neutral open-source example, but any MCP-capable harness can call the same plan endpoint.
docs/customer-demos/demo-adversarial-context/k2-assets/examples/mcp-config.example.json
Ask K² for a plan scoped to the synthetic SupportBot target, text-plus-image modalities, and staging environment.
get_evaluation_plan( target_id="target-supportbot-v2.3", modalities=["text", "image"], environment="staging" )
Run one cited plan entry through your generator and confirm the threat, policy, target, and finding references remain attached downstream.
python scripts/pyrit_plan_smoke.py --plan-id seed-0142-regression --dry-run
All examples point at the same plan-only K² boundary. Keep live credentials out of committed files.
{
"mcpServers": {
"k2-adversarial-context": {
"command": "python",
"args": ["scripts/k2_adversarial_mcp_server.py"],
"env": {
"K2_API_KEY": "${K2_API_KEY}",
"K2_API_HOST": "https://api.knowledge2.ai",
"K2_PROJECT_ID": "${K2_PROJECT_ID}"
}
}
}
}[mcp_servers.k2-adversarial-context] command = "python" args = ["scripts/k2_adversarial_mcp_server.py"] env_vars = [ "K2_API_KEY", "K2_API_HOST", "K2_PROJECT_ID", "K2_ADV_THREATS_CORPUS_ID", "K2_ADV_POLICY_CORPUS_ID", "K2_ADV_TARGET_CORPUS_ID", "K2_ADV_FINDINGS_CORPUS_ID" ]
plan = k2.get_evaluation_plan(
target_id="target-supportbot-v2.3",
modalities=["text", "image"],
environment="staging",
)
# PyRIT or your harness owns prompt generation, execution, and scoring.The first query should return scoped, cited plan context, not generated adversarial prompts.
Once the cited plan works, the useful question is how it maps to your current red-team process.