Main attack set
– → –
attack success rate, no guardrails → all guardrails
Hold-out set (never tuned on)
– → –
attack success rate on unseen attacks
Normal questions blocked
–
across all guardrail configurations
Leaks with all guardrails
0
no secret leaked, no other customer's order fetched, no phishing link
What each guardrail does on its own
Attack success rate per configuration. Lower is better. The hold-out bar is the honest one: those attacks were written separately and never used for tuning.
Results by attack category
| Category | OWASP LLM Top 10 (2025) | MITRE ATLAS | Main: none → all | Hold-out: none → all |
|---|
Key findings
- Pattern-based defences overfit. Input screening (G5) cut main-set successes from 21 to 14 — and had zero effect on the hold-out set. Document quarantine (G4) stopped all known poisoned documents and none of the new ones.
- Root-cause fixes generalise. An ownership check in code (G2) and keeping internal documents out of search (G1) held on both sets. A hardened prompt alone still allowed unauthorised order lookups: asking a model to enforce access control is not access control.
- Format-based output checks generalise too. The output check (G6) stopped every planted-secret leak on both sets without knowing the secret values.
- Fixes have side effects. Removing the secret from the system prompt (G3) increased tool misuse and jailbreak successes. Every change needs a full regression run.
- Injection is not solved — its impact can be. With all guardrails, the only attacks that still work make the bot append an attacker's word to a correct, safe answer.
The guardrails
G1 · Document access control
Customers can only search public documents.
G2 · Tool authorisation
Orders are returned only to their owner, enforced in code.
G3 · No secrets in the prompt
Nothing confidential is given to the model.
G4 · Untrusted documents
Documents are marked as data; sections that instruct the AI are quarantined.
G5 · Input screening
Known injection patterns are refused.
G6 · Output check
Secret-shaped strings, copied private text and foreign links are blocked.
G7 · Hardened prompt
Clear scope and instruction priority.
Keeping the numbers honest
- Code-only scoring: planted canaries (also spaced, reversed or encoded), a sensitive fact, unauthorised tool calls, and attacker-requested markers that never appear in the attack text.
- Hold-out set: 20 attacks never used to tune the guardrails.
- Repeatable: temperature 0 and a fixed seed; two baseline runs gave identical outcomes for every attack.
- Every reply was read: the review found and fixed four measurement errors before results were accepted, including a "thinking" model returning empty replies that would have counted as blocked.