cleandataengineering.aiAgent Harness, drawn simply
You are here: End to end › Checks › 1 · Before the loop › consent

Agent Harness Tutorial · End to end · Zoom level 3

How we take care of it: consent

consent catches lists the writes Rohan's own words asked for.

Open: 11before loopopen ›Open: 22before modelopen ›Open: 33after modelopen ›Open: 44before toolopen ›Open: 55the toolopen ›Open: 66after toolopen ›Open: 77after loopopen ›Open: 88before replyopen ›It readsonly Rohan's own messages in thisconversationconsentrule · agentpassCarries onfailIf it fails—WHERE IN THE CODE: consent.granting() · F entrypoint/consent.py:40-66
The strip at the top shows every check point where this check runs, in dark.

How we took care of it.

  1. List the writes his words ask for, such as request_payout:CLM-010004, or register_claim:*.
  2. A plain "yes" grants the one action the agent is waiting on, for this turn only.
  3. Tool results can never add to the list, so a planted note can't grant itself anything.
  4. Nothing is blocked here; check point 4 uses the list.
It readsonly Rohan's own messages in this conversation
Kindrule
Provided byagent
If it fails—
Where in the codeconsent.granting() · F entrypoint/consent.py:40-66
Runs at1 · Before the loop
Real exampleFlow 11: the agent asked "withdraw CLM-010005?"; Rohan said "yes", and that granted it.

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 granting(
    identity: Identity, conversation: Conversation, text: str, rules: router.Rules
) -> Identity:
    """The turn's identity, carrying what the policyholder has consented to."""
    return identity.model_copy(update={"consented": consented(conversation, text, rules)})