# agent-opfor - Doramagic AI Context Pack

> Positioning: a pre-install experience and judgment asset. It helps the host AI get off to a good start, but it does not mean the project has already been installed, run, or validated.

## Sufficiency Principle

- **Sufficiency over compression**: The AI Context Pack should be sufficient for the host AI to understand the project's value, capability boundaries, entrypoints, risks, and evidence sources before starting work; it may be layered, but it does not aim for the shortest possible summary.
- **Compression policy**: Compress only noise and duplication, never context that affects judgment or the quality of the work.

## How the Host AI Should Use This

You are reading the AI Context Pack that Doramagic compiled for agent-opfor. Treat it as pre-work context: help the user understand who it fits, what it can do, how to start, what must be verified after install, and where the risks are. Do not claim that you have already installed, run, or executed the target project.

## Claim Consumption Rules

- **Fact source**: Repo Evidence + Claim/Evidence Graph; the Human Wiki only supplies salience, terminology, and narrative structure.
- **Minimum status for a fact**: `supported`
- `supported`: May be used as a project fact, but the answer must cite the claim_id and evidence path.
- `weak`: Usable only as a low-confidence lead; the user must be asked to keep verifying.
- `inferred`: Usable only for risk notes or open questions; must not be packaged as a project fact.
- `unverified`: Must not be used as fact; state clearly that evidence is insufficient.
- `contradicted`: Must show the conflicting sources and must not force a single version on the user's behalf.

## Who It Fits Best

- **Developers already using host AIs such as Claude/Codex/Cursor/Gemini**: The README or plugin config mentions multiple host AIs. Evidence: `README.md` Claim: `clm_0003` supported 0.86
- **Users who want to bring professional workflows into a host AI**: The repo contains Skill documents. Evidence: `skills/agent-redteaming/opfor-run/SKILL.md`, `skills/agent-redteaming/opfor-setup/SKILL.md`, `skills/mcp-redteaming/opfor-run/SKILL.md`, `skills/mcp-redteaming/opfor-setup/SKILL.md` Claim: `clm_0004` supported 0.86

## What It Can Do

- **AI Skill / Agent Instruction Asset Library** (Previewable before install): The project contains Skill or Agent instruction files that a host AI can read, useful for bringing professional workflows into hosts like Claude, Codex, or Cursor. Evidence: `skills/agent-redteaming/opfor-run/SKILL.md`, `skills/agent-redteaming/opfor-setup/SKILL.md`, `skills/mcp-redteaming/opfor-run/SKILL.md`, `skills/mcp-redteaming/opfor-setup/SKILL.md` Claim: `clm_0001` supported 0.86
- **Command-Line Startup or Install Flow** (Verify after install): The project documentation contains runnable commands; real use requires running them in a local or host environment. Evidence: `AGENTS.md`, `README.md` Claim: `clm_0002` supported 0.86

## How to Start

- `npm install -g @keyvaluesystems/agent-opfor-cli` Evidence: `README.md` Claim: `clm_0005` supported 0.86
- `npm install                       # workspaces resolved + Husky pre-commit hooks installed` Evidence: `AGENTS.md` Claim: `clm_0006` supported 0.86

## Continue-or-Stop Decision Card

- **Current recommendation**: Needs admin / security approval
- **Why**: Continuing may involve secrets, accounts, external services, or sensitive context; get admin or security approval first.

### 30-Second Read

- **What to do now**: Needs admin / security approval
- **Minimum safe next step**: Run Prompt Preview first; if credentials or an enterprise environment are involved, get approval before trialing
- **Do not trust yet**: Tool permission boundaries cannot be trusted before install.
- **Continuing will touch**: Command execution, Host AI configuration, Local environment or project files

### What You Can Trust Now

- **Target-audience signal: Developers already using host AIs such as Claude/Codex/Cursor/Gemini** (supported): Backed by a supported claim or project evidence, but that still is not the same as real install results. Evidence: `README.md` Claim: `clm_0003` supported 0.86
- **Target-audience signal: Users who want to bring professional workflows into a host AI** (supported): Backed by a supported claim or project evidence, but that still is not the same as real install results. Evidence: `skills/agent-redteaming/opfor-run/SKILL.md`, `skills/agent-redteaming/opfor-setup/SKILL.md`, `skills/mcp-redteaming/opfor-run/SKILL.md`, `skills/mcp-redteaming/opfor-setup/SKILL.md` Claim: `clm_0004` supported 0.86
- **Capability exists: AI Skill / Agent Instruction Asset Library** (supported): You can trust that the project contains signals of this capability; whether it fits your specific task still needs trial or after-install verification. Evidence: `skills/agent-redteaming/opfor-run/SKILL.md`, `skills/agent-redteaming/opfor-setup/SKILL.md`, `skills/mcp-redteaming/opfor-run/SKILL.md`, `skills/mcp-redteaming/opfor-setup/SKILL.md` Claim: `clm_0001` supported 0.86
- **Capability exists: Command-Line Startup or Install Flow** (supported): You can trust that the project contains signals of this capability; whether it fits your specific task still needs trial or after-install verification. Evidence: `AGENTS.md`, `README.md` Claim: `clm_0002` supported 0.86
- **There are Quick Start / install-command signals** (supported): You can trust that the docs mention a startup or install entrypoint; do not run it directly in your primary environment because of that. Evidence: `README.md` Claim: `clm_0005` supported 0.86

### What You Cannot Trust Yet

