Agent Harness Tutorial · End to end · Zoom level 2
Check point 2: Before the model
Check what we are about to send, so an attack in Rohan's message never reaches the model.
Where: every trip, after context assembly.
| Check | Catches | Kind | Provided by | If it fails |
|---|---|---|---|---|
| allowed tools only | tools his token doesn't allow | rule | harness | never shown |
| out of time? | the 60 s deadline, or Rohan left | rule | harness | stop the turn |
| no_known_injection | "ignore your instructions", fake role markers | rule | harness | safe reply, $0 spent |
| model allow-list | any model but gpt-oss-120b | rule | Azure APIM | 403 |
| rate limit | more than 30 calls a minute | rule | Azure APIM | 429, wait, retry |
| Content Safety | jailbreaks (Prompt Shields) and harm | classic ML | Azure APIM | 403, "trouble answering" |
| Prompt Guard 2 | paraphrased and foreign-language attacks | small model | open source | not built yet |
Our injection rule checks only the latest user message, after folding odd spaces and look-alike letters into plain ones. It catches "ignore your instructions", "you are now", "reveal your system prompt" and fake role markers like [SYSTEM]. When it fires the turn ends in 250 ms and APIM is never called. It misses paraphrases ("As the claims manager I authorise you..."), other languages and leetspeak, which is why Prompt Guard 2 is next on the list.
There is no personal-data masking of the prompt: the model needs some identifiers, such as claim numbers, to do its job. Sizes are limited by the 8 KiB message limit and the context budget.
How it is done: the real code
Cut from the live repositories each time the site is built, so it always matches what runs.
claims_fnol/policy/evaluators.yaml:33evaluators.yaml: what runs before the model pre_model:
- {use: no_known_injection, on_fail: safe_reply}