Understand first
New to this knowledge point
Complete the prerequisite concepts, read the principles and counterexamples, and then explain why in your own words.
Start with core principles →Understand → Implement → Debug → Design
Bind one reviewed intent and test the current authority and operation ledger at execution.
Knowledge content check2026-10-11 · Check the source of the original question2026-10-11
It is recommended to understand first:
Tool contracts: from a valid request to an authorized business effect →Idempotency, unknown outcomes, and task recovery →Select the starting point based on the current basis, or you can go deeper one by one. When you encounter an unfamiliar concept, go back to the core principles first; use the knowledge exercises to check your understanding when you are finished.
New to this knowledge point
Complete the prerequisite concepts, read the principles and counterexamples, and then explain why in your own words.
Start with core principles →Prepare to write the principles into code
Understand implementation steps and boundaries, complete small tasks, and check results against acceptance requirements.
View the code example →Need to handle failures and changes in conditions
Follow the continuous questioning to locate the failure premise, and then compare the migration cases to explain how the plan should be adjusted.
Continue to delve deeper into the problem →Need to design or review plans
Combine engineering deductions and senior self-evaluation standards to explain the applicable conditions, costs and alternatives of the plan.
Analyze engineering scenarios →LEARN · PRACTICE · REFLECT
First read along the principles, Q&A and migration cases. When you need to check your understanding, switch to reinforcement exercises or start personal recording.
Can be practiced directly. After logging in, answers, favorites, and notes will be saved to your account.
Log in and saveEach modified commit will be kept as an independent history. Your level of mastery is up to you to evaluate yourself against the standards.
Core concept · An approval binds an intent, not a permanent permission
Preparatory concepts:Trusted identity and object authorization, Normalized action envelope and digest, Durable operation identity and result reconciliation
Unchanged reviewed semantics, current authority and deduplicated execution are separate predicates required by a safe write boundary.
A matching digest prevents proposal changes, current checks enforce authority, and operation identity deduplicates dispatch. Select the figure to open it at full size.
Hash binding prevents a changed proposal from borrowing approval, but it does not establish permission at dispatch. Revocation can happen during a human wait, and duplicate deliveries can happen after a successful write. Checking only one of these dimensions leaves another failure window.
The local course exposes each reason and ledger value. A cross-service design must add the authority's own validation/deduplication and an explicit contract for revocation propagation and unknown outcomes. Framework pause/resume alone cannot provide those guarantees. See the approval course.
Propose typed arguments under authenticated context.
Freeze normalized semantics and a durable operation ID.
Approve the exact digest with current review authority.
Check digest, permission/epoch, expiry and resource preconditions.
Commit one effect and receipt, or reconcile an existing receipt.
Digest identity, authorization and deduplication are separate predicates. The lab shares one SQLite authority; the design layer changes this constraint.
Freeze a normalized envelope with trusted identity, operation ID, tool semantics, target, amount/currency and resource preconditions. A trusted reviewer approves that digest before expiry. Execution still checks current requester/reviewer authority, permission epoch and resource version. Changed semantics need fresh review; identical duplicate dispatch reconciles the same receipt.
The authored reviewer approves refund-1 for 300 USD minor units. A later amount800 is rejected as proposal_changed with zero effects. Revoking the requester after review yields permission_revoked with zero effects. Duplicate delivery of the unchanged intent yields committed then replayed and leaves remaining700/effect_count1.
The envelope is stored under trusted tenant/actor and fixed refund-approved/v2 semantics. It includes all normalized arguments and a permission epoch; the approval record includes the separately authorized reviewer and expiry. Sorted-key SHA-256 compares this limited integer/string profile. It is not a credential and does not authenticate the human or allow the model to declare approved=true.
The local execute transaction checks current authority, epoch, submitted digest, active review, expiry and resource version before committing one effect and receipt. Permission regrant changes epoch, so an old review cannot silently resume. Once done, an authorized unchanged request may read the receipt after approval expiry because that read dispatches no new effect.
Moving policy and refund to independent services changes the race. A preflight permission read cannot atomically protect remote commit. Define resource-side capability/epoch enforcement or a bounded validity contract and preserve unknown outcomes for reconciliation. Revocation after a committed action stops later actions; any compensation requires its own authorized intent.
Requester and reviewer authority have independent generations. Revoking reviewer-a and re-enabling approve must leave the old review invalid (approver_permission_epoch_changed) with zero effects. The SQL below simulates only the trusted teaching permission service; model text cannot regrant authority. A new valid proposal/review is required for a new dispatch.
Python 3.9+, standard library. Extract /lab/deep-dive/agent-core-deep-dive-v1.zip and run this snippet beside approval_deep_dive.py; /lab/deep-dive/approval_deep_dive.py is also available. Authored fixtures only; not a live model or external service.
from approval_deep_dive import approved_service, ARGS
s = approved_service()
assert s.execute('tenant-a','user-a','refund-1',dict(ARGS,amount_minor=800))['reason'] == 'proposal_changed'
assert s.state()['effect_count'] == 0
assert s.execute('tenant-a','user-a','refund-1',ARGS)['status'] == 'committed'
assert s.execute('tenant-a','user-a','refund-1',ARGS)['status'] == 'replayed'
r=approved_service()
r.revoke('tenant-a','reviewer-a',role='approve')
r.db.execute("UPDATE permissions SET enabled=1 WHERE tenant='tenant-a' AND actor='reviewer-a' AND role='approve'")
assert r.execute('tenant-a','user-a','refund-1',ARGS)['reason']=='approver_permission_epoch_changed'
assert r.state()['effect_count']==0
r.close()
print(s.state()['effect_count'],s.state()['remaining_minor'])
s.close()
expected output
1 700Continue reading along with the premises and constraints of the problem. Understand the reference answers first, then try to put away the answers and explain the cause and effect and trade-offs in your own words.
Level 1Permission is revoked after review and then regranted. Can the old proposal execute?
Adds a new authorization generation after an apparently restored permission.
The lab rejects the old permission epoch even after enabled becomes true again. Prepare a fresh authorized intent/review or follow a deliberate renewal policy. A historical review cannot silently bridge a revoke/regrant boundary.
Level 1How do key order, floats and defaults affect a proposal digest?
Introduces representation differences and hidden semantics.
Specify business normalization before canonical encoding. In this lab sorted object keys preserve identity and only integers/strings are accepted. Expand significant defaults such as currency and destination. For cross-language signing choose a documented canonical profile; a hash of arbitrary JSON formatting is not portable semantic identity.
Follow this answer further
Level 2The tool upgrade changes a default recipient omitted by the old request. Is the same digest enough?
Changes the tool version while approval is waiting.
No if execution resolves a different recipient. Preserve the originally reviewed normalized recipient and pinned tool semantics, or renew review. Hashing the same unresolved syntax cannot prove the same business target.
Follow this answer further
Level 3The canonical payload is identical, but DNS or a redirect routes to another service. What now?
Changes execution routing independently of payload bytes.
The action target boundary was not fully bound. Resolve/authorize the business destination, constrain redirects and require the executing resource to validate its audience/target. An abstract hostname hash alone cannot authorize an arbitrary destination. Block changed routing or obtain renewed review under the trusted target policy.
Level 1A remote provider has no idempotency key. What is safe after its response times out?
Removes the remote provider capability used for safe retry.
Persist unknown with the original intent. If it has a reliable operation-correlated status query, reconcile under documented visibility delay; absence before visibility is not proof of non-execution. Without adequate query evidence, avoid an automatic fresh dispatch and escalate. Approval does not supply missing provider deduplication.
First find out the conditions for change, and then determine which premises in the original plan still hold true. The following cases are teaching deductions to facilitate the transfer of principles to new problems.
Changing conditions:The approved artifact becomes an email or public send that cannot be transactionally undone.
Extended question:How should duplicate delivery and cancellation be treated?
Bind exact recipients/content, use the send provider's operation identity/receipt, reconcile unknown outcomes and preserve already sent history. Cancellation before dispatch blocks a new send; after send it cannot make the event disappear. A correction or recall is a separate action with its own limits and approval.
The principles that remain unchanged:Approval identity and current authority must hold for one business operation; historical effects remain facts.
Changing conditions:Permissions, resource state and tool semantics can change without one transaction.
Extended question:What mechanism and tradeoff can replace the local execution check?
Use resource-side validation of scoped/versioned authorization and operation identity, plus an explicit immediate or bounded revocation contract. Current reads improve freshness but do not remove the post-read interval. Immediate enforcement couples authority/availability; bounded capabilities accept a stated validity window.
The principles that remain unchanged:Enforcement belongs at the resource effect boundary and cannot be inferred from an orchestrator check.
Official mechanisms were checked on 2026-10-11. Examples and schedules are authored; local Python/SQLite outputs are actually executed. No enterprise incident, live model accuracy or production reliability is asserted. New Q&A and migration cases are added for principle explanation, and source verification and case operation verification are recorded separately.
After reading, you can explain the principles, boundaries, and trade-offs against these standards. It is up to you to evaluate your mastery; if further verification is needed, complete the small tasks below.
View verification records for independent examples
Run approval_deep_dive.py and ApprovalTests. Save evidence for changed_amount, revoked_after_approval, resource_changed and duplicate_dispatch. Draft a remote enforcement contract for one changed default target.