Skip to content
VITI Security

LLM Application Penetration Testing: How to Test an AI Feature

by VITI Security TeamNov 27, 2026

How to penetration test a chatbot, AI assistant or LLM-powered feature, using the OWASP Top 10 for LLM Applications as the checklist.

LLM Application Penetration Testing: How to Test an AI Feature - VITI Security

An LLM application penetration test checks whether the AI feature in your product can be made to leak data, ignore its instructions, take actions it should not, or produce harmful output under your name. The OWASP Top 10 for LLM Applications (2025 edition) is the usual checklist. Most real findings come from what the model is connected to, such as documents, tools and APIs, rather than from the model itself, so the test covers the whole application around it.

Why AI features need a separate test

A traditional pentest looks for code that handles input unsafely. In an LLM feature, the input is natural language and the processing is a model whose behaviour you cannot fully specify. Instructions can arrive from the user, from a retrieved document, from a web page the assistant reads, or from an email it summarises. Any of these can carry text that changes what the model does.

The risk grows with what the model can reach. A chatbot that only answers from a public FAQ has little to leak. An assistant that can search your customer records, send email or call internal APIs needs the same authorisation testing as any other privileged user.

The checks that matter most

These map to the OWASP Top 10 for LLM Applications 2025 and cover where we see the most serious issues.

  • Prompt injection, direct and indirect: can a user or a planted document override the system instructions?
  • Sensitive information disclosure: can the model be led to reveal other users' data, internal documents or secrets in its context?
  • System prompt leakage: does the system prompt contain credentials, internal URLs or rules an attacker could use?
  • Excessive agency: can the model call tools or APIs beyond what the current user is allowed to do?
  • Improper output handling: is model output inserted into web pages, SQL or shell commands without encoding or checks?
  • Vector and embedding weaknesses: can one tenant's documents be retrieved in another tenant's session?
  • Unbounded consumption: can a user run up large token bills or slow the service with crafted requests?

Authorisation is the core of the test

The model must never be the thing that decides access. If an assistant can look up orders, the order API it calls must check that the current user owns the order, regardless of what the model asks for. Testers try to talk the model into requesting other users' data, then check whether the backend refuses.

The same applies to retrieval. Documents should be filtered by the user's permissions before they reach the model's context, not after the model has read them.

What to give the tester

Like an API test, an LLM test is more useful grey box.

  • Test accounts in at least two tenants or customers, with different permissions.
  • A description of every tool, plugin or function the model can call.
  • The data sources used for retrieval and how access to them is filtered.
  • The system prompt, or a description of its rules, if you are comfortable sharing it.
  • Any content filters or guardrails in place, so the tester can try to bypass them.

An example of indirect prompt injection

Indirect prompt injection is the finding that surprises teams most. Imagine a support assistant that can read a customer's previous tickets and send emails on their behalf. An attacker submits a ticket containing hidden text: an instruction telling the assistant to forward the conversation history to an external address. Later, when a support agent asks the assistant to summarise that customer's tickets, the model reads the planted instruction and may act on it.

Nothing in this chain is a traditional bug. The model is doing what language models do: following instructions in its context. The fix is architectural. The email tool should only send to addresses on the customer record, actions with side effects should need human confirmation, and content from tickets should be clearly separated from instructions in the prompt, knowing that separation reduces but does not remove the risk.

A tester will plant content like this in every data source the model reads, including uploaded files, web pages and emails, and watch what the assistant does with it.

Fixes that hold up

Prompt wording alone does not fix prompt injection. Durable fixes sit outside the model: enforce permissions in the APIs the model calls, require user confirmation for actions with side effects, encode model output before rendering it, keep secrets out of prompts, and limit tokens and request rates per user.

Our earlier posts on prompt injection in production cover real attack patterns. To scope a test of your AI feature, see VAPT services.

Frequently asked questions

Can prompt injection be fully prevented?

Not with current models. The practical goal is to limit the damage: the model should never have more access than the user, and actions with side effects should need confirmation.

Is an LLM pentest different from a normal web app test?

It includes a normal web and API test of the surrounding application, plus checks specific to language models such as prompt injection, data leakage through retrieval and excessive agency.

Which standard is used for LLM security testing?

The OWASP Top 10 for LLM Applications is the most widely used checklist. NIST's AI Risk Management Framework is often used alongside it for governance.

Do I need to share my system prompt?

It helps but is not required. Testers will usually try to extract it anyway, which is itself a useful finding.

Shipping an AI feature?

We test the model, the tools it can call and the data it can reach, and show you which fixes hold up outside the prompt.