In the 2025 top-ten list for LLM applications, prompt injection is risk number 1. A guardrail that filters only the prompt leaves retrieved text and the answer unchecked. Five checks, each sized for an afternoon, cover both sides of the model, its speed and its failures.
A rails policy to adapt and paste
input_rails: [pii, off_topic, jailbreak] # on the prompt retrieval_rails: [pii, mark_untrusted] # each chunk, tool result output_rails: [groundedness, schema, pii, encode] run_input_rails: parallel # rail first where a call spends or acts on_rail_error: block # high-risk paths fail closed safe_reply: SAFE_REPLY hold_stream_until_checked: true red_team: schedule: weekly # and after any change max_bypass_rate: <your limit> max_false_block_rate: <your limit>
The checks
Everything starts ticked. Untick what you will not do; the choice is saved on this device only, and Print keeps only what you kept.
What happened. A 2023 paper demonstrated, on real-world systems, that adversaries can inject prompts into data likely to be retrieved. One open-source toolkit's README says input rails can block a request before it reaches the model, and its PII check can detect or mask sensitive data in inputs, outputs and retrieved content.
The check.
- Name the prompt checks (PII, off-topic, jailbreak phrasing); each rejects or masks, and logs a hit.
- Run the same checks on each retrieved chunk and tool result, and mark that text untrusted.
Source: Indirect prompt injection against LLM-integrated applications, paper, 23 Feb 2023; Open-source rails toolkit, README, read 27 Nov 2026
What happened. The top-ten list advises scoring responses with the RAG Triad (context relevance, groundedness, question and answer relevance) and validating output formats in code. Its improper-output-handling entry advises treating the model like any other user and encoding its output.
The check.
- Reject an answer that fails groundedness against the retrieved text or format against a schema.
- Scan for PII and secrets; encode or parameterize the rest for HTML, Markdown or SQL.
Source: LLM01:2025 Prompt Injection, first entry of the Top 10 for LLM Applications 2025, read 27 Nov 2026; LLM05:2025 Improper Output Handling, read 27 Nov 2026
What happened. One rails FAQ says prompt checking can run in parallel with generation, the draft discarded if a rail blocks, and gives no deployment-independent latency figure. An agent SDK warns that in parallel mode tokens and tools may already be spent when the tripwire fires.
The check.
- Start the check and the model call together; on a block, cancel the call and drop the draft.
- Run the rail first where a started call spends money or acts on records. Time p95 on and off.
async def answer(prompt):
check = asyncio.create_task(input_rail(prompt))
draft = asyncio.create_task(call_model(prompt))
if not await check:
draft.cancel() # blocked: drop the draft
return SAFE_REPLY
return await draftSource: AI Runtime Security FAQ, rails toolkit developer guide, read 27 Nov 2026; Guardrails, agent SDK documentation, read 27 Nov 2026
What happened. The same FAQ says no library-wide failure policy applies to every rail, and a safe response should be returned when a control cannot decide. A weakness entry traces failing open to wanting to fail functional. Streamed text can reach the client before a late block.
The check.
- For each high-risk path, define a rail error or timeout as a block with a fixed safe reply.
- Hold streamed output until the output rail has read each chunk; force a rail timeout in staging.
Source: AI Runtime Security FAQ, rails toolkit developer guide, read 27 Nov 2026; CWE-636, Not Failing Securely ('Failing Open'), read 27 Nov 2026
What happened. The top-ten list advises regular penetration testing and breach simulations that treat the model as an untrusted user. A paper drawing on over 100 generative AI products says the work of securing AI systems will never be complete.
The check.
- Keep a versioned set of attack prompts, poisoned documents and legitimate prompts; run it weekly and after any change.
- Log bypass rate and false-block rate per run; fix until both meet limits your team has written down.
Source: LLM01:2025 Prompt Injection, mitigation: adversarial testing, read 27 Nov 2026; Lessons from red teaming 100 generative AI products, paper, 13 Jan 2025
"An afternoon" and the weekly cadence are planning estimates. The 2023 paper shows what can happen, not what every application does. No source gives a latency figure; time your own. Behaviours are as documented on 27 November 2026.
Take this list with youThe PDF is the handout: this list on one or two pages. The Markdown is for your own docs, your wiki, or an assistant you want to hand the list to. Print gives you this list only, without the navigation.
Something in your production AI broke in a way that is not on this list? Tell me what broke.