Offensive AI
A practitioner playbook for testing AI-enabled applications, RAG systems, model gateways, tool-using agents, AI-assisted pentest workflows, and developer copilots during authorized engagements.
Ethical and legal boundary
Choose Your Track
Test AI Applications
Scope, map, test, evidence, and report on chatbots, RAG systems, model APIs, agents, and AI-backed product features.
AI app pentest flowAssess RAG Systems
Evaluate document ingestion, retrieval boundaries, tenant ACLs, poisoned chunks, citation integrity, and data leakage.
Retrieval securitySecure Agents and Tools
Review MCP, tool permissions, approvals, memory, sandboxing, browser/computer-use agents, and audit trails.
Permission modelBuild AI Regression Evals
Turn prompt injection, RAG, and agent findings into PyRIT, Garak, Promptfoo, and custom eval regression gates.
Evaluation workbenchOffensive AI Methodology
Build a scoped AI test plan in seconds
Select the system shape and generate a practitioner checklist mapped to OWASP LLM, MITRE ATLAS, evidence, and report deliverables.
Document model/provider, user roles, data classes, tool permissions, allowed tests, and explicit no-go actions before testing begins.
Rules of engagement addendum, architecture sketch, permission inventory.
Test direct and indirect instruction conflicts across user input, retrieved content, files, tickets, web pages, and third-party connectors.
Prompt, source content, model response, guardrail behavior, impact notes.
Run at least one end-to-end authorized abuse path that starts with adversarial input and reaches an unsafe answer, data exposure, permission decision, or attempted tool action.
Abuse-case objective, fixture data, model context, response, downstream effect, and business-impact statement.
Convert accepted findings into repeatable evals with expected safe behavior, owner, severity, and rerun instructions.
Prompt/eval file, fixture IDs, scoring rule, model version, prompt version, pass/fail output.
Verify that generated output cannot trigger unsafe rendering, hidden links, credential disclosure, or automated downstream actions.
Rendered output capture, sanitizer behavior, blocked content examples.
Confirm prompts, retrieval hits, tool calls, approvals, and high-risk denials are logged with enough context for incident response.
Log samples, alert rules, retention policy, privacy notes.
Test cross-tenant retrieval, document-level ACLs, stale index entries, poisoned chunks, and citation integrity.
Corpus sample, retrieval trace, denied-document test, citation diff.
Seed harmless poisoned documents, cross-tenant canaries, stale index records, and citation-laundering fixtures to prove retrieval trust-boundary failures.
Document ID, chunk ID, retrieval score, source ACL, answer text, citation comparison, and canary result.
Review upload, crawl, sync, and connector paths for malicious instructions, hidden text, metadata injection, and unsafe file parsing.
Ingestion path map, sample poisoned document, sanitizer output.
Confirm read tools cannot access secrets, unrelated tenants, local credential stores, or out-of-scope repositories.
Allowlist, denied read tests, data-boundary notes.
Prefer local or approved enterprise endpoints, redact secrets before prompts, and record exactly where client data is processed.
Data-flow record, redaction examples, approved endpoint list.
Verify sensitive prompts route only to approved local/private endpoints and fallback behavior does not leak data to public providers.
Routing policy, fallback test, denied external call.
Offensive Test Case Library
Authorized AI Abuse Cases
Use these as engagement seeds: each case needs written scope, controlled fixtures, and evidence capture before it becomes a finding.
Trust-boundary sketch
Draw where user prompts, system prompts, retrieved data, tool schemas, memory, and output consumers intersect.
Authorized setup: Work from architecture docs, approved interviews, and staging observations.
Evidence: Boundary diagram plus list of untrusted-to-trusted transitions for later testing.
First abuse hypothesis
Write three testable hypotheses for prompt injection, retrieval abuse, or unsafe tool use.
Authorized setup: Use only permitted fixtures and known test accounts.
Evidence: Hypothesis, expected control, observed behavior, and next test decision.
Tool allowlist boundary test
Verify whether the agent can invoke only approved tools and arguments for the engagement.
Authorized setup: Configure a lab target and a deliberately restricted tool profile.
Evidence: Allowed/denied tool calls, arguments, approval prompts, and audit records.
Autonomous chain review
Run a harmless recon-to-report chain and identify where human approval should interrupt escalation.
Authorized setup: Use a training target, read-only tooling, and disabled exploit actions.
Evidence: Agent plan, tool sequence, operator approvals, and final report artifacts.
Copilot false-positive/false-negative benchmark
Give the copilot a known vulnerable and known safe fixture, then measure missed and hallucinated findings.
Authorized setup: Use lab apps or sanitized client snippets approved for AI processing.
Evidence: Prompt, model output, ground truth, verification notes, and reporting decision.
Proxy evidence enrichment
Use AI to summarize suspicious traffic and identify follow-up tests without auto-executing unsafe requests.
Authorized setup: Use captured traffic from an approved target or lab replay.
Evidence: Request/response IDs, AI rationale, manual validation, and final finding status.
Guide Sections
Grouped by workflow, matching the sidebar — start with a lane, not a page number.
Start Here
Build Capability
Attack AI Apps
Agents & MCP
Offensive Operations
Advanced & Closeout
Tools and Evidence Matrix
| Phase | Tooling | Purpose | When to use |
|---|---|---|---|
| Plan | AI Engagement Planner | Browser-local test-plan generator | Use first for AI app and agent scoping |
| Test | PyRIT / Garak / Promptfoo | Repeatable red-team and regression evaluation | Use after a finding to prevent drift |
| RAG | Retrieval traces + custom fixtures | Validate ACLs, citations, and poisoning defenses | Use for knowledge assistants |
| Agent | MCP logs + sandbox policy | Review tool calls, approvals, and memory | Use for copilots and workflow agents |
| Gateway | API logs + route policy | Check tenant, retention, fallback, and cost controls | Use for model platforms |
| Supply Chain | ModelScan / Fickling / hashes | Review model artifacts and unsafe loaders | Use before local model adoption |
Local and private model guidance
Report-Ready Deliverables
Section Command Center
Operator Playbook
Use the section as a complete authorized AI red-team workflow: scope, plan, test, prove impact, and convert findings into regression checks.
Offensive Focus
- Start with the planner, then choose the track that matches the target: RAG, agents, MCP, model APIs, coding agents, recon, or supply chain.
- Treat every AI feature as a trust-boundary problem: untrusted instructions, retrieved data, tool permissions, memory, logs, and downstream consumers.
- Make every test report-ready by capturing evidence before tuning prompts or guardrails.
Evidence To Capture
- Written scope and allowed test classes
- Timestamped prompts, retrieved context, tool calls, and response artifacts
- Request IDs, model/provider/version, policy decisions, and tenant or user role
- Screenshots or exported logs that reproduce the finding without exposing client secrets
Offensive Test Cases
AI attack-surface kickoff
- Objective
- Map all prompt, retrieval, model, tool, memory, approval, and output paths for a target AI workflow.
- Authorized setup
- Use the engagement RoE to identify approved accounts, fixtures, providers, and prohibited actions.
- Evidence
- Attack-surface map, trust-boundary notes, allowed test classes, and risk-ranked test backlog.
End-to-end abuse path
- Objective
- Prove one complete abuse path from adversarial input to unsafe output, retrieval leak, or tool action.
- Authorized setup
- Use harmless canary data and staging tools with rollback or read-only controls where possible.
- Evidence
- Prompt, retrieved chunks, tool arguments, model output, downstream side effect, and remediation recommendation.
Common Findings
- AI features are tested like normal web forms even though they introduce retrieval, memory, and tool-use boundaries.
- Engagement scope allows web testing but omits model providers, prompt logs, vector stores, and agent tools.
- Findings lack reproducible fixtures, making fixes hard to verify after a model or prompt change.
Lab Ideas
- Build a tiny AI support bot with one retrieval source and one tool, then test each trust boundary.
- Create an AI RoE addendum for a sample SaaS product.
- Run the planner for three target profiles and compare the generated evidence checklist.
Related Guides
Secure Architecture
Design patterns for safer AI-enabled systems and trust boundaries.
Threat & Risk Assessment
Risk framing for AI, cloud, and third-party model adoption.
Source Code Review
Manual and automated review methods for AI-generated or AI-reviewed code.
DFIR
Evidence handling and incident response process for AI-related events.