What is prompt injection testing?
Prompt injection testing is a targeted attack on the instructions your model follows. Grapefruit sends crafted inputs through every channel your LLM feature reads, finds the ones that override your system prompt, and then pushes each one as far as it goes: into your data, your tools and your users' browsers.
The question worth paying for is not whether your model can be talked out of its rules. With enough attempts, most can. The question is what happens next in your product. A finding that says 'the bot went off-script' is trivia. A finding that says 'the bot emailed the customer list' is a release blocker.
What is the difference between direct and indirect prompt injection?
Direct prompt injection comes from the person typing: the attacker is your user and writes the malicious instruction into the chat box. Indirect prompt injection hides the instruction in content the model reads later, such as a web page, a document, an email or a database record, so the victim is an innocent user.
Indirect injection is the one that scales. The attacker needs no account and no conversation with your product. They plant text where your model will find it and wait. Any feature that retrieves, browses, summarises or reads uploads has this surface.
| Injection type | Where it enters | Example impact |
|---|---|---|
| Direct injection | The chat box or any prompt field the user controls | A user overrides the system prompt and gets answers or actions meant for staff |
| Indirect, web content | Pages the model browses or fetches | Hidden text on a page redirects the agent to send conversation data to an outside address |
| Indirect, documents and uploads | PDFs, resumes, tickets, spreadsheets | A resume tells the screening assistant to rank it first |
| Indirect, email and messages | Inbound mail an assistant reads or triages | One email makes the assistant forward a private thread to the attacker |
| Indirect, RAG and stored data | Knowledge base entries, product reviews, profile fields | A poisoned record is retrieved for other users and steers their answers |
| Tool output injection | Results returned by tools and third-party APIs | A tool response carries instructions the agent treats as its next task |
What can an attacker do with a successful prompt injection?
A successful injection lets an attacker borrow whatever your LLM feature is allowed to do. That usually means three things: pulling data out through tool calls, reading the system prompt you assumed was private, and getting the model to emit output that your own application then renders or executes.
These outcomes map to LLM01 Prompt Injection, LLM05 Improper Output Handling, LLM06 Excessive Agency and LLM07 System Prompt Leakage in the OWASP Top 10 for LLM Applications 2025.
- Data exfiltration via tool calls. The injected instruction tells the model to call a search, email or HTTP tool with private data in the arguments. Your own tool carries the data out.
- System prompt leakage. The attacker recovers the hidden instructions, along with any internal rules, endpoint names or keys someone left in them.
- Unsafe output rendered in the app. The model is steered into producing markup or a link that your front end renders, turning a text trick into script running in another user's session.
- Unauthorized actions. In an agent, the injection picks the tool and the arguments: the refund, the record update, the message sent in your company's name.
How is a prompt injection finding proven?
Each finding comes with the exact request that carried the injection and the response that shows it worked. Your engineer pastes the request, runs it, and watches the model leak the prompt or make the tool call. After the fix, the same request runs again and the attack fails in front of you.
This is where a lot of AI testing lets buyers down. In a Pentest-Tools survey of 158 respondents in June 2026, 87.8% hit AI pentest findings that needed significant manual validation. A screenshot of one lucky conversation is a story. A captured request and response is evidence your team can act on.
Findings are ranked critical, high, medium or low in the portal, so the injection that reached customer data sits above the one that changed the bot's tone.
Why do prompt injection filters keep failing?
Filters fail because the model reads instructions and data in the same channel. There is no reliable marker that separates 'text to process' from 'text to obey', so a filter is guessing at intent. Attackers rephrase, translate, encode or split the instruction across turns, and the guess goes wrong.
A blocklist catches yesterday's phrasing. A classifier in front of the model catches more, and still sees a fraction of what indirect injection can deliver through a document or a tool result. Filters are worth having. They lower the volume. They do not decide what a successful injection can reach.
What decides it is the design around the model: which tools it holds, whose permissions those tools run with, and what your app does with the output. That is why Grapefruit tests the injection and the blast radius together.
What gets tested alongside the injection?
Grapefruit tests the injection together with the web app, the APIs and the agents around it, in one test with one report. Real attacks chain: an injected instruction triggers a tool call, the tool call hits an API, and the API skips an authorization check. You see the whole chain as one finding.
- Every input the model reads: chat, uploads, retrieved documents, fetched pages, tool results
- Every tool the model can call and the parameters it controls
- The REST and GraphQL endpoints behind those tools, tested with the accounts you supply
- How your front end renders model output
- What the system prompt reveals when it leaks
How often should you test for prompt injection?
Test every time the prompt, the model, the tools or the data sources change, which in a shipping AI product is often. A wording tweak can reopen an injection you closed last month. Grapefruit maintenance plans re-test your verified domains weekly or monthly and show what is new and what got fixed since the last run.
Each run is dated and kept in the portal. Fix something and it is re-tested on the next scheduled run. Cobalt's 2025 State of Pentesting data, as reported by CSO Online, found that 48% of pentest findings get fixed, and only 21% of findings in generative AI apps. A finding your engineer can replay, plus a re-test that confirms the fix, makes that number easier to beat.
How do you get started?
Add your hostname, publish one DNS TXT record and sign the testing authorization online. That takes a few minutes. Maintenance plans have public prices and card checkout, so there is no demo call and no scheduling, and results land within hours of kickoff. For a one-time deep engagement, a full penetration test comes at a fixed quote.
See pricing to pick a plan, or open the sample report to see a finding with its request and response.
Questions
- Can prompt injection be fully prevented?
- No current defense removes it completely, because models read instructions and data in the same stream. What you control is the impact: which tools the model holds, whose permissions they run with and how output is handled. Testing shows you exactly what an injection reaches today, with a replayable request, so you can cut that reach down and confirm it stayed down.
- What is the difference between prompt injection and jailbreaking?
- Jailbreaking gets a model to break its own safety rules, usually to produce content it would refuse. Prompt injection gets your application's model to follow an attacker's instructions instead of yours. Jailbreaks embarrass you. Injections reach your data and tools. Grapefruit focuses on injections with real impact in your product and reports what each one let the attacker do.
- Do you test indirect prompt injection through RAG and documents?
- Yes. Indirect injection is tested through the channels your feature actually reads: retrieved knowledge base content, uploaded files, fetched web pages, inbound messages and tool results. Each successful attack is reported with the request that planted or triggered the instruction and the response showing the effect, so your team can replay it.
- We already have a guardrail or prompt filter. Do we still need testing?
- A filter lowers how many injections get through. Testing tells you what the ones that get through can do. Grapefruit attacks your product with the filter in place, exactly as a real attacker would meet it, so the results show both whether the guardrail holds and how far an injection travels when it does not.
- Which standards does prompt injection testing map to?
- Prompt injection is LLM01 in the OWASP Top 10 for LLM Applications 2025, and its consequences fall under LLM05 Improper Output Handling, LLM06 Excessive Agency and LLM07 System Prompt Leakage. For agents, the closest entry in the OWASP Top 10 for Agentic Applications for 2026 is ASI01 Agent Goal Hijack. MITRE ATLAS also catalogues prompt injection techniques.
- How quickly will I see findings?
- Results land within hours of kickoff. Setup is one hostname, one DNS TXT record and an online signature, which takes a few minutes. Findings appear in the portal ranked critical, high, medium or low, each with captured request and response evidence, and you can download the full report.