Worked Example - Motor + Sensory (Agent Action Log)
Companion to Chapter 9. A real agent action log for a multi-step task - file edits, shell commands, network calls, and the confirmation-gate sequence that punctuates the side-effects. Side-effect class annotations show where the materiality-gating discipline kicks in.
The task
"Update the production-DB connection pool size from 10 to 20 in the deployment manifests, run the validation tests, and open a PR." Five distinct side-effect classes: file read, file write, shell command (test run), shell command (git operations), network call (open PR via API).
The action log (abridged)
The agent notes that the user said "production" specifically and stops before editing all three. It surfaces the question.
The pool-size value appears in three manifests (prod, stg, dev). The request said "production" - should I update only values.prod.yaml, or all three for consistency? Default: prod only.
User: "Prod only."
Edit shown above will modify the production deployment manifest. Apply? [Y/n]
User: "Y"
About to git push origin feat/prod-pool-size-bump. This will create a remote branch and make the change visible to CI. Proceed? [Y/n]
User: "Y"
About to call the GitHub API to open a PR from feat/prod-pool-size-bump to main with the title "prod: bump DB connection pool 10->20". This is a public action visible to reviewers and CI. Proceed? [Y/n]
User: "Y"
The side-effect class annotations
Six classes appeared in this trace, with three different gate behaviors:
- READ (file read, grep, git diff, git log) - no gate. Reversible by definition.
- WRITE (file, scoped) - gate enforced for paths under
deploy/; harness-policy decision. Other paths (underNOTES.mdortmp/) would have been gateless. - SHELL (sandboxed test runner) - no gate. Writes only to tmp; reversible.
- SHELL (git index / commit) - no gate. Local-only and easily reversible.
- NETWORK (git push) - gate enforced. First action with cross-machine effect.
- NETWORK (API write) - gate enforced. First action visible to other humans.
What the architecture's discipline buys here
The agent did not ask permission for every read or every harmless local action - that would have made the loop unusable. It asked permission at exactly the transitions that mattered: ambiguous scope (one file or three?), first write to a production-class artifact, first network call, first public-facing call. Materiality-gated; not paranoid, not reckless.
Two failure modes the discipline prevents:
- Silent scope creep - without the disambiguation gate at line 1, the agent would have plausibly updated all three manifests "for consistency." User intent would have been violated without anyone noticing until staging behaved differently than expected.
- Silent publishing - without the push and PR gates, the agent would have published the change before the user had a chance to look at the diff. Reversible, but expensive in reviewer attention.
What this trace does not show
This example assumes a well-behaved environment (no prompt injection, no model error, no network anomaly). The companion failure-diagnosis worked example covers what the diagnostic process looks like when one of those goes wrong.
Practitioner templates
The prompts library hosts confirmation-gate templates and action-log review prompts.