FilterPrompt — AI Firewall logo

Prompt Injection Testing: How to Test Your LLM for OWASP LLM01

Guide · 2026-07-10 · 8 min read · FilterPrompt Security Team

A hands-on guide to prompt injection testing — how to test for prompt injection with open source and managed tools, what to look for, and how to score results.

What prompt injection testing actually is

Prompt injection testing is the LLM equivalent of a pentest. You send a curated library of adversarial prompts to your model and check whether it follows the attacker's instructions or holds to yours. The output is a report: which attacks worked, which failed, and what evidence you have.

It is different from unit testing your prompts for quality. Quality tests ask 'did the model answer well?'. Prompt injection testing asks 'did the model refuse to break its rules under adversarial pressure?'.

How to test for prompt injection: the 5-step workflow

  1. Define your policy — what must the model never do? (leak system prompt, call a dangerous tool, disclose PII, insult users)
  2. Pick a probe library — Garak, PyRIT, Promptfoo, or a managed scanner like FilterPrompt.
  3. Point the tool at your target — the actual production endpoint, not the raw model.
  4. Run and judge — for each probe, capture the response and let a judge model decide success/failure against your policy.
  5. Report and remediate — export a report, add firewall rules or system prompt hardening, re-run.

The 8 prompt injection techniques you must test

Choosing a prompt injection testing tool

Open source scanners (Garak, PyRIT, Promptfoo) give you full control but require engineering to run at scale and produce compliance-ready reports. Managed scanners (FilterPrompt, Lakera Red, NeuralTrust) trade some flexibility for a one-click experience: connect your endpoint, pick a probe set, get a report with evidence.

Scoring: what pass/fail really means

Do not accept a single 'pass rate' number. A credible prompt injection testing report breaks results down by technique, severity, and remediation status. It also shows the exact prompt sent, the response returned, and the judge's reasoning — without that evidence you cannot fix anything or defend the report to an auditor.

How often to test

  • Before every production release of a new prompt, model, or retrieval index.
  • Weekly as a regression scan — catches provider model updates that quietly change behaviour.
  • After any security incident involving the LLM path.
  • Quarterly with a broader red-team scope for compliance evidence.

Related