Agent Harness Tutorial · End to end · Zoom level 3
How we take care of it: policyholder_asked
policyholder_asked catches a write Rohan never asked for.
How we took care of it.
- Reads always pass.
- A write runs only if consent holds tool:that-record or tool:*.
- If not, the call doesn't run. The model is told: ask Rohan, and don't say it has been done.
- The action is saved as "awaiting", so Rohan's "yes" next turn grants it.
| It reads | the tool the model wants, and the consent list from check point 1 |
| Kind | rule |
| Provided by | agent |
| If it fails | call refused; model told why |
| Where in the code | F policy/__init__.py:228-243 |
| Runs at | 4 · Before the tool |
Real exampleFlow 13: a planted note made the model ask for request_payout; refused. Flow 11: withdraw needed a "yes" first.
More on this: 13 · Injection hidden in a claim note.
How it is done: the real code
Cut from the live repositories each time the site is built, so it always matches what runs.
def 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",
)