Skip to content
Offensive Security Glossary / LLM Penetration Testing

LLM Penetration Testing: Testing the Application Around the Model

What an LLM pentest covers, how it differs from model evaluation and web testing, and what a usable finding looks like.

What Is LLM Penetration Testing

LLM penetration testing is a security assessment of LLM-powered software, in which testers attempt to exploit the model's inputs, outputs, connected data and tools to cause unauthorized disclosure, actions or denial of service. It targets the deployed system (prompts, retrieval pipelines, plugins and tools, APIs and the surrounding web application), not only the model's behavior in isolation.

The term is also used loosely for the opposite idea, using LLMs to perform penetration tests. That meaning is covered under AI penetration testing. This page is about testing LLM applications.

What Is in Scope

ComponentWhat gets tested
Prompt layerSystem prompt leakage, instruction override, guardrail bypass
Retrieval (RAG)Indirect prompt injection through documents, access control on retrieved content, cross-tenant leakage in vector stores
Tools and agentsUnauthorized tool calls, excessive permissions, chained actions, confused-deputy abuse of the agent's identity
Output handlingModel output reaching browsers, SQL, shells or templates (XSS, SQLi, RCE downstream), data exfiltration via rendered links
Surrounding application and APIAuthentication, authorization (including BOLA on conversation and file IDs), rate limiting, cost controls
Supply chainModel and package provenance, third-party plugins and MCP servers

How It Differs From Related Activities

ActivityFocus
LLM penetration testingExploiting a specific deployed application to show security impact
AI red teamingBroader adversarial testing of AI systems for safety, misuse and security, often scenario- or harm-driven
Model evaluation and benchmarksMeasuring model behavior across standardized prompts, independent of any one application
Web application pentestingThe non-LLM attack surface, still required for the same application

Method

  1. Architecture review: map every input source, the model provider, retrieval stores, tools, permissions and output sinks.
  2. Threat modeling: identify which OWASP LLM Top 10 risks apply and which outcomes would matter (data exposure, actions, cost).
  3. Direct testing: prompt injection, jailbreak and system prompt extraction attempts, including multi-turn and encoded variants.
  4. Indirect testing: plant payloads in documents, pages, emails or tool responses the system ingests.
  5. Authorization testing: attempt cross-user and cross-tenant access through the chat, retrieval and file features.
  6. Impact demonstration: show the concrete outcome: a record changed, a message sent, data retrieved.
  7. Repeat and measure: run each successful attack multiple times and report a success rate, because outputs are non-deterministic.

What a Good Finding Includes

  • The exact input or planted content, the model and configuration version, and the full response.
  • The resulting action or data exposure, with evidence from logs or the affected system.
  • Success rate across repeated attempts.
  • Mapping to the OWASP LLM Top 10 and MITRE ATLAS technique where relevant.
  • Fixes at the right layer: tool permissions, output handling or access control, not only prompt wording.

How FireCompass Approaches LLM Application Testing

FireCompass tests AI-powered applications together with the web and API layers they run on, so a prompt injection that leads to an API authorization failure is reported as one attack chain with evidence. See AI red teaming and AI API penetration testing.

Sources and Standards

Frequently Asked Questions

What is LLM penetration testing?

A security assessment of an application built on a large language model, in which testers try to exploit prompts, retrieved data, tools and outputs to cause unauthorized disclosure or actions.

How is LLM pentesting different from AI red teaming?

LLM pentesting focuses on exploiting a specific deployed application for security impact. AI red teaming is broader and also covers safety, misuse and harmful-output scenarios.

Do LLM applications still need traditional web and API testing?

Yes. The chat interface, file handling, authentication and APIs are conventional attack surface and are often where LLM attacks turn into real impact.

Why are LLM pentest results reported as success rates?

Model outputs are non-deterministic, so the same attack may succeed on some attempts and not others. A success rate shows how reliably an attacker could reproduce it.

What framework do LLM pentests map to?

Most map findings to the OWASP Top 10 for LLM Applications and to MITRE ATLAS techniques, alongside the OWASP Top 10 and API Security Top 10 for the surrounding application.

Further Reading

Reviewed against the primary sources cited on this page. Verified 2026-12-02.

Test Your AI Features and the APIs Behind Them

Run a free AI pentest against your web app and API surface and get proof-of-exploit findings, not a risk score.

Free AI Pen Test

No credit card. Findings include reproducible steps and exploit code.

Firecompass ranked #1 AI on HackerOne. Read more →