require_approval, Sentrail does not forward the request. Instead it stores the entire original call — method, URL, headers, body — and returns a 202 to the agent. A reviewer decides, and Sentrail replays the stored request.
Full flow
The queue_gateway_approval_request RPC
The RPC is the atomic unit that creates both the approval record and the deferred action in a single transaction:
Approval integrity
Each approval request and its corresponding deferred action carry a SHA-256 hash of the canonical action payload —target_url + method + body — computed at creation time inside the queue_gateway_approval_request RPC. The same hash is stored in both approval_requests.action_hash and deferred_actions.action_hash.
The executor verifies these hashes match before running any action:
A mismatch produces an
action_hash_mismatch entry in the audit log and marks the approval as failed — it cannot be retried.Polling for a decision
The agent polls using the correlation ID returned in the 202:Approval request status values
| Status | Meaning |
|---|---|
pending | Awaiting reviewer decision |
approved | Reviewer approved; execution may be in progress |
denied | Reviewer denied; deferred_action marked failed |
expired | TTL elapsed (default 24 hours) without a decision |
executed | Approved and the tool API call succeeded |
failed | Approved but the tool API call failed |
Expiry
Approval requests expire after 24 hours by default. Theexpire-approvals cron job marks pending requests as expired and updates their linked deferred actions.