Attack chains are defined as YAML files. QAI includes reference templates for common AI system architectures. Use templates as starting points for custom chains.Documentation Index
Fetch the complete documentation index at: https://docs.q-uestionable.ai/llms.txt
Use this file to discover all available pages before exploring further.
Chain YAML Structure
A chain definition consists of metadata and an ordered list of steps:Top-Level Fields
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Unique identifier (kebab-case recommended) |
name | string | Yes | Human-readable chain name |
category | string | Yes | Architecture category: rag_pipeline, agent_delegation, mcp_ecosystem, or hybrid |
description | string | Yes | Detailed description of what the chain demonstrates |
steps | array | Yes | List of attack steps in execution order |
entry_cves | array | No | Optional CVE IDs used as entry points |
Step Fields
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Unique step identifier within the chain |
name | string | Yes | Human-readable step description |
module | string | Yes | Which qai module provides this step: audit, inject, ipi, cxp, or rxp |
technique | string | Yes | Specific technique within the module |
depends_on | array | No | List of step IDs that must succeed before this step |
trust_boundary | string | No | System boundary crossed by this step |
on_success | string | No | Step ID to execute on success, or abort to end chain |
on_failure | string | No | Step ID to execute on failure (default: abort) |
terminal | boolean | No | Whether this is the final step (default: false) |
inputs | object | No | Input parameters for live execution (ignored in dry-run). Set manual_gate: true for IPI/CXP steps that require human action before continuing |
relevant_categories | array | No | Audit finding categories this step is relevant to (e.g., tool_poisoning, command_injection). Used for coverage tracking and entry point matching |
Trust Boundaries
Trust boundaries identify system crossings during an attack:| Boundary | Meaning |
|---|---|
client-to-server | External input entering the system |
tool-to-agent | Tool output influencing agent reasoning |
agent-to-tool | Agent invoking a tool |
agent-to-agent | One agent influencing another |
llm-to-agent | LLM output shaping agent behavior |
user-to-system | User input entering application logic |
agent-to-data | Agent accessing data stores or retrieval layers |
attacker-to-document | Attacker-crafted content entering document ingestion |
attacker-to-context | Poisoned context files entering IDE/assistant |
corpus-to-retriever | Document corpus influencing retrieval ranking |
retriever-to-agent | Retrieved content shaping agent behavior |
agent-to-server | Agent-generated code deployed as server |
Built-in Templates
delegation-hijack
Category: agent_delegation Exploit weak tool trust boundaries to hijack agent delegation. Inject instructions via tool output, escalate through cross-tool trust, then manipulate downstream agent behavior.mcp-server-compromise
Category: mcp_ecosystem Discover command injection vulnerability via audit scan, exploit via tool poisoning to manipulate agent behavior, then escalate across tools to reach sensitive data.rag-trust-escalation
Category: rag_pipeline Poison a tool description to inject malicious instructions, escalate through cross-tool agent delegation, then exfiltrate data via output injection. Demonstrates three trust boundary crossings in a single attack path.document-poisoning
Category: hybrid Generate IPI payloads, pause for human deployment into a target agent’s ingestion pipeline, then audit scan the target to check for exploitation evidence.context-poisoning
Category: hybrid Build a poisoned context file repo, pause for human to test in a coding assistant, then audit scan the generated server for vulnerabilities.rag-validation
Category: rag_pipeline Validate that poison documents achieve high retrieval rank, then generate IPI payloads targeting the retrieval path.Writing Custom Chains
- Define the attack hypothesis — What architecture are you targeting? What vulnerabilities will you exploit?
- Identify steps — Break down the attack into sequential techniques:
- Map trust boundaries — Document which system boundaries each step crosses:
- Validate the chain structure:
- Dry-run to trace the path:
- Execute against real targets (if applicable):
Module & Technique Reference
Chain steps reference two modules. The validator checks that each step’smodule and technique are valid.
audit module
Any of the 10 audit scanner names can be used as a technique. These are the same names used with--checks on qai audit scan:
injection, auth, token_exposure, permissions, tool_poisoning, prompt_injection, audit_telemetry, supply_chain, shadow_servers, context_sharing
inject module
Three injection technique categories:description_poisoning— Embed instructions in MCP tool descriptionsoutput_injection— Inject instructions into tool response contentcross_tool_escalation— Chain trust across multiple tools to escalate
ipi module
IPI steps generate poisoned documents. Thetechnique field is the document format:
pdf, md, html, docx, ics, eml, image
IPI steps typically use manual_gate: true in their inputs, since the researcher must deploy the generated documents to the target system before the chain continues.
cxp module
CXP steps build poisoned context file repositories. Thetechnique field is the format ID:
cursorrules, claude-md, copilot-instructions, windsurf, cline, aider, codex, devin
CXP steps typically use manual_gate: true, since the researcher must open the repo in a coding assistant and run the trigger prompt.
rxp module
RXP steps validate retrieval poisoning. Thetechnique field is the embedding model ID:
minilm-l6, minilm-l12, bge-small, or any HuggingFace sentence-transformers model name.
RXP requires the optional [rxp] dependencies.
Five modules are valid chain steps:
audit, inject, ipi, cxp, and rxp. The proxy module is not a chain step — it operates as background traffic capture correlated to chain execution via chain_run_id and chain_step_id fields on proxy sessions.Best Practices
Sequencing- List steps in logical execution order
- Use
on_successandon_failurefor control flow - Mark the final step with
terminal: true
- Use descriptive step names (kebab-case for IDs)
- Include the technique name for clarity
- Document the trust boundary impact
- Keep dependencies explicit with
on_successtransitions - Avoid cycles (chains must be DAGs)
- Make failure handling clear with
on_failure
- Write detailed descriptions explaining the attack
- Include the architecture being targeted
- Document entry points if applicable