What an AI penetration test covers
| Area | What the tester tries | OWASP (2026) | MITRE ATLAS |
|---|---|---|---|
| Prompt injection | Instructions in the chat and in everything the app reads: documents, web pages, emails, tool results, saved memory | LLM01 | AML.T0051 LLM Prompt Injection; AML.T0054 LLM Jailbreak |
| Tool and agent permissions | Getting the agent to call a tool it shouldn't, with arguments it shouldn't, without the approval step | LLM03; Agentic ASI02, ASI03 | AML.T0053 AI Agent Tool Invocation |
| Data leakage | Extracting the system prompt, other users' data, secrets in context, or sending data out through a tool call | LLM02, LLM08 | AML.T0069.002 System Prompt; AML.T0086 Exfiltration via AI Agent Tool Invocation |
| RAG isolation | Retrieving another tenant's documents; planting documents that get retrieved for a target question | LLM09, LLM05 | AML.T0070 RAG Poisoning |
| MCP servers | Unpinned or over-privileged servers, hidden instructions in tool descriptions, injection inside server code | LLM04; Agentic ASI04 | - |
| Output handling | XSS, SQL, shell and path payloads delivered through model output; Markdown images that leak data | LLM10 | - |
| Cost abuse | Maximum-size inputs, long reasoning, tool-call loops, anonymous use without quotas | LLM06 | AML.T0034 Cost Harvesting |
ATLAS IDs are from the MITRE ATLAS data release 2026.11. A dash means we did not map a single ATLAS technique to that row.
How it differs from a web application pentest
- The same input can give a different result. OWASP's 2026 prompt injection entry puts it plainly: "LLMs make no architectural distinction between instructions and data, and their behavior is stochastic." So each attack is repeated, and a finding reads "worked 4 of 20 times", not a single screenshot.
- The attack is plain language, and it doesn't have to come from the user. A web tester fuzzes parameters; an AI tester also writes the document, ticket or web page the model will read later.
- Many findings are design, not bugs. "The agent can send email and also reads untrusted email" has no patch. The fix is fewer tools, narrower credentials or a human approval step.
- Filters are not fixes. A blocklist that stops today's payload can fail against a rephrased one. OWASP recommends testing "against adaptive attackers who have read the deployed defense" and rejecting "static-only attack-success claims".
- The ordinary web tests still matter. The chat endpoint, the upload route and the tool backends are web services. Authentication, access control between tenants and rate limits belong in the same test.
Frameworks testers map to
- OWASP Top 10 for LLM Applications 2026 and the OWASP Top 10 for Agentic Applications 2026: the risk names most reports and questionnaires use. Our OWASP LLM Top 10 page maps the 2025 and 2026 numbering.
- OWASP GenAI Red Teaming Guide (22 January 2025): a holistic approach in four areas, "model evaluation, implementation testing, infrastructure assessment, and runtime behavior analysis".
- NIST AI 600-1, the Generative AI Profile of the AI Risk Management Framework (26 July 2024): describes AI red-teaming and notes that the quality of the results depends on the team's background and expertise.
- NIST AI 100-2 E2025 (March 2025): a taxonomy and terminology of attacks on machine learning systems and their mitigations, useful for naming what you found.
- MITRE ATLAS: a public knowledge base of adversary tactics and techniques against AI systems, with IDs like those in the table above.
Open-source tools: garak, promptfoo and PyRIT
| garak | promptfoo | PyRIT | |
|---|---|---|---|
| Maintainer | NVIDIA | promptfoo (its README says the company is now part of OpenAI and the project remains open source) | Microsoft AI Red Team and contributors |
| Licence | Apache-2.0 | MIT | MIT |
| What it is | "the LLM vulnerability scanner": probes a model or endpoint for prompt injection, data leakage, jailbreaks, hallucination, toxicity and more | A CLI and library for evaluating and red-teaming LLM apps, with an OWASP LLM Top 10 preset and CI/CD integration | A toolkit with a command-line scanner, a browser GUI (CoPyRIT) and a Python framework, including adaptive multi-turn attacks |
| How you point it at your app | Generators for Hugging Face, OpenAI, Bedrock, LiteLLM and "pretty much anything accessible via REST" | An HTTP API, a browser, or the model directly | HTTP, WebSockets, Playwright browser automation or a custom target |
| Start with | python -m pip install -U garak then garak --list_probes | npx promptfoo@latest redteam setup, then promptfoo redteam run and promptfoo redteam report | The getting-started docs at microsoft.github.io/PyRIT |
Two things to know before you rely on them. First, PyRIT's old repository, Azure/PyRIT, is archived with a notice that the project moved to github.com/microsoft/PyRIT; older blog posts still link the old one. Second, promptfoo's OWASP preset page lists the 2025 numbering (LLM06 Excessive Agency, LLM07 System Prompt Leakage), so translate its report IDs if your customer asks about the 2026 list.
What these tools do well is volume: hundreds of attack variants, scored automatically, repeatable in CI. Their red-team runs work by sending inputs and grading the outputs, so on their own they will not tell you that an MCP server was given your whole disk or that a GitHub token can merge. Pair them with a review of the configuration and permissions.
What the report should contain
- Scope and dates: which app, which environment, which user roles and tenants, what was out of scope.
- The exact configuration tested: model and version, system prompt version, tool and MCP server list with versions, RAG sources. AI behaviour changes when any of these change, so a result without them can't be compared later.
- Method and tools, with versions, and which tests were manual.
- Each finding: an ID, the OWASP risk (state the edition) and ATLAS technique, the input that worked, how often it worked out of how many tries, the impact in business terms, evidence (transcripts, logs, screenshots), the fix, and the retest result.
- A coverage table: each OWASP risk marked tested, not applicable or not tested, with the reason.
- Fixes in order: design changes (remove a tool, narrow a token, add approval) first, filters last.
How to prepare for an AI pentest
- Written authorisation naming the systems, dates and what the tester may and may not do.
- A staging environment that has the same tools, MCP servers and prompts as production, filled with fake data.
- Two test accounts in different tenants, so cross-tenant leakage can be tested.
- An inventory of tools: every tool and MCP server the model can call, what each can do, and the credentials it runs with.
- The system prompt and tool descriptions, so the tester can check for secrets and for rules that are only enforced in the prompt.
- Spending limits on the test environment, because automated tools send many requests.
- Access to logs of model calls and tool calls, so findings come with evidence.
What you can check yourself first
Fixing the cheap findings before a paid test means the tester spends time on the hard ones. These run in your browser:
- RAG chunk scanner: planted instructions, hidden text, keys and missing tenant fields in a vector-store export.
- MCP config checker: hard-coded tokens, unpinned servers, whole-disk access.
- MCP server security scanner: shell, path, SQL and URL handling in your own MCP server code.
- Agent Blast Radius: what your agent could break, scored from 10 answers or your MCP config.
- LLM API cost checker: model calls with no output limit or timeout.
When a customer asks how you test, see how to answer the AI security testing question.
Sources
- OWASP GenAI Security Project: Top 10 for LLM Applications 2026, LLM01:2026 Prompt Injection, Top 10 for Agentic Applications 2026, GenAI Red Teaming Guide
- NIST: AI 600-1 Generative AI Profile, AI 100-2 E2025 Adversarial Machine Learning
- MITRE ATLAS: atlas.mitre.org and the atlas-data release 2026.11
- Tools: NVIDIA/garak, promptfoo/promptfoo and promptfoo red team docs, microsoft/PyRIT
Checked 1 Dec 2026. Tool details change often; the projects' own docs win where they differ.
Related
- OWASP Top 10 for LLM Applications (2026), with a checklist
- What is prompt injection?
- Sample review report
FAQ
What is AI penetration testing?
A time-boxed security test of an application that uses a language model, aimed at the risks the model adds: prompt injection, tool and agent permissions, data leakage, RAG isolation, MCP servers, unsafe handling of model output and cost abuse. It ends with a report of findings and fixes, usually mapped to the OWASP Top 10 for LLM Applications.
Is AI red teaming the same as an AI penetration test?
The terms overlap. NIST AI 600-1 describes AI red-teaming as exercises, often in a controlled environment, to identify potential adverse behaviour or outcomes of a generative AI model or system and stress test safeguards. A penetration test is usually narrower: one application, an agreed scope and dates, and a findings report for the team that will fix it.
Which open-source tools are used for LLM penetration testing?
Common ones are garak (NVIDIA's LLM vulnerability scanner, Apache-2.0), promptfoo (evals and red teaming CLI, MIT) and PyRIT (Microsoft's AI red teaming toolkit, MIT, now at github.com/microsoft/PyRIT). They automate attack inputs and score responses; they do not replace a review of the agent's tool permissions and configuration.
How is an AI pentest different from a normal web application pentest?
Model behaviour is not deterministic, so a finding is a success rate over repeated attempts rather than a single pass or fail. Attacks are written in plain language and can arrive through any content the model reads. Many findings are design problems, such as an agent holding a tool it does not need, and the usual web tests (authentication, access control, rate limits) still apply to the endpoints around the model.
What should an AI penetration test report include?
Scope and dates, the exact model, prompt and tool configuration tested, the tools and versions used, and for each finding the OWASP and MITRE ATLAS mapping, the input that worked, how often it worked, the impact, the evidence, the fix and a retest result, plus a list of what was not tested.