Build in layers
A language model’s refusal is a learned response, so prompt injection and jailbreaking cannot be addressed by a single permanent patch. In a review, I’d assume an unwanted instruction could eventually get through and check which remaining controls could prevent the mistake from becoming a bigger incidnet.
Defence in depth combines controls that make attacks harder, limit what a compromised application can do, and help teams notice problems sooner. I’d walk through the application from input to action and ask what still protects the system if the previous layer fails, because a useful second layer has its own job to perfom.
Make the intended task clear
System prompt hardening defines a narrow role, spells out when to refuse or redirect, and rules out personas that conflict with the task. In the attachment’s billing-assistant example, I’d keep the role focused on invoices and payments and review how the assistant handles requests to change roles or reveal its instrutions.
Structured message templates give the model a way to distinguish developer instructions from user input and retrieved material. In the billing sample, I’d put the billing rules in the system message, pass the user’s text in a separate labelled block, and keep credentials out of the prompt altogether because message format does not grant authorisaton.
Check what comes in and goes out
Blocklists cheaply catch known strings, while classifiers try to recognise suspicious meaning across different wording. In a guardrail review, I’d use the cheap checks first and reserve heavier checks for requests worth a closer look, then track how often legitimate work, such as code review, gets caught by mistkae.
Input guardrails screen text before generation, while output guardrails check the reply or proposed tool call before it moves downstream. In the source’s examples, I’d use the first to remove personal information from an incoming message and the second to catch a leaked credential or reject a tool call that fails its required strucutre.
Indirect prompt injection can arrive through a document, email, or retrieved passage after the original chat message has already been screened. The Slack AI case is a reminder to review both the external content path and the channel permissions, because a clean user message says little about the files an assistant later recieves.
Limit what the application can do
Least privilege gives the application only the data access and tools required for its job. When reviewing retrieval, I’d check that the assistant can see only documents the current user is entitled to read, since an assistant with broad access can turn one bad instruction into a disclousre.
Improper output handling occurs when another system treats the model’s response as executable or trusted input. In a review, I’d follow the reply into the browser, database, or tool and check for output encoding, parameterised queries, or strict validation where appropriate, because a plausible response still has to fit the receiving system’s rules before it can be actd on.
Watch what happens in production
Rate limiting constrains repeated requests and token consumption, while logging gives investigators a record and monitoring flags unusual behaviour. In an operations review, I’d look for repeated override attempts or unexpected output volumes and check whether the record gives responders enough context to reconstruct the failure and improve the relevant contorl.