Human approval should permit one exact AI agent action - not give permission to finish a task by any means. Approval for a £250 payment, for example, must bind the amount, recipient, paying account and tool version. Any change requires another review.
The control follows four steps: proposal → review → approval record → execution check.
- Freeze the action before review. Show the exact inputs and store approval outside the agent’s control.
- Check before execution. A separate gateway must verify the request, permissions, expiry and resource state, then block missing, changed or revoked approvals.
- Prevent repeat effects. Consume approval once, track the result and check uncertain outcomes before retrying.
- Test and monitor. Test tampering and replay, log decisions without secrets, and assign owners for failures.
Approval is not enough on its own. The execution service must enforce what was approved - and prevent the agent from bypassing that check.
::: @figure
{AI Agent Approval: From Exact Action to Safe Execution}
:::
Lesson 21: Human Approval Gates for AI Agents | Secure High-Value Actions with Signed Approvals
Build the Approval Record and Review Screen
Build the action object before review. Keep the approval record outside the agent’s control, either in append-only storage or as a signed record. A signature proves integrity, but it does not show whether approval has been revoked or used. Keep revocation and usage state in trusted storage. [1]
Record Who, What, Where and How Much
Bind the approver’s authenticated decision and authority to these fields:
| Field category | Specific fields | Enforcement purpose |
|---|---|---|
| Identity | Approver, requesting actor, execution identity | Check the approver’s authority over the account, environment and spending limit; preserve the audit trail |
| Action | Action ID, tool, version, operation | Prevent another tool or operation from being substituted |
| Target | System, environment, resource ID | Ensure the action affects the correct system or tenant |
| Inputs and limits | Normalised parameters, scope, spending cap | Prevent values from being substituted after approval |
| Validity | Expiry, single-use nonce and usage state | Prevent replay attacks and stale executions |
| Supporting evidence | Reference data or reasoning | Trace the basis for approval |
Normalise and Freeze the Inputs
Use a strict schema and a deterministic representation for identifiers, arguments, money and units. Reject unknown fields and ambiguous values, and resolve defaults before review. Represent £250 as 25000 pence with currency GBP, not as a floating-point amount. Freeze the object and bind approval to its exact contents. [1]
Show Exactly What Will Execute
Generate the review screen from the same immutable object that execution checks, not from the agent’s explanation. Show every execution-critical argument in full: amounts, recipient, execution identity, affected records, limits, expiry and irreversible effects.
Keep agent commentary separate. Label any dry run or diff as a preview only, because the live state can still change before execution. [1]
For a hypothetical £250 supplier payment, show the supplier’s name and identifier, the paying account and recipient account identifiers,
GBP, and £250.00 (25000pence). Include the payment tool and version, execution identity, the affected invoice and any spending limit. Display expiry in an unambiguous form such as 5 December 2026, 15:00 GMT. Do not letPay supplierstand in for these details.
At the execution gate, compare the live request against the frozen record and reject any mismatch.
Block Changes Before Execution
Before any side effect, the gateway must compare the live request with the frozen approval record.
execute(invocation):
requester = verify_requester_and_bound_session(invocation)
request = normalise(invocation)
approval = load_trusted_approval(request.action_id)
require approval exists
require approval.requester == requester
require approval.session == request.session
require approval.status == "unused"
require approval.expires_at > now()
require approval.revoked_at is null
require every_bound_field_matches(approval, request)
require current_policy_allows(requester, request)
require resource_preconditions_hold(request)
atomically_consume(approval.id)
dispatch(approval.immutable_payload, idempotency_key=request.action_id)
Every externally visible action must pass through this gateway, including messages, deletes, publishes, transfers and permission changes.
Run all checks in the execution service. Remove direct downstream credentials from the agent runtime. Restrict downstream access to the gateway’s identity using scoped credentials and network egress controls, so the agent cannot bypass the checks.
Start by verifying that the requester still matches the approved session and action.
Verify the Request Against the Approval
Authenticate the requester and bound session, then load the approval from trusted storage using the action ID. Normalise values before comparing them so the request and approval use the same canonical form.
Compare every bound field: requester identity, session and execution identity; action ID, tool, version and operation; tenant, target and destination; parameters, content and attachments; amount, currency and limits; resource version, policy version, expiry and permitted execution window.
Check the canonical payload hash as well as the readable fields. Equivalent intent is not a match.
| Detected condition | Required outcome |
|---|---|
| Missing approval | Deny before dispatch |
| Invalid approval | Deny and trigger a security alert |
| Revoked approval | Deny and record the revocation |
| Expired approval or execution window closed | Deny; require another review |
| Session mismatch | Deny; do not transfer approval |
| Consumed approval or reused action ID | Deny as replay |
| Changed tool or version, operation, target or destination, parameters, content or attachments, amount, currency or limits | Deny; require new approval |
| Changed identity | Deny; require compatible authorisation and approval |
| Policy changed | Deny and reassess |
| Resource state changed | Deny and send for another review |
Enforce Single Use and Control Retries
Once the request matches, consume the approval exactly once. Check validity and claim the approval in one atomic operation immediately before dispatch. Send the checked immutable payload, not a reconstructed call.
Use an action-linked idempotency key where supported. But consuming an approval does not guarantee exactly-once effects: a timeout can hide a successful external action.
Record claimed, dispatched, succeeded, failed or outcome_uncertain, and reconcile the downstream result before any retry. An authorised recovery path must preserve both the payload and the idempotency key. Never silently reset a consumed approval or treat a changed action as a retry.
Recheck Policy, Permissions and Resource State
A matching approval must still fail if live conditions no longer allow the action. At execution, recheck current roles, tenant boundaries, destination allowlists, transaction caps, rate limits and segregation-of-duties rules.
Keep read permission separate from write, delete, publish, transfer and permission-changing rights. Use least-privilege credentials and require new multi-factor or privileged approval where policy demands it. A suspended account or newly prohibited destination must block execution, even if approval was granted earlier.
Enforce the approved resource version inside the downstream operation, not with a separate read followed by an unprotected write. A conditional update against approved version 18 must affect zero rows if the version has changed. Treat that result as stale state and return the action for another review. Do not fetch the latest version and proceed.
Test and Monitor the Approval Workflow
Test Tampering, Replay and Changed Conditions
Before production, test the same binding checks that the execution gate enforces. Try substituting tools, targets, arguments, defaults and aliases, and changing requests between approval and execution. Tampered requests must fail before dispatch.
Run concurrent attempts against the same approval ID to confirm that only one executor can consume it. Test changed permissions, resource-state changes and cross-tenant targets too. Check that denied actions cause no downstream side effects. [2]
Log Decisions and Track Denials
Use the approved action digest as the audit key. Link the request, approval, validation and outcome through a SHA-256 digest of the canonical action.
Record the agent ID, requester ID, approver ID, tool name, target resource, argument hash, policy version, reason and timestamp. Leave out credentials, session tokens, raw secrets, prompt PII and reasoning traces.
Set alerts for mismatches between the approved digest and the execution-time digest. Track duplicate-execution incidents separately. [1]
Assign Owners for Controls and Incidents
Give every control that blocks unsafe execution a named owner. Cover tool schemas, approval policies, workload identity, replay prevention, recovery controls and denial handling.
Use pre-seeded denial cases to check that these controls preserve action integrity. Assign an incident owner to handle root-cause analysis and retesting before the incident is closed. [1]
Conclusion: Execute Only What Was Approved
After review and approval, execute only the frozen action object. Approval authorises one exact action, not a general task. Approve the canonical action object - not the agent’s narration. Bind the tool, arguments, target, approver, expiry and nonce to that approval. [1]
At the execution gate, check the live request against the approval record, enforce authorisation and atomically consume the nonce before dispatch. A matching digest alone does not authorise execution. [1] If the digest matches but the request does not, block execution.
FAQs
How should I approve a task involving several agent actions?
Treat each logical operation as a separate, atomic action - not as part of a blanket approval for the whole process. In the execution service, place an authorisation gate immediately before each sensitive action.
Bind each approval to the tool, target and all material arguments by storing a SHA-256 digest of their canonical representation. Before execution, recheck permissions, the current state and approval status. Reject any request that has changed, and consume each approval atomically to prevent replay attacks.
What if a tool cannot enforce idempotency?
Handle reconciliation and failures in the execution layer. A timeout or lost response does not mean the operation failed. Check the outcome before retrying.
Track each operation by storing a stable idempotency key alongside the tenant, actor, arguments hash and execution status. Consume approval records atomically to prevent duplicate executions, even when the tool has no built-in deduplication.
How can I make detailed approvals easier to review?
Give authorised reviewers clear evidence tied to the request, rather than a generic approval prompt. Hokstad Consulting recommends showing only what reviewers need: the exact amount in pounds sterling, payee details, affected records or the specific command for production changes. Explain the potential impact and include a clear rollback plan so reviewers can challenge the proposal.
Link each approval to an immutable, versioned record of the exact action. This ensures reviewers assess the same request, with no changes possible after it has been recorded.