AI and LLM security testing
An AI feature is a normal application with one new property: part of its control flow is decided by a model reading untrusted text. That single change breaks most of the assumptions conventional application testing relies on. Input validation does not help when the input is a sentence. Output filtering does not help when the output is the action.
The assessments here target the application wrapped around the model — the tools it can call, the data it can reach, the tenants it serves and the places its output ends up. The model weights are not the target.
What an assessment covers
Direct prompt injection. Whether the system prompt survives contact with a user, whether refusal rules hold under rephrasing, encoding and multi-turn drift, and what the model discloses about its own configuration.
Indirect injection. The more realistic attack. Instructions arrive through something the model ingests rather than something the user types: a PDF, a support ticket, a web page it fetches, a calendar invite, a code comment, or the response from another tool. Any of those is an instruction channel.
Tool and function-call abuse. What the agent is allowed to invoke, whether parameters can be steered, and whether a sequence of individually harmless calls composes into something destructive. Excessive agency is usually a design decision, and it is testable.
Agent identity and tenancy. When the agent acts, which principal is it acting as? If the tenant is resolved from a caller-supplied field rather than the authenticated session, one customer's key can drive another customer's agent. This is the same class of bug as any broken object-level authorisation, with a new object type.
MCP servers and connectors. Tool descriptions are instructions the model trusts. A connector that is over-scoped, unauthenticated on localhost, or able to describe itself as something it is not, extends the attack surface well past the chat window.
Retrieval and memory. Whether a poisoned document in the corpus can steer answers, whether embeddings leak across tenants, and whether conversation memory persists between users who should be isolated.
Output handling. Model output rendered into HTML, markdown, SQL, shell or a downstream API is an injection vector in the other direction. Anything the model produces should be treated as untrusted input by whatever receives it.
Exfiltration and cost. Markdown image callbacks and links that carry data out in the request, and token amplification that turns a cheap endpoint into an expensive one.
Method
- Threat model first: enumerate every tool, credential, data store and network path the model can touch, then decide what a successful attack would actually gain.
- Build a reproducible prompt corpus per objective, one case per claim, run against a pinned model version so results can be re-checked after a fix.
- Attack the seams, not the chat box: the retrieval step, the tool router, the memory store, the connector config.
- Score each case pass or fail with the transcript attached, then retest after remediation.
Deliverables
A written report with reproducible cases, transcripts and the control that should have stopped each one, mapped to the OWASP Top 10 for LLM Applications and MITRE ATLAS where the finding fits an entry. The test corpus is handed over so the team can run it as a regression suite after every model or prompt change, because defence in this area degrades quietly.
Common questions
What is AI or LLM penetration testing?
An assessment of a system built on a language model, tested the way an attacker would use it: forcing it to ignore instructions, feeding it instructions through the documents it reads, abusing the tools it can call, and checking whether it can be pushed into another tenant's data. The target is the application around the model, not the weights.
Can prompt injection be fixed completely?
No. Any system that places untrusted text in the same context window as instructions can be injected. The realistic goal is containment: least-privilege tools, confirmation before destructive actions, per-tenant scoping, output filtering and monitoring. Testing proves which of those controls actually hold under pressure.
Do you need production access?
No. Testing runs against staging with production-like configuration, or production with read-only test accounts where staging is unrepresentative. Destructive tool calls are exercised with sandboxed credentials.
Related: AI agents for hacking · API security testing · Android application testing · how an assessment runs