- **Tool permission boundaries cannot be trusted before install.** (unverified): MCP/tool projects usually touch files, the network, the browser, or external APIs, so permissions and logs must be checked for real.
- **Real output quality cannot be trusted before install.** (unverified): Prompt Preview can only show how it guides you; it cannot prove result quality in the real project.
- **Host AI version compatibility cannot be trusted before install.** (unverified): Host loading rules and version differences across Claude, Cursor, Codex, Gemini, and others must be verified in a real environment.
- **That it will not pollute your existing host AI's behavior cannot be trusted directly.** (inferred): Skill, plugin, and AGENTS/CLAUDE/GEMINI instructions may change the host AI's default behavior. Evidence: `AGENTS.md`, `CLAUDE.md`, `skills/agent-redteaming/opfor-run/SKILL.md`, `skills/agent-redteaming/opfor-setup/SKILL.md` et al.
- **Safe rollback cannot be assumed by default.** (unverified): Unless the project clearly provides uninstall and recovery instructions, verify in an isolated environment first.
- **After a real install, is it compatible with the user's current host AI version?** (unverified): Compatibility can only be verified in the actual host environment.
- **Does the project's output quality meet the user's specific task?** (unverified): The pre-install preview can only show flow and boundaries; it cannot replace real evaluation.
- **Do the install commands require network access, permissions, or global writes?** (unverified): This affects install risk in both enterprise and personal environments. Evidence: `README.md`

### What Continuing Will Touch

- **Command execution**: Package managers, network downloads, the local plugin directory, project config, or the user's home directory. Why: Running the very first command can already change your environment; decide whether it is worth running first. Evidence: `AGENTS.md`, `README.md`
- **Host AI configuration**: The plugin, Skill, or rule-loading config of hosts like Claude/Codex/Cursor/Gemini/OpenCode. Why: Host configuration changes how the AI works afterward and may conflict with the user's existing rules. Evidence: `AGENTS.md`, `CLAUDE.md`, `skills/agent-redteaming/opfor-run/SKILL.md`, `skills/agent-redteaming/opfor-setup/SKILL.md` et al.
- **Local environment or project files**: Install results, plugin caches, project config, or local dependency directories. Why: The write scope and rollback path cannot be proven before install and need isolated verification. Evidence: `AGENTS.md`, `README.md`
- **Environment variables / API keys**: Project entry docs explicitly showing API key, token, secret, or account credential configuration. Why: If a real install needs credentials, use test credentials first and go through a permission/compliance review. Evidence: `AGENTS.md`, `CONTRIBUTING.md`, `README.md`, `docs/cli.md` et al.
- **Host AI context**: The AI Context Pack, Prompt Preview, Skill routing, risk rules, and project facts. Why: Importing context affects the host AI's later judgment, so avoid packaging unverified items as facts.

### Minimum Safe Next Steps

- **Run Prompt Preview first**: Use a pre-install interactive trial to judge whether the way of working fits; it needs no authorization or environment change. (applies when: Applies to any project, especially when output quality is unknown.)
- **Trial-install only in an isolated directory or a test account**: Avoid letting install commands pollute your primary host AI, real projects, or home directory. (applies when: When there are signals of command execution, plugin config, or local writes.)
- **Back up your host AI configuration first**: Skill, plugin, and rule files may change the default behavior of Claude/Cursor/Codex. (applies when: When there is a plugin manifest, a Skill, or a host rule entrypoint.)
- **Do not use real production credentials**: Once an environment variable / API key enters the host or toolchain, it can create account and compliance risk. (applies when: When environment signals like API, TOKEN, KEY, or SECRET appear.)
- **After install, verify just one minimal task**: Verify loading, compatibility, output quality, and rollback first, then decide whether to use it deeply. (applies when: When moving from a trial into a real workflow.)

### Exit Plan

- **Preserve the pre-install state**: Record the original host config and project state so you can later judge whether it is recoverable.
- **Be ready to remove the host plugin / Skill / rule entrypoint**: If behavior is off after the trial install, you can restore the host AI to its pre-trial state.
- **Record the install commands and written paths**: Without clear uninstall instructions, you at least need to know which directories or configs to clean up manually.
- **Be ready to revoke test API keys or tokens**: If test credentials leak or are misused, you can cut losses quickly.
- **If there is no rollback path, do not enter your primary environment**: No rollback is a blocker before continuing; do not proceed on trust or luck.

## What Can Only Be Previewed

- Explain who the project fits and what it can do
- Demonstrate a typical conversation flow based on project docs
- Help the user decide whether it is worth installing or researching further

## What Must Be Verified After Install

- Actually installing the Skill, plugin, or CLI
- Running scripts, modifying local files, or accessing external services
- Verifying real output quality, performance, and compatibility

## Boundary & Risk Decision Card

- **Mistaking the pre-install preview for a real run**: The user may overestimate how much configuration, permission, and compatibility verification the project has already done. Mitigation: Clearly separate prompt_preview_can_do from runtime_required. Claim: `clm_0007` inferred 0.45
- **Command execution will modify the local environment**: Install commands may write to the user's home directory, the host plugin directory, or project configuration. Mitigation: Run in an isolated environment or a test account first. Evidence: `AGENTS.md`, `README.md` Claim: `clm_0008` supported 0.86
- **To confirm**: After a real install, is it compatible with the user's current host AI version?. Why: Compatibility can only be verified in the actual host environment.
- **To confirm**: Does the project's output quality meet the user's specific task?. Why: The pre-install preview can only show flow and boundaries; it cannot replace real evaluation.
- **To confirm**: Do the install commands require network access, permissions, or global writes?. Why: This affects install risk in both enterprise and personal environments.

## Pre-Work Working Context

### Loading Order

- First read how_to_use.host_ai_instruction to establish the boundaries of this pre-install judgment asset.
- Read claim_graph_summary to confirm facts come from the Claim/Evidence Graph, not the Human Wiki narrative.
- Then read intended_users, capabilities, and quick_start_candidates to judge whether the user is a match.
- When you need to carry out a concrete task, check role_skill_index first, then evidence_index.
- For real install, file modification, network access, performance, or compatibility questions, turn to risk_card and boundaries.runtime_required.

### Task Routes

