Earthshaker Security Book a scan

← All field notes

Field note 15 September 2026 · 15 min read

Prompt-injection testing for AI apps

A test plan for web apps that call an LLM: threat model, what to instrument, OWASP-mapped test cases, and evidence engineering can act on.

Create a “Prompt-injection test plan for web apps that use AI” article that engineering teams can run in 2026 by starting from the part attackers care about, control of the prompt and the outcomes it drives. Did you know that OWASP LLM01 defines prompt injection as manipulating LLMs via crafted inputs can lead to unauthorized access, data breaches, and compromised decision-making?

Key takeaways

What you build

Why it matters

Where it shows up in the plan

A threat model you can update

AI behaviour and authority can shift between deployments without visible architecture change

Update triggers, asset inventory, assumptions log

Instrumentation that produces evidence

Chat text alone is not enough to prove impact

Prompt context traces, tool calls, policy gates, output sinks

Test cases mapped to OWASP-style categories

Coverage needs to include disclosure and downstream effects

Direct and indirect prompt injection, output handling, sensitive disclosure

Exploit evidence with reproducible steps

Engineering needs a trace they can replay and fix

Seed payloads, request parameters, model settings, observed effects

Fix guidance that closes the loop

Remediation must be verified, not just proposed

Concrete code or config changes, retest criteria

Non-destructive boundaries

You need proof without harming production or data

Proof-only exploitation and controlled blast radius

For the structure of our own engagements and evidence-driven reporting, see methodology phases, recon to report to re-test.

Did You Know?

LLM01 prompt injection is defined as manipulating LLMs via crafted inputs that can lead to unauthorized access, data breaches, and compromised decision-making.

Source: OWASP Top 10 for Large Language Model Applications

Threat model first: define the assets, the attacker paths, and evidence outcomes

To create a “Prompt-injection test plan for web apps that use AI” article, you need a threat model that is explicit about the prompt surface, the authority of the model or agent, and where outputs land in your system. Prompt injection web apps usually fail because the plan treats “the LLM response” as the product, instead of treating “the downstream effect” as the risk.

We use an engineering-friendly threat model template based on OWASP guidance for AI components, including the idea that a threat model can become stale as behaviour, authority, or effects shift between deployments.

1) Assets to list in scope

2) Trust boundaries that matter for prompt injection web apps

3) Attacker goals to map to measurable outcomes

For each goal, define a passable evidence outcome. For example, do not say “stop unauthorised access”, instead say “the plan must produce a trace showing access attempt, authorisation decision, and final data returned or action executed”.

4) Refresh points for the threat model in 2026

In 2026, model providers and agent frameworks update frequently. Your threat model must have a refresh trigger whenever you change any of the following:

OWASP resources for AI threat modelling are a useful reference point for keeping assumptions current: OWASP Threat Modeling Resources, AI and agentic threat modelling.

What to instrument: log the prompt path, tool path, and output sink path

To create a “Prompt-injection test plan for web apps that use AI” article that works in practice, instrumentation must capture the full causal chain. Testers need to prove where the injection entered, how it influenced the prompt, and what effect happened after output handling.

1) Instrument the prompt assembly pipeline

2) Instrument retrieval and ingestion for indirect prompt injections

3) Instrument tool calling and agent action execution

4) Instrument output handling and sinks

We also include “evidence collection” hooks in the instrumentation spec. That means capturing enough metadata to recreate an exploit attempt without using production secrets or unsafe side effects. Our methodology emphasis on prove only exploitation aligns with this approach, see recon, enumerate, prove, report, re-test.

Test cases you can run: map injection scenarios to OWASP-style categories

To create a “Prompt-injection test plan for web apps that use AI” article, you must list test cases with a clear mapping to OWASP-style categories, while keeping them executable by engineering teams. In 2026, you should expect both direct prompt injection (user message tries to override instructions) and remote or indirect prompt injection (attacker-controlled content enters via retrieval, embeds, or documents).

Use OWASP’s LLM prompt injection prevention guidance as a starting taxonomy. Reference: OWASP LLM Prompt Injection Prevention Cheat Sheet.

1) Category mapping and concrete test case patterns

Direct prompt injection (user-controlled)

Remote or indirect prompt injection (retrieval and content)

Improper output handling

Sensitive information disclosure

Excessive agency

Insecure plugin design style issues (if you support plugins or tool runners)

2) A practical test case template engineering can execute

To create a “Prompt-injection test plan for web apps that use AI” article, include a repeatable template in your plan so teams can build suites quickly.

  1. Name: short label that includes injection type (direct, indirect, tool-fed).
  2. Threat category: OWASP-style category label.
  3. Preconditions: auth state, tenant, enabled tools, retrieval settings.
  4. Seed payload: the crafted prompt or injected content.
  5. Expected safe behaviour: no disclosure, tool calls denied, outputs validated.
  6. Evidence to capture: prompt trace, tool call log, output sink output, authorisation decision trace.
  7. Fix guidance area: where engineering should look (prompt assembly, policy gate, output parser, renderer, tool runner).

3) Reducing false positives in 2026

In 2026, teams get noise because many prompt injection patterns appear in benign educational text. Some guidance from Google’s prompt injection research notes that false positives are common where suspicious phrasing appears in education material. That means your plan should include triage logic that distinguishes “instruction-like strings” from “malicious intent that changes authorisation or effects”.

