Complete Guide
Advanced
2026 AI AppSec refresh

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

Offensive AI testing can affect real users, private documents, SaaS connectors, model logs, and automated actions. Confirm written authorization, approved test classes, data-handling rules, and emergency stop contacts before running any test.

Choose Your Track

Offensive AI Methodology

AI engagement planner

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.

Checks
12
Evidence
Required
Output
Markdown
01 Scoping

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.

OWASP LLM01OWASP LLM07
02 Prompt injection

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.

OWASP LLM01MITRE ATLAS AML.T0051
03 Abuse-case execution

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.

OWASP LLM01OWASP LLM05OWASP LLM06
04 Regression pack

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.

OWASP LLM09OWASP LLM10
05 Output handling

Verify that generated output cannot trigger unsafe rendering, hidden links, credential disclosure, or automated downstream actions.

Rendered output capture, sanitizer behavior, blocked content examples.

OWASP LLM02OWASP LLM05
06 Monitoring

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.

OWASP LLM10
07 Retrieval boundaries

Test cross-tenant retrieval, document-level ACLs, stale index entries, poisoned chunks, and citation integrity.

Corpus sample, retrieval trace, denied-document test, citation diff.

OWASP LLM02OWASP LLM06OWASP LLM08
08 RAG abuse paths

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.

OWASP LLM01OWASP LLM02OWASP LLM08
09 Knowledge ingestion

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.

OWASP LLM03MITRE ATLAS AML.T0046
10 Read scope

Confirm read tools cannot access secrets, unrelated tenants, local credential stores, or out-of-scope repositories.

Allowlist, denied read tests, data-boundary notes.

OWASP LLM06
11 Confidentiality

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.

OWASP LLM06OWASP LLM10
12 Hybrid routing

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.

OWASP LLM06OWASP LLM07

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.

Open full library
Foundations /01-introduction/

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.

Foundations /01-introduction/

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.

Operator Tooling /02-hexstrike/

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.

Operator Tooling /02-hexstrike/

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.

Operator Tooling /03-pentestgpt/

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.

Operator Tooling /03-pentestgpt/

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.

Tools and Evidence Matrix

PhaseToolingPurposeWhen to use
PlanAI Engagement PlannerBrowser-local test-plan generatorUse first for AI app and agent scoping
TestPyRIT / Garak / PromptfooRepeatable red-team and regression evaluationUse after a finding to prevent drift
RAGRetrieval traces + custom fixturesValidate ACLs, citations, and poisoning defensesUse for knowledge assistants
AgentMCP logs + sandbox policyReview tool calls, approvals, and memoryUse for copilots and workflow agents
GatewayAPI logs + route policyCheck tenant, retention, fallback, and cost controlsUse for model platforms
Supply ChainModelScan / Fickling / hashesReview model artifacts and unsafe loadersUse before local model adoption

Local and private model guidance

Prefer approved enterprise endpoints or local runtimes when client data, source code, credentials, regulated data, or engagement evidence is involved. The goal is privacy, reproducibility, and evidence control, not bypassing safety controls.

Report-Ready Deliverables

AI RoE addendum
AI attack-surface map
Prompt/RAG finding templates
Regression eval pack

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.

Authorized use only

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.