- **AI Skill / Agent Instruction Asset Library**: Use role_skill_index / evidence_index to help the user pick a usable role, Skill, or workflow first. Boundary: Can be experienced via a pre-install Prompt. Evidence: `skills/agent-redteaming/opfor-run/SKILL.md`, `skills/agent-redteaming/opfor-setup/SKILL.md`, `skills/mcp-redteaming/opfor-run/SKILL.md`, `skills/mcp-redteaming/opfor-setup/SKILL.md` Claim: `clm_0001` supported 0.86
- **Command-Line Startup or Install Flow**: State that this is an after-install capability first, then give a pre-install checklist. Boundary: Must be verified after a real install or run. Evidence: `AGENTS.md`, `README.md` Claim: `clm_0002` supported 0.86

### Context Scale

- Total files: 979
- Important-file coverage: 40/979
- Evidence index entries: 78
- Role / Skill entries: 4

### Handling Insufficient Evidence

- **missing_evidence**: State that evidence is insufficient and ask the user for the target file, a README section, or after-install verification records; do not fill in facts.
- **out_of_scope_request**: State that the task is beyond the current AI Context Pack's evidence scope and suggest the user check the Human Manual or verify after a real install.
- **runtime_request**: Provide a pre-install checklist and command sources, but do not run commands for the user or claim they have been run.
- **source_conflict**: Show the conflicting sources side by side, mark them as unverified, and do not force a single version.

## Prompt Recipes

### Fit assessment

- Goal: Judge whether this project fits the user's current task.
- Expected output: A fit conclusion, key reasons, evidence citations, what can be previewed before install, what must be verified after install, and a next-step recommendation.

```text
Based on the AI Context Pack for agent-opfor, ask me 3 necessary questions first, then judge whether it fits my task. The answer must cover: who it fits, what it can do, what it cannot do, whether it is worth installing, and where the evidence comes from. Every project fact must cite evidence_refs, source_paths, or a claim_id.
```

### Pre-install experience

- Goal: Let the user feel the core workflow before installing, while avoiding packaging the preview as real capability or a marketing promise.
- Expected output: An experience script with boundary labels, an after-install verification checklist, and a cautious recommendation; with no real-run promises or strong marketing language.

```text
Treat agent-opfor as a pre-install experience asset, not an already-installed tool or a real runtime environment.

Output exactly four parts:
1. Ask me 3 necessary questions first.
2. Give an "experience script": use the three labels [Previewable before install], [Must verify after install], and [Insufficient evidence] to show how it might guide the workflow.
3. Give an after-install verification checklist: list which capabilities can only be confirmed after a real install, real host loading, and a real project run.
4. Give a cautious recommendation: only "worth researching/trialing further", "add information before deciding", or "not recommended to continue"; do not endorse the project.

Hard boundaries:
- Do not claim you have installed, run, executed tests, modified files, or produced real results.
- Do not write promise-like phrasing such as "auto-adapts", "guarantees passing", "perfect fit", or "strongly recommend installing".
- If you describe how it works after install, you must use a conditional such as "if installed successfully and the host loads the Skill correctly, it might...".
- The experience script may only be written as "example lines / hypothetical flow": use "might ask / might suggest / might show", not "has written, has generated, has passed, is running, is generating".
- Prompt Preview does not hand out install commands; if the user is ready to trial, only prompt them to read Quick Start and the Risk Card first and to verify in an isolated environment.
- Every project fact must come from a supported claim, evidence_refs, or source_paths; inferred/unverified items can only be risks or open questions.

```

### Role / Skill selection

- Goal: Pick the best-matching asset from the project's roles or Skills.
- Expected output: A list of candidate roles or Skills, each with an applicable scenario, evidence paths, risk boundary, and whether after-install verification is needed.

```text
Read role_skill_index and recommend 3-5 of the most relevant roles or Skills for my target task. For each recommendation, state the applicable scenario, likely output, risk boundary, and evidence_refs.
```

### Risk pre-check

- Goal: Identify environment, permission, rule-conflict, and quality risks before installing or adopting.
- Expected output: A checklist of environment, permission, dependency, license, host-conflict, quality risk, and unknown items.

```text
Based on risk_card, boundaries, and quick_start_candidates, give me a pre-install risk pre-check list. Do not run commands for me; only explain what I should check, why, and what impact a failure would have.
```

### Host AI kickoff instruction

- Goal: Turn the project context into a host AI instruction for the start of a conversation.
- Expected output: A pre-work instruction with clear boundaries and clear evidence citations, suitable to copy to a host AI.

```text
Based on the AI Context Pack for agent-opfor, generate a pre-work instruction I can paste to my host AI. This instruction must obey not_runtime=true and must not claim the project has been installed, run, or produced real results.
```

## Role / Skill Index

- Indexed 4 role / Skill / project-doc entries.

- **opfor-run** (skill): Run red-team attacks and generate a report for an agent target. Activation hint: When the user's task is highly relevant to the workflow described by “opfor-run”, use it for a pre-install experience first, then decide whether to install. Evidence: `skills/agent-redteaming/opfor-run/SKILL.md`
- **opfor-setup** (skill): Set up an agent or chatbot target for Opfor red-teaming. Activation hint: When the user's task is highly relevant to the workflow described by “opfor-setup”, use it for a pre-install experience first, then decide whether to install. Evidence: `skills/agent-redteaming/opfor-setup/SKILL.md`
- **opfor-mcp-run** (skill): Run red-team attacks and generate a report for an MCP server target. Activation hint: When the user's task is highly relevant to the workflow described by “opfor-mcp-run”, use it for a pre-install experience first, then decide whether to install. Evidence: `skills/mcp-redteaming/opfor-run/SKILL.md`
- **opfor-mcp-setup** (skill): Set up an MCP server target for Opfor red-teaming. Activation hint: When the user's task is highly relevant to the workflow described by “opfor-mcp-setup”, use it for a pre-install experience first, then decide whether to install. Evidence: `skills/mcp-redteaming/opfor-setup/SKILL.md`