Massive web crawls amplify injection risk — data from Google Security Blog

Indirect prompt injections hide inside large datasets fed directly to models.

How to produce exploit evidence that engineers can act on

To create a “Prompt-injection test plan for web apps that use AI” article, the evidence section must be built for replay. Engineering teams need the minimum set of artefacts that recreate the exploit attempt and show which enforcement gate failed.

1) Evidence artefacts to attach to each finding

2) Evidence structure: from impact statement to proof

We use a reporting pattern like recon to enumerate to prove to report to remediate and re-test. The point is to make each finding traceable to a closure path. A sample report format can be seen at report sample structure, impact, evidence, and the fix.

Impact describes the risk in operational terms, not just “the model said something wrong”.

Evidence shows the prompt path, tool path, and output sink path that caused the effect.

The fix lists concrete changes, plus a retest criteria.

3) Safe proof guidance for prompt injection test plans

4) Instrumented replay: how to make the finding reproducible

Engineering teams need a replay script or a deterministic test harness. If the model is nondeterministic, record the prompt trace and model settings, then run multiple trials and store the distribution of outcomes. The evidence should still link to the enforcement points that were supposed to stop the action.

Did You Know?

LLM05 improper output handling can enable downstream security exploits, including code execution that compromises systems and exposes data.

Source: OWASP Top 10 for Large Language Model Applications

Fix guidance: how to close the gaps for prompt injection web apps

To create a “Prompt-injection test plan for web apps that use AI” article, fix guidance must specify which layer failed and what code or configuration change to apply. Prompt injection mitigations are not only about filtering phrases. They are about enforcing trust boundaries, validating outputs, and applying authorisation at the time of effect.

1) Fixes for direct prompt injection

2) Fixes for indirect prompt injection

3) Fixes for improper output handling

4) Fixes for sensitive information disclosure

5) Fixes for excessive agency

6) How to write the fix section so teams can close it

Engineering teams close issues when fixes are specific. Each fix item should include a measurable retest expectation.

When we structure report closure, we focus on the same loop you want in your prompt injection test plan: remediations followed by retest. That is how our phases are laid out, see Remediation and re-test.

Build the full suite: from recon to retest to regression

To create a “Prompt-injection test plan for web apps that use AI” article, you need a full lifecycle. Teams should start with application mapping, then run prompt injection scenarios, then verify fixes with evidence, then add regression tests.

1) Suite phases you can implement

2) Regression tests that keep working in 2026

Prompt injection web apps evolve. Your regression suite should include at least:

When you add new tools or change retrieval sources, add new test cases. This avoids stale coverage, which is the same risk noted in OWASP AI and agentic threat modelling resources.

3) Where Earthshaker Security style reporting aligns with this plan

Our reporting format emphasises evidence and prescribed fixes, and our approach is non-destructive proof with a closure loop. If you want to align your internal deliverable format with this style, review our sample at report sample, evidence and the fix. This helps engineers map prompt injection test plan findings into development work items.

Frequently asked questions

What is a prompt-injection test plan for web apps that use AI, and what does it include?

A prompt-injection test plan for web apps that use AI includes a threat model, instrumentation requirements, a suite of direct and indirect injection test cases, and evidence capture rules. It also includes how you produce exploit evidence plus fix guidance that engineering teams can act on, so outcomes are verifiable in logs and output sinks.

How do I map prompt injection test cases to OWASP-style categories in 2026?

Map each test case to a category such as prompt injection, improper output handling, sensitive information disclosure, and excessive agency. Then attach evidence that shows the prompt path, tool path, and output sink path that led to the effect, not only the model response text, as described in the OWASP Top 10 for Large Language Model Applications.

What should we instrument to prove a prompt injection finding is real?

You should instrument prompt assembly with provenance, retrieval and ingestion steps for indirect content, tool calls and server-side authorisation decisions, and the output sink that receives the model output. For a prompt injection web app, this instrumentation lets you produce exploit evidence that engineering teams can replay and fix.

How do we reduce false positives when testing prompt injection web apps?

Do not treat signature-like phrasing as a vulnerability by itself. Instead, triage based on whether the injection actually changed outcomes, such as an authorisation decision, a data disclosure event, or a downstream action or parser behaviour.

Should we test only direct prompt injection, or also remote and indirect injection?

You should test direct and indirect injection. In real prompt injection web apps, attacker-controlled text often enters through retrieval, documents, or tool outputs, so indirect prompt injection test cases are essential for coverage in 2026.

What fix guidance is most actionable for engineering teams after prompt injection testing?

Actionable fix guidance specifies the layer to change and what evidence should change after remediation, including prompt assembly trust boundaries, output schema validation, renderer sanitisation, and server-side authorisation for tool actions. This is how you create a prompt-injection test plan for web apps that use AI that closes the loop with retestable criteria.

Conclusion

Create a “Prompt-injection test plan for web apps that use AI” article by starting with a threat model that defines measurable outcomes, then instrument the prompt path, tool path, and output sink path so you can produce replayable exploit evidence. Map test cases to OWASP-style categories such as LLM01 prompt injection, LLM05 improper output handling, and LLM06 sensitive information disclosure, then write fix guidance that engineering teams can implement and verify with a retest loop.

Contact us

Next
Want this run against your app?
Book a scan