Agent Harness Tutorial · End to end · Zoom level 2
Check point 4: Before the tool
The model has asked for a tool. Is this something Rohan actually asked for, and is it safe right now?
Where: for every tool call the model asks for.
| Check | Catches | Kind | Provided by | If it fails |
|---|---|---|---|---|
| policyholder_asked | a write Rohan never asked for | rule | agent | call refused, model told why |
| hold writes | any write after a result that carried instructions | rule | harness | call refused |
| tool-call budget | more than 8 a trip, 24 a turn | rule | harness | stop the turn |
| freshness | an irreversible write against a stale row | rule | harness | re-read the row first |
| approval gate | a payout over ₹25,000 | workflow | harness + DBOS | wait for a person |
This is where a fooled model is stopped. In a real attack test, a note planted in a claim told the model to call request_payout, and it did ask. policyholder_asked refused, because Rohan never asked for a payout, and the model was told: "the policyholder has not asked for request payout on CLM-019900. Ask them whether they want it, and do not say it has been done". The approval gate is drawn on the approval flow.
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/__init__.py:228The rule that stops a fooled modeldef policyholder_asked(ctx: Context) -> Verdict:
"""P-OWN-WORDS, AHC-0116: an action runs only on a record the policyholder's
own words asked for it on — read from what they said, never from a tool's
result, so an instruction planted in a claim note moves nothing."""
if ctx.position is not Position.PRE_TOOL or ctx.tool_name not in CONSENTED_TOOLS:
return ALLOW
record = ctx.arguments.get("id") or ctx.arguments.get("claim_id")
consented = ctx.identity.consented
if f"{ctx.tool_name}:{record}" in consented or f"{ctx.tool_name}:{ANY_POLICY}" in consented:
return ALLOW
action = ctx.tool_name.replace("_", " ")
return block(
"policyholder-asked",
f"the policyholder has not asked for {action} on {record}. Ask them whether they"
" want it, and do not say it has been done",
)Look inside
How we take care of it: policyholder_askedCatches a write Rohan never asked for.How we take care of it: hold writesCatches any write after a result that carried instructions.How we take care of it: tool-call budgetCatches more than 8 a trip, 24 a turn.How we take care of it: freshnessCatches an irreversible write against a stale row.How we take care of it: approval gateCatches a payout over ₹25,000.