## Evidence Index

- Indexed 78 evidence entries.

- **Why we built this** (documentation): Open-source adversary emulation for AI agents, LLM apps, and MCP servers. Test your AI like a real attacker would — from your CLI, your IDE, or a browser extension that anyone on your team can use. Evidence: `README.md`
- **Evaluators source of truth** (documentation): Author evaluator and suite markdown here. The engine, CLI, and tests read these paths directly: Evidence: `evaluators/README.md`
- **Suites** (documentation): Suites reference evaluator IDs the id: in each evaluator's frontmatter , never file paths — so moving an evaluator between family folders never breaks a suite. Evidence: `suites/README.md`
- **Access Control & Authorization** (documentation): Add an evaluator here if the attack crosses an authorization boundary — other users' data, higher privilege, or role/function the requester shouldn't reach. Examples: rbac, bola, bfla, identity-privilege-abuse. Evidence: `evaluators/agent/access-control/README.md`
- **Accuracy & Truthfulness** (documentation): Add an evaluator here if the attack tests fabrication, false-premise acceptance, or over-reliance . Examples: misinformation, hallucination, overreliance. Evidence: `evaluators/agent/accuracy/README.md`
- **Bias & Fairness** (documentation): Add an evaluator here if the attack tests discriminatory or inconsistent treatment by a protected attribute. Examples: bias-age, bias-disability, bias-gender, bias-race one file each . Evidence: `evaluators/agent/bias/README.md`
- **Brand & Conduct** (documentation): Add an evaluator here if the attack pushes the agent off-policy, off-brand, or out of scope . Examples: imitation, competitors, contracts, off-topic. Evidence: `evaluators/agent/brand-conduct/README.md`
- **Code & Output Execution** (documentation): Add an evaluator here if the attack's harm is input or output reaching a code / SQL / shell / markup sink . Examples: improper-output-handling, shell-injection, sql-injection, unexpected-code-execution. Evidence: `evaluators/agent/code-execution/README.md`
- **Information Disclosure** (documentation): Add an evaluator here if the attack's goal is to make the agent EXPOSE protected information. Examples: system-prompt-leakage, sensitive-disclosure, pii-direct, pii-session, pii-api-db, debug-access. Evidence: `evaluators/agent/disclosure/README.md`
- **Excessive Agency** (documentation): Add an evaluator here if the attack makes the agent take an action beyond its remit — ungated, destructive, or out-of-scope tool use. Examples: excessive-agency, tool-misuse. Evidence: `evaluators/agent/excessive-agency/README.md`
- **Harmful Content** (documentation): Add an evaluator here if the attack's success is the agent emitting disallowed/dangerous content in a specific harm category. Examples: harmful-bioweapons, harmful-cybercrime-malicious-code, harmful-self-harm, harmful-violent-crime, harmful-weapons-ied, … one file per category . Evidence: `evaluators/agent/harmful/README.md`
- **Prompt Injection & Jailbreak** (documentation): Add an evaluator here if the attack's mechanism is getting the agent to follow attacker input it should have ignored or to bypass a guardrail . Examples: prompt-injection directory form , jailbreaking, ascii-smuggling, hijacking, agent-goal-hijack. Evidence: `evaluators/agent/injection/README.md`
- **MCP Client Safety** (documentation): Add an evaluator here if the attack tests the agent's behaviour when it uses MCP agent as client . Examples: mcp-tool-description-injection, mcp-shadow-server, mcp-missing-authentication, mcp-scope-escalation, mcp-credential-exposure, mcp-intent-subversion, … the mcp- agent set . Evidence: `evaluators/agent/mcp-usage/README.md`
- **Memory & Knowledge Poisoning** (documentation): Add an evaluator here if the attack corrupts the agent's memory, RAG, or embeddings so it misbehaves later. Examples: memory-poisoning, memory-inject-plant, memory-inject-trigger, data-poisoning, vector-embedding-weaknesses. Evidence: `evaluators/agent/memory-rag/README.md`
- **Multi-Agent & Trust** (documentation): Add an evaluator here if the attack targets agent-to-agent or agent-to-human trust in a multi-party setup. Examples: inter-agent-communication, rogue-agents, cascading-failures, human-agent-trust. Evidence: `evaluators/agent/multi-agent/README.md`
- **Resource & Availability** (documentation): Add an evaluator here if the attack exhausts compute/tokens/cost or degrades availability . Examples: unbounded-consumption, reasoning-dos. Evidence: `evaluators/agent/resource/README.md`
- **Source White-box Analysis — skills only** (documentation): Source White-box Analysis — skills only Evidence: `evaluators/agent/source-analysis/README.md`
- **Supply Chain** (documentation): Add an evaluator here if the attack enters through a dependency or third-party component model, plugin, dataset, package . Examples: supply-chain. Evidence: `evaluators/agent/supply-chain/README.md`
- **Authentication & Authorization** (documentation): Add an evaluator here if the attack tests the MCP server's auth/authz enforcement . Examples: missing-authentication, oauth-token-passthrough, scope-escalation. Evidence: `evaluators/mcp/auth/README.md`
- **Information Disclosure** (documentation): Add an evaluator here if the attack makes the MCP server expose protected data . Examples: secret-exposure, cross-resource-leakage, resource-exposure. Evidence: `evaluators/mcp/disclosure/README.md`
- **Injection** (documentation): Add an evaluator here if the attack drives MCP tool arguments into a shell/exec or network sink . Examples: command-injection, ssrf. Evidence: `evaluators/mcp/injection/README.md`
- **Protocol & Telemetry** (documentation): Add an evaluator here if the attack targets MCP protocol handling or observability . Examples: protocol-abuse, intent-subversion, timing-side-channel, audit-telemetry. Evidence: `evaluators/mcp/protocol/README.md`
- **Source White-box Analysis — skills only** (documentation): Source White-box Analysis — skills only Evidence: `evaluators/mcp/source-analysis/README.md`
- **Supply Chain** (documentation): Add an evaluator here if the attack concerns MCP server provenance/integrity — impersonation or post-approval drift. Examples: mcp-supply-chain, shadow-mcp-server. Evidence: `evaluators/mcp/supply-chain/README.md`
- **Tool Poisoning** (documentation): Add an evaluator here if the attack concerns poisoned MCP tool descriptions, schemas, or return values served by the MCP server. Examples: tool-description-injection, tool-description-scan, content-injection, return-value-injection. Evidence: `evaluators/mcp/tool-poisoning/README.md`
- **@keyvaluesystems/agent-opfor-cli** (documentation): Opfor CLI — adversarial security testing for AI agents and MCP servers. Evidence: `runners/cli/README.md`
- **OPFOR Browser Extension** (documentation): Chrome/Brave MV3 extension for red-teaming embedded web chat agents . Evidence: `runners/extension/README.md`
- **@keyvaluesystems/agent-opfor-mcp** (documentation): Opfor MCP server — expose red-team tools to any MCP-compatible AI agent Cursor, Claude Desktop, etc. . Evidence: `runners/mcp/README.md`
- **@keyvaluesystems/agent-opfor-sdk** (documentation): Opfor SDK — programmatic adversarial testing for AI systems. Evidence: `runners/sdk/README.md`
- **SDK Examples in-repo** (documentation): Runnable examples for @keyvaluesystems/agent-opfor-sdk from the monorepo. Evidence: `runners/sdk/examples/README.md`
- **Package** (package_manifest): { "name": "@keyvaluesystems/agent-opfor-core", "version": "0.10.0", "description": "Opfor core engine — attacker prompt generation, judge, and execution shared by all runners", "license": "Apache-2.0", "private": true, "type": "module", "main": "./dist/index.js", "engines": { "node": " =20" }, "types": "./dist/index.d.ts", "exports": { ".": { "types": "./dist/index.d.ts", "default": "./dist/index.js" }, "./browser": { "types": "./dist/browser.d.ts", "default": "./dist/browser.js" }, "./execute/ .js": { "types": "./dist/execute/ .d.ts", "default": "./dist/execute/ .js" }, "./generate/ .js": { "types": "./dist/generate/ .d.ts", "default": "./dist/generate/ .js" }, "./targets/ .js": { "types":… Evidence: `core/package.json`
- **Package** (package_manifest): { "name": "agent-opfor", "version": "0.10.0", "description": "Opfor — security testing for AI agents and MCP servers workspace root ", "license": "Apache-2.0", "private": true, "type": "module", "workspaces": "core", "runners/cli", "runners/mcp", "runners/extension", "runners/sdk", "tests/e2e/sdk" , "files": "evaluators/", "suites/", "skills/", "README.md", "LICENSE" , "engines": { "node": " =20" }, "scripts": { "build": "npm run build:catalog && tsc -b core && npm run build -w runners/cli && npm run build -w runners/mcp && npm run build -w runners/sdk && npm run extension:catalog && npm run build:core --workspace=@keyvaluesystems/agent-opfor-extension", "build:ui": "cd runners/cli/ui && np… Evidence: `package.json`
- **Package** (package_manifest): { "name": "@keyvaluesystems/agent-opfor-cli", "version": "0.10.0", "description": "Opfor CLI — security testing for AI agents and MCP servers opfor setup run hunt ", "license": "Apache-2.0", "type": "module", "bin": { "opfor": "./dist/index.js" }, "files": "dist/", "data/", "evaluators/", "suites/", "atlas-data/" , "scripts": { "dev": "tsx src/index.ts", "build": "rm -rf dist && npm run build:ui && node scripts/bundle.mjs", "build:ui": "cd ui && npm install && npm run build", "start": "node dist/index.js", "typecheck": "tsc -p tsconfig.json --noEmit", "test": "node --import tsx/esm --test tests/ .test.ts", "prepack": "rm -rf ./evaluators ./suites ./data ./atlas-data ./LICENSE && cp -r ../..… Evidence: `runners/cli/package.json`
- **Package** (package_manifest): { "name": "@keyvaluesystems/agent-opfor-autonomous-ui", "private": true, "version": "0.10.0", "type": "module", "scripts": { "dev": "vite", "build": "vite build", "preview": "vite preview" }, "dependencies": { "react": "^19.1.0", "react-dom": "^19.1.0" }, "devDependencies": { "@types/react": "^19.1.0", "@types/react-dom": "^19.1.0", "@vitejs/plugin-react": "^4.5.0", "typescript": "^5.8.3", "vite": "^6.3.0" } } Evidence: `runners/cli/ui/package.json`
- **Package** (package_manifest): { "name": "@keyvaluesystems/agent-opfor-extension", "version": "0.10.0", "description": "Opfor browser extension MV3 — chat UI injector for live testing", "license": "Apache-2.0", "private": true, "type": "module", "scripts": { "build:catalog": "node scripts/build-catalog.mjs", "build:core": "node scripts/bundle-core.mjs", "ensure:core": "node scripts/ensure-core-bundle.mjs", "prebuild:core": "node scripts/ensure-core-bundle.mjs" }, "dependencies": { "yaml": "^2.8.3" }, "devDependencies": { "esbuild": "^0.28.1" } } Evidence: `runners/extension/package.json`
- **Package** (package_manifest): { "name": "@keyvaluesystems/agent-opfor-mcp", "version": "0.10.0", "description": "Opfor MCP server — expose red team tools to any MCP-compatible AI agent", "license": "Apache-2.0", "type": "module", "bin": { "opfor-agent-mcp": "./dist/index.js" }, "files": "dist/", "evaluators/", "suites/", "atlas-data/" , "scripts": { "dev": "tsx src/index.ts", "build": "rm -rf dist && node scripts/bundle.mjs", "typecheck": "tsc -p tsconfig.json --noEmit", "prepare": "echo 'run npm run build from the repo root'", "start": "node dist/index.js", "prepack": "rm -rf ./evaluators ./suites ./atlas-data ./LICENSE && cp -r ../../evaluators ./evaluators && cp -r ../../suites ./suites && mkdir -p ./atlas-data && cp… Evidence: `runners/mcp/package.json`
- **Package** (package_manifest): { "name": "@keyvaluesystems/agent-opfor-sdk", "version": "0.10.0", "description": "Opfor SDK — programmatic adversarial testing for AI systems", "license": "Apache-2.0", "type": "module", "main": "./dist/index.js", "types": "./dist/index.d.ts", "exports": { ".": { "types": "./dist/index.d.ts", "import": "./dist/index.js" } }, "files": "dist/", "data/", "evaluators/", "suites/", "atlas-data/" , "scripts": { "dev": "tsx src/index.ts", "build": "tsup", "typecheck": "tsc -p tsconfig.json --noEmit", "test": "node --import tsx/esm --test tests/ .test.ts", "prepack": "rm -rf ./evaluators ./suites ./data ./atlas-data ./LICENSE && cp -r ../../evaluators ./evaluators && cp -r ../../suites ./suites &&… Evidence: `runners/sdk/package.json`
- **AGENTS.md — Opfor** (documentation): This file is for AI coding agents Claude Code, Copilot, Cursor, etc. working in this repository. It describes the project structure, build system, key conventions, and how the core subsystems fit together. Evidence: `AGENTS.md`
- **Claude** (documentation): @AGENTS.md Evidence: `CLAUDE.md`
- **Contributing to Opfor** (documentation): Thanks for helping make AI red teaming better. Evidence: `CONTRIBUTING.md`
- **Opfor — assessment execution** (skill_instruction): Execute an Opfor assessment using pre-generated attack inputs. The /opfor-setup skill generates all attack variations beforehand; this skill executes them, judges responses, and generates a report. Evidence: `skills/agent-redteaming/opfor-run/SKILL.md`
- **Opfor — target configuration** (skill_instruction): Configure a target for an Opfor assessment. When this skill is installed in the user’s repo , prefer reading that repo endpoints, opfor.config , env examples, telemetry before a long questionnaire; then collect only what is still unknown. Evidence: `skills/agent-redteaming/opfor-setup/SKILL.md`
- **Opfor — MCP Assessment Execution** (skill_instruction): Execute an MCP adversarial assessment using pre-generated attack inputs. The /opfor-mcp-setup skill generates all attack variations beforehand; this skill connects to the MCP server, executes attacks, judges responses, and generates a report. Evidence: `skills/mcp-redteaming/opfor-run/SKILL.md`
- **Opfor — MCP Server Target Configuration** (skill_instruction): Opfor — MCP Server Target Configuration Evidence: `skills/mcp-redteaming/opfor-setup/SKILL.md`
- **License** (source_file): Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ Evidence: `LICENSE`
- **Opfor — Browser Extension** (documentation): The no-code red-team path. Install the extension, open any chat interface, click the icon, pick a suite, watch it run. Aimed at PMs, QA, designers, and security analysts — anyone who can't or won't open a terminal. Evidence: `docs/browser-extension.md`
- **Opfor — CLI** (documentation): The CLI handles everything: interactive setup, attack generation, firing attacks, judging responses, and producing reports. Evidence: `docs/cli.md`
- **Evaluator schema** (documentation): Evaluators are YAML files under evaluators/{agent mcp}/ at repo root. After adding or editing, run npm run build:catalog to rebuild the skill catalogs. Evidence: `docs/evaluator-schema.md`
- **Opfor — Evaluators and Suites** (documentation): An evaluator is a single attack-and-judge pattern e.g. prompt-injection , bola . Each evaluator is a YAML file — the attacker LLM reads it to craft prompts and the judge LLM uses its pass/fail criteria to score responses. Evidence: `docs/evaluators.md`
- **Opfor Hunt — Autonomous Red-Teaming** (documentation): Opfor Hunt — Autonomous Red-Teaming Evidence: `docs/hunt.md`
- **Opfor — MCP Server** (documentation): The MCP server exposes Opfor as tools that any MCP-compatible AI agent Cursor, Claude Desktop, Windsurf can call directly. No terminal required — the agent runs the full workflow from your chat. Evidence: `docs/mcp.md`
- **Opfor SDK** (documentation): Adversarial testing for AI systems. TypeScript-first. Evidence: `docs/sdk.md`
- **Target Session Handling** (documentation): How opfor delivers conversation context to an HTTP agent target across turns, and how it threads a session id. This applies to opfor run config file, wizard, SDK , the MCP server tool, and opfor hunt — they share one model. Local-script and browser-extension targets are covered at the end. Evidence: `docs/sessions.md`
- **Opfor — Skills** (documentation): Opfor ships Skills markdown instruction files an AI coding agent reads and follows for both agent and MCP server red-teaming. Install once, then trigger from chat inside your project. Evidence: `docs/skills.md`
- **Opfor — Trace-aware testing** (documentation): Using the SDK? See SDK telemetry sdk.md telemetry . Evidence: `docs/telemetry.md`
- **Types** (source_file): import type { Severity } from "../../evaluators/schema.js"; ⋮---- export interface VulnClass { id: string; name: string; severity: Severity; standards?: Record ; description: string; failRubric: string; passRubric: string; inspiration?: string; } ⋮---- export interface Persona { id: string; name: string; voice: string; traits: string; whenToUse: string; } ⋮---- export interface Strategy { id: string; name: string; mechanics: string; whenToUse: string; escalationNotes: string; } ⋮---- export interface KnowledgeBase { vulnClasses: VulnClass ; personas: Persona ; strategies: Strategy ; } ⋮---- export type KnowledgeKind = "vuln-class" "persona" "strategy"; Evidence: `core/src/autonomous/knowledge/types.ts`
- **Types** (source_file): import type { SessionConfig } from "../../execute/types.js"; ⋮---- export type TargetMode = "stateless" "stateful"; ⋮---- export interface TargetConfig { name: string; endpoint: string; apiKey?: string; headers?: Record ; mode: TargetMode; promptPath?: string; responsePath?: string; sessionField?: string; session?: SessionConfig; model?: string; } ⋮---- export interface HuntOptions { target: TargetConfig; objective: string; commanderModel: string; operatorModel: string; scoutModel: string; maxOperators: number; maxTurns: number; maxThreadTurns: number; maxTotalThreads: number; maxForksPerThread: number; maxTotalSends?: number; maxDepth: number; maxLeadsPerWave: number; budgetUsd?: number; v… Evidence: `core/src/autonomous/lib/types.ts`
- **Run** (source_file): import { randomUUID } from "node:crypto"; import { query, type Options, type AgentDefinition } from "@anthropic-ai/claude-agent-sdk"; import type { HuntOptions } from "../lib/types.js"; import { createTargetClient } from "../target/http.js"; import { loadKnowledge } from "../knowledge/load.js"; import { createRunLog } from "../state/runLog.js"; import { BudgetGuard } from "../lib/budget.js"; import { SessionGate } from "../../lib/sessionGate.js"; import type { RunContext } from "./context.js"; import { buildRedteamServer, REDTEAM SERVER NAME, toolId, TOOL NAMES } from "../tools/server.js"; import { buildHooks, type ProgressReporter } from "../state/hooks.js"; import { threadTreeText, counts… Evidence: `core/src/autonomous/orchestrator/run.ts`
- **Types** (source_file): import type { Severity as Severity } from "../../evaluators/schema.js"; import type { Verdict as Verdict } from "../../lib/judgeTypes.js"; ⋮---- export type Severity = Severity; export type Verdict = Verdict; ⋮---- export interface ReportTurn { turnIndex: number; prompt: string; response: string; persona?: string; strategy?: string; score?: number; } ⋮---- export interface SelfCheckResult { verdict: Verdict; score: number; confidence: number; reasoning: string; } ⋮---- export interface ReportFinding { findingId: string; vulnClassId: string; name: string; severity: Severity; standards?: Record ; threadId: string; strategy: string; personaArc: string ; verdict: Verdict; confidence: number; ev… Evidence: `core/src/autonomous/report/types.ts`
- **Server** (source_file): import { createSdkMcpServer } from "@anthropic-ai/claude-agent-sdk"; import type { RunContext } from "../orchestrator/context.js"; import { listKnowledgeTool, getKnowledgeTool } from "./knowledge.js"; import { reconProbeTool } from "./reconProbe.js"; import { sendToTargetTool } from "./sendToTarget.js"; import { forkThreadTool } from "./forkThread.js"; import { getThreadTool } from "./getThread.js"; import { flagLeadTool } from "./flagLead.js"; import { listLeadsTool } from "./listLeads.js"; import { selfCheckTool } from "./selfCheck.js"; import { recordFindingTool } from "./recordFinding.js"; import { registerInventionTool } from "./registerInvention.js"; import { submitReportTool } from "… Evidence: `core/src/autonomous/tools/server.ts`
- The remaining 18 evidence entries are in `AI_CONTEXT_PACK.json` or `EVIDENCE_INDEX.json`.

## Rules the Host AI Must Follow

- **Treat this asset as pre-work context, not a runtime environment.**: The AI Context Pack contains only an evidence-backed understanding of the project, not the project's executable state. Evidence: `README.md`, `evaluators/README.md`, `suites/README.md`
- **When answering the user, distinguish what can be previewed from what can only be verified after install.**: The consumer value of the pre-install experience comes from reducing bad installs and misjudgments, not from pretending to be a real run. Evidence: `README.md`, `evaluators/README.md`, `suites/README.md`

## Questions the User Should Answer First

- Which host AI or local environment do you plan to use it in?
- Do you just want to experience the workflow first, or are you ready to actually install?
- What matters most to you: install cost, output quality, or conflicts with your existing rules?

## Acceptance Checks

- Every capability claim can be traced back to a file path in evidence_refs.
- AI_CONTEXT_PACK.md does not package previews as a real run.
- The user can understand who it fits, what it can do, how to start, and the risk boundaries within 3 minutes.

---

## Doramagic Context Augmentation

The following sections strengthen the repository context for a host AI. Human Manual data is a reading route, and pitfall notes become operating constraints.

## Human Manual Outline

Usage rule: this is only a reading route and salience signal, not factual authority. Concrete claims must still return to repo evidence or Claim Graph.

Host AI hard rules:
- Do not treat page titles, section order, summaries, or importance values as factual project evidence.
- When explaining the Human Manual outline, state that it is only a reading route or salience signal.
- Capability, installation, compatibility, runtime state, and risk claims must cite repo evidence, source paths, or Claim Graph.

- **OPFOR Overview & System Architecture**: importance `high`
  - source_paths: README.md, core/src/index.ts, core/package.json, core/src/autonomous/index.ts, core/src/execute/attackRunner.ts
- **Runners & Entry Points (CLI, SDK, MCP Server, Browser Extension, Skills)**: importance `high`
  - source_paths: runners/cli/src/index.ts, runners/cli/src/commands/run.ts, runners/cli/src/commands/setup.ts, runners/cli/src/commands/hunt.ts, runners/sdk/src/opfor.ts
- **Evaluators, Patterns & Attack Coverage (OWASP + EU AI Act)**: importance `high`
  - source_paths: evaluators/README.md, evaluators/agent/access-control/bfla/evaluator.yaml, evaluators/agent/injection/jailbreaking/evaluator.yaml, evaluators/mcp/auth/missing-authentication.yaml, suites/agent/pre-deploy-critical.yaml
- **Configuration, Reports, Telemetry & Operations**: importance `high`
  - source_paths: core/src/config/schema.ts, core/src/lib/opforConfig.ts, core/src/providers/factory.ts, core/src/llm/openaiCompatible.ts, core/src/execute/runAgentLoop.ts

## Repo Inspection Evidence

- repo_clone_verified: true
- repo_inspection_verified: true
- repo_commit: `6b2e2b401712ad5dbecd634108f2964d29ae3fdd`
- inspected_files: `README.md`, `package.json`, `docs/browser-extension.md`, `docs/cli.md`, `docs/evaluator-schema.md`, `docs/evaluators.md`, `docs/hunt.md`, `docs/mcp.md`, `docs/sdk.md`, `docs/sessions.md`, `docs/skills.md`, `docs/telemetry.md`

Host AI hard rules:
- Without repo_clone_verified=true, do not claim that the source code has been read.
- Without repo_inspection_verified=true, do not write README, docs, or package-file conclusions as facts.
- Without quick_start_verified=true, do not claim that the Quick Start path has run successfully.

## Doramagic Pitfall Constraints

These rules come from Doramagic discovery, validation, or compilation findings. The host AI must treat them as operating constraints, not background notes.

### Constraint 1: Security or permission risk requires verification

- Trigger: Developers should check this security_permissions risk before relying on the project: feat: opfor setup wizard has no prompt for custom HTTP headers on url-transport MCP targets
- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: feat: opfor setup wizard has no prompt for custom HTTP headers on url-transport MCP targets. Context: Observed during installation or first-run setup.
- Why it matters: Developers may expose sensitive permissions or credentials: feat: opfor setup wizard has no prompt for custom HTTP headers on url-transport MCP targets
- Evidence: failure_mode_cluster:github_issue | https://github.com/KeyValueSoftwareSystems/agent-opfor/issues/166
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.

### Constraint 2: Security or permission risk requires verification

- Trigger: Developers should check this security_permissions risk before relying on the project: feat: support for evaluating Site-Specific Extension Execution
- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: feat: support for evaluating Site-Specific Extension Execution. Context: Source discussion did not expose a precise runtime context.
- Why it matters: Developers may expose sensitive permissions or credentials: feat: support for evaluating Site-Specific Extension Execution
- Evidence: failure_mode_cluster:github_issue | https://github.com/KeyValueSoftwareSystems/agent-opfor/issues/179
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.

### Constraint 3: Installation risk requires verification

- Trigger: Developers should check this installation risk before relying on the project: v0.10.0
- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: v0.10.0. Context: Observed during installation or first-run setup.
- Why it matters: Upgrade or migration may change expected behavior: v0.10.0
- Evidence: failure_mode_cluster:github_release | https://github.com/KeyValueSoftwareSystems/agent-opfor/releases/tag/v0.10.0
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.

### Constraint 4: Configuration risk requires verification

- Trigger: Developers should check this configuration risk before relying on the project: bug: Nested .opfor configs
- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: bug: Nested .opfor configs. Context: Observed when using node, linux
- Why it matters: Developers may misconfigure credentials, environment, or host setup: bug: Nested .opfor configs
- Evidence: failure_mode_cluster:github_issue | https://github.com/KeyValueSoftwareSystems/agent-opfor/issues/183
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.

### Constraint 5: Configuration risk requires verification

- Trigger: Developers should check this configuration risk before relying on the project: bug: Significant delay in registering pause button clicks.
- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: bug: Significant delay in registering pause button clicks.. Context: Observed when using node, linux
- Why it matters: Developers may misconfigure credentials, environment, or host setup: bug: Significant delay in registering pause button clicks.
- Evidence: failure_mode_cluster:github_issue | https://github.com/KeyValueSoftwareSystems/agent-opfor/issues/182
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.

### Constraint 6: Configuration risk requires verification

- Trigger: Developers should check this configuration risk before relying on the project: bug: browser extension targets login form instead of chatbot input during red-team assessment
- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: bug: browser extension targets login form instead of chatbot input during red-team assessment. Context: Observed when using node, linux
- Why it matters: Developers may misconfigure credentials, environment, or host setup: bug: browser extension targets login form instead of chatbot input during red-team assessment
- Evidence: failure_mode_cluster:github_issue | https://github.com/KeyValueSoftwareSystems/agent-opfor/issues/178
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.

### Constraint 7: Configuration risk requires verification

- Trigger: Developers should check this configuration risk before relying on the project: bug:browser extension generates next attack before the agent has completed its response
- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: bug:browser extension generates next attack before the agent has completed its response. Context: Observed when using node, linux
- Why it matters: Developers may misconfigure credentials, environment, or host setup: bug:browser extension generates next attack before the agent has completed its response
- Evidence: failure_mode_cluster:github_issue | https://github.com/KeyValueSoftwareSystems/agent-opfor/issues/180
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.

### Constraint 8: Configuration risk requires verification

- Trigger: Developers should check this configuration risk before relying on the project: feat: add first-class support for additional LLM providers
- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: feat: add first-class support for additional LLM providers. Context: Source discussion did not expose a precise runtime context.
- Why it matters: Developers may misconfigure credentials, environment, or host setup: feat: add first-class support for additional LLM providers
- Evidence: failure_mode_cluster:github_issue | https://github.com/KeyValueSoftwareSystems/agent-opfor/issues/181
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.
