Skip to main content

Definition

The prompt injection test (built with Llama) checks for prompt injection, malicious strings and jailbreak attempts in the input data of your system.

Taxonomy

  • Task types: LLM.
  • Availability: and .

Why it matters

  • Prompt injection is a type of attack that exploits an AI system and deviates it from its intended behavior.
  • It is important to detect and prevent prompt injection attacks to ensure the reliability and security of your system.

Judge explanations

You can add LLM judge explanations to rows that the test flags:
  1. In the create or edit test flow, open Advanced settings.
  2. Under LLM as a judge, turn on Enable LLM as a judge explanations.
  3. Use Judge model to keep the project’s default LLM-as-a-judge configuration or select a different model for this test.
The Judge explanation results column shows why the row was flagged, where the detection appears, and the relevant excerpt. The judge can identify a likely false positive, but its explanation is advisory and does not change the test count or verdict. Prompt-injection results also support the Summarize drill-down when the run has per-row explanations.

Test configuration examples

If you are writing a tests.json, here are valid configurations for the prompt injection test. Set explain_with_llm to true to request explanations. You can also provide llm_evaluator to override the project’s LLM-as-a-judge settings for this explanation pass.