A2A 1.0 · Ed25519 receipts · SOC 2 in progress
Build November 10, 2026Status

Asynchronous human approval timeout enforcement: what happens when nobody answers

An approval request that never resolves is a stuck agent. This walks through the timeout state machine, where to enforce the deadline, and how to make the expiry auditable instead of silent.

Asynchronous human approval timeout enforcement requires treating silence as a definitive state transition instead of an unhandled exception or an indefinite sleep. When an autonomous workflow stalls because a person did not answer, the system must evaluate an explicit expiry boundary, transition the approval record to a terminal state, and return that outcome so the caller can branch cleanly.

Without an authoritative deadline written to storage, workflows suffer from thread exhaustion, orphaned execution locks, and unbounded agent workflow timeout bugs. An unhandled delay also leads to late execution, where a human approves a request hours or days after the agent assumed it had failed. Designing resilient agent systems requires strict guarantees: who owns the clock, how the storage layer arbitrates concurrent transitions, and how the run resolves when human-in-the-loop latency runs out.

The short answer: a timeout is a state transition, not a sleep

An approval request must evaluate to one of four terminal states: approved, denied, expired, or cancelled. An agent cannot treat a timeout as a local thread sleep that wakes up and guesses what happened. If an action requires human intervention, the requesting agent must register an approval entity, receive a unique identifier, and either poll the endpoint or wait on an approval.* webhook.

When silence occurs, the failure mode is predictable. An agent framework might block on an unresolved Promise or an open HTTP connection. Downstream workers hold locks against database rows, and worker pools dry up. If a human responder is away from their keyboard for three hours, an unmanaged caller leaves resources stranded until an orchestrator forcibly terminates the container.

A deadline is an immutable property of the request payload, not a measure of the caller's patience. When creating the request, the agent declares an expires_at timestamp. The backend verifies this timestamp against authoritative server time. Silence does not mean approval, nor does it mean to keep waiting. Silence means the transition condition for expired has been satisfied.

Every timeout must be recorded in an audit trail with identical weight to an explicit approval or rejection. Omitting an action due to an expired deadline represents a concrete operational decision. If an auditor asks why a financial transfer or an outbound customer email did not fire, "the request timed out" is an auditable business outcome only if the storage layer committed an expired event with an immutable timestamp.

Where the deadline actually lives: three enforcement points and which one to trust

Building asynchronous human approval timeout enforcement forces a team to pick an enforcement layer. Teams generally attempt enforcement in one of three places, but only one provides durable system-wide guarantees.

The agent's local wait loop

The simplest approach implements a local loop: the agent calls sleep(poll_interval), checks the status, and breaks when its local timer exceeds an internal limit. This pattern breaks under real-world conditions. If the agent worker restarts, crashes, or gets rescheduled by Kubernetes, the local timer vanishes. When the worker comes back up, it either loses track of the pending approval entirely or resumes waiting with a reset timer. Local timers cannot provide an authoritative audit log because the timeout state lives in volatile memory rather than durable storage.

The workflow queue or orchestrator

Platform engineers often place timeout enforcement inside the execution harness using task revocation or workflow timers. Systems like Temporal workflow executions manage timeouts across distributed steps. This approach survives process restarts, but it decouples the timeout from the actual approval record. The orchestrator may decide the task timed out and resume execution, while the database holding the human's approval UI still displays the ticket as pending. If the human clicks approve five minutes later, the approval store records a success that contradicts the orchestrator's state. The two systems diverge silently.

The approval store

The only authoritative place to enforce a deadline is the approval record's primary storage engine. The approval record must contain an explicit expires_at attribute. When a reader queries the request, or when an approver attempts to transition the record, the database enforces the deadline at the persistence tier. If an approver submits an approval after expires_at has passed, the storage layer rejects the mutation. Under RFC 9110 section 15.5.10, an HTTP 409 Conflict status indicates that the request cannot be completed due to a conflict with the resource's current state.

Enforcing the boundary at the storage engine introduces an important engineering tradeoff. A late approval is rejected outright. For irreversible actions, like database migrations, wire transfers, or unrecoverable emails, hard rejections are mandatory. For low-impact reversible actions, rejecting a late human approval can frustrate team members. The engineering rule remains strict: design the enforcement point around the blast radius of the gated action. Irreversible actions demand hard storage-layer rejections.

To implement this cleanly, evaluate expires_at against server time on every read and write. Do not return an HTTP 404 when an approval expires. A missing entity indicates a routing or configuration failure; an expired entity indicates a completed lifecycle. Return HTTP 200 with "status": "expired" so the agent client can evaluate the payload and branch without error handling ambiguities.

Designing the timeout value: human-in-the-loop latency is a distribution, not a number

Engineers often treat human-in-the-loop latency as a single integer, hardcoding a constant like TIMEOUT_SECONDS = 3600. In production, human response latency is heavily right-skewed. Routine operational tasks may see a median resolution time of four minutes, but the 99th percentile spans weekends, time-zone handoffs, and company holidays. That long tail is what exhausts thread pools and ties up resources.

Select timeout thresholds based on the time sensitivity and reversibility of the target action:

  • Calendar scheduling, inventory holds, and real-time bids require tight deadlines. A calendar hold cannot linger indefinitely without denying availability to others.
  • Context-dependent customer replies tolerate a latency of two to four hours before the message becomes stale.
  • Bulk data mutations, infrastructure provisioning, and access elevation can wait 12 to 24 hours without compromising system integrity.

Decouple the agent's active execution wait from the approval ticket's resolution lifespan. These clocks do not need to match. For example, an agent can pause an active execution path, set an agent workflow timeout of 15 minutes, and park its execution context in long-term storage. Meanwhile, the human approval request in the dashboard can remain open with an expires_at set to 24 hours. If the 15-minute execution window closes, the agent transitions its internal run to a parked status. If a human inspects the dashboard later, they can still formally mark the request as denied or allow it to expire, keeping operational records clean.

A frequent anti-pattern is retrying the entire agent workflow execution upon an approval timeout. An agent run contains earlier side effects: reading internal documentation, fetching third-party resources, and generating intermediate states. Re-running the entire workflow causes redundant LLM compute generation and duplicates external side effects. Instead of restarting the agent run, write the orchestrator to retry only the approval verification phase or cleanly terminate the run.

Protracted timeouts introduce hidden operational drag. Long-lived pending approvals consume concurrency slots in workflow engines, hold distributed mutexes, and bloat query performance for queue dashboards. When thousands of requests sit in an unresolved state, monitoring systems show elevated queue depths that disguise real performance regressions.

The expiry path is where asynchronous human approval timeout enforcement usually breaks

The expiry codepath is prone to concurrency bugs because it involves two asynchronous actors racing against a deadline: a human reviewer clicking an action in a browser, and an automated background worker marking the record as dead.

Consider the split-second race condition. A reviewer clicks "Approve" at timestamp T + 59s. Simultaneously, a cleanup sweeper executes at T + 60s to expire the item. If the updates are not atomic, both workers write to the record. If the sweeper runs slightly late or writes out of order without condition checks, a "last-write-wins" configuration overwrites the human's manual approval with an expired state, or vice versa. The audit trail then documents a sequence of events that contradicts the actual state of the external world.

To eliminate this race, database updates must use compare-and-set semantics. According to the Amazon DynamoDB Developer Guide on TransactWriteItems, transactional operations enforce atomicity across items using conditional expressions. A mutation attempting to transition a request to expired must assert conditions directly in the write:

ConditionExpression: "attribute_exists(approval_id) AND #status = :pending AND :now > expires_at"
ExpressionAttributeNames: { "#status": "status" }
ExpressionAttributeValues: {
  ":pending": "pending",
  ":now": 1732363200
}

If the human approval committed an instant earlier, the record's status is no longer pending. The conditional write fails, preventing the sweeper from corrupting the valid approval. Conversely, if a human attempts to submit a late resolution, their update must assert :now <= expires_at. When the write fails, the UI must reject the action and notify the user that the deadline lapsed.

A second common failure occurs when an agent encounters an internal network timeout while awaiting an approval creation response, causing it to retry the request. If the client does not pass a deterministic idempotency key derived from the target action, the store creates duplicate approval tickets for the same underlying task. A human might review and approve ticket A, while ticket B expires quietly in the background. The agent, listening to updates for ticket B, assumes the request was abandoned and halts work. Idempotency keys must be computed from the intended action payload, such as a hash of the destination, payload, and execution step, rather than randomized per network call.

A third race occurs over webhooks. When an approval expires, the system dispatches an approval.expired event to a webhook endpoint registered by the agent infrastructure. If that webhook delivery is delayed by network transit, it can land after the agent has already polled the status or branched into an alternate failure routine. Receivers must be idempotent and must verify authenticity before processing the state change.

Following message authentication standards outlined in RFC 2104 on HMAC keyed-hashing, webhooks require cryptographic signatures. AgentDraft signs every webhook delivery with an X-AgentDraft-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256> header computed over <t>. followed by the raw request body, using the workspace's signing secret. The receiver verifies it; AgentDraft recommends that receivers reject any timestamp more than 300 seconds (5 minutes) from the current time to block replays, and its documented reference verifier does so. Signed webhook delivery is available on every plan, including the free Developer tier.

TransitionTriggering ActorRequired Storage GuardResulting Event
Pending → ApprovedAuthenticated Humanstatus == pending AND now <= expires_atapproval.approved
Pending → DeniedAuthenticated Humanstatus == pending AND now <= expires_atapproval.denied
Pending → ExpiredSweeper or Store Readstatus == pending AND now > expires_atapproval.expired
Pending → CancelledOriginating Agentstatus == pendingapproval.cancelled

What the agent should do on expiry: fail closed, degrade, or escalate

When the agent reads back an expired state from an asynchronous human approval timeout enforcement check, it must follow an explicit error-budget strategy. Autonomous workflows typically implement one of three design patterns.

Fail closed

The safest default for consequential tasks is failing closed: abort the planned action completely. The agent marks its internal workflow state as aborted, logs the expiration to its execution record, and stops processing. This strategy is mandatory for actions that move money, modify system infrastructure, revoke access permissions, or issue unvetted communications. Failing closed ensures that operational neglect from human reviewers results in an omitted action rather than unintended side effects.

Graceful degradation

If an action has a non-destructive equivalent, the agent degrades gracefully. For example, if an outbound marketing or sales email approval times out, the agent does not send the transmission over SMTP. Instead, it saves the compiled output as a draft in the appropriate system. If a scheduling conflict arises and an approval to force an override times out, the agent abandons the collision-prone slot and returns an alternative availability list.

Degradation patterns require the agent system to maintain strict separation between drafting tools and execution tools. When human-in-the-loop latency runs out, the agent drops its execution privileges and uses draft-only operations.

Escalation

In workflows where inaction introduces system-wide failure, an agent can escalate by opening a secondary approval request with modified parameters, such as a shorter deadline, or by dispatching an operational alert to on-call staff. Escalating simply means generating a new discrete approval resource or alert. The requesting agent decides for itself when to open an approval request. AgentDraft does not yet provide a policy engine that auto-requires approval by action class, amount threshold, or role, and there are no escalation chains or multi-approver quorums: a single workspace human resolves each request.

Action ClassReversibilityDefault Expiry PolicyFallback Action
Financial TransactionIrreversibleFail ClosedAbort run; record expiry in audit ledger
Outbound Cold EmailIrreversibleDegradeWrite draft to mailbox; do not dispatch
Calendar Hold CommitReversibleFail ClosedRelease bucket hold; notify caller of conflict
Infrastructure DeployHigh Blast RadiusFail ClosedTear down staging sandbox; alert engineer

Treating an approval timeout as an implicit approval creates uncontrolled side effects in production. If an agent loops continuously, regenerating expired approval requests every thirty minutes, it pollutes audit records and consumes unnecessary compute. If an action expires, human reviewers decided, through action or inaction, not to proceed.

Making the timeout auditable: the record an auditor will ask for

Compliance teams and platform architects evaluate human-in-the-loop implementations by their audit records. In high-assurance environments, showing that an action did not occur requires proof equal to showing that an action succeeded. If an incident review occurs three weeks after a stalled deployment, an engineer cannot tell an auditor that a missing record proves a timeout occurred. A missing row might represent a silent drop, a database failure, or a compromised pipeline.

Every terminal lifecycle state must produce an immutable audit entry. The record requires the following fields:

  • request_id: Unique identifier for the approval lifecycle.
  • agent_id: Identity of the agent requesting authorization.
  • action_summary: Human-readable string describing the gated action.
  • evidence_payload_hash: Cryptographic digest (such as SHA-256) of the JSON context payload presented to the human reviewer.
  • opened_at: Unix epoch millisecond timestamp of request registration.
  • expires_at: Configured expiry deadline timestamp.
  • resolved_at: Timestamp when the state became terminal.
  • resolver_identity: The unique user identity of the approver, or "system::timeout_engine" if resolved by deadline.
  • status: The terminal state (approved, denied, expired, or cancelled).

According to the Amazon DynamoDB Developer Guide on Time to Live, TTL deletions are handled as background operations and do not guarantee immediate row removal at the exact second of expiration. Systems relying on storage TTLs to trigger deletions must account for this delay. Expired items can persist in raw storage partitions for hours before physical eviction occurs. Consequently, the expiry state must be asserted dynamically on read operations rather than inferred from the physical deletion of the row.

AgentDraft records state-changing agent actions in an append-only audit trail. Every state-changing operation emits an audit record. Audit retention is per-tier and enforced on read as well as on write, so the retention claim holds even though deletion is lazy.

AgentDraft lets an agent pause any consequential action for human sign-off: it opens an approval request carrying a one-line summary and a JSON evidence payload, a person approves or denies it in the dashboard with an optional note, and the agent reads the outcome back. The gated action does not have to be one AgentDraft performs: a deploy, a migration, or a refund is gated the same way. Every transition lands in the append-only audit trail and fires an approval.* webhook. Approvals are decided in the AgentDraft dashboard. AgentDraft emails the workspace owner a notification linking to the queue, but the decision itself is made signed in: there are deliberately no approve-from-email links, because an unauthenticated one-click approve is an attack surface. Slack, Discord, Teams, SMS and push delivery are not available today.

Testing timeout enforcement before it bites in production

Validating timeout enforcement requires testing boundary conditions rather than standard happy paths. Building reliable test suites for human approval flows requires asserting four specific test scenarios before deploying agent workflows to production.

Exact boundary evaluations

Create unit and integration suites that evaluate requests around the threshold edge. Simulate responses at expires_at - 100ms, expires_at, and expires_at + 100ms. The system must process the first as a valid resolution and reject the third with an explicit expiration response. Verify that the rejection payload contains the final machine-readable status, not a generic 500 error.

Worker crash recovery

Verify that your orchestration layer recovers gracefully when an agent crashes while awaiting approval. Container runtimes terminate stalled processes using POSIX signals as detailed in the Kubernetes pod lifecycle documentation. Start an agent execution, register an approval request with a tight deadline of five seconds, and send a SIGKILL to the agent runner process. Allow the deadline to elapse, then restart the agent process. The agent must read the approval state from storage, detect the expired status, clean up its working memory, and terminate without hanging.

Replayed webhook events

Simulate hostile or broken network conditions by transmitting the exact same approval.expired webhook payload to the consumer twice. Verify that the receiving application acknowledges the second request with an HTTP 200 without executing secondary failure actions twice. Webhook receivers must maintain their own local deduplication table using the incoming delivery headers.

Clock drift resistance

Simulate clock discrepancies between the approval storage layer and the webhook receiver. Generate a signed webhook payload where the timestamp header is set 290 seconds in the past; the receiver should verify the signature and accept the payload. Generate a payload with a timestamp set 310 seconds in the past; the receiver must reject the delivery as invalid under the 300-second window. Testing this boundary prevents replay attacks from being processed as current timeouts.

Developers using LangChain, the OpenAI Agents SDK, or CrewAI can run these integration sweeps locally by mocking HTTP boundaries or directly calling API endpoints.

Record silence as an authoritative state

Asynchronous human approval timeout enforcement establishes certainty in non-deterministic systems. By attaching the deadline directly to the request entity, guarding mutations with conditional writes, and recording terminal expirations in an immutable audit log, developers prevent zombie workers and silent execution failures.

Treating silence as an auditable state prevents three catastrophic bugs: agents that hang indefinitely waiting for input, systems that execute side effects on expired approvals, and auditing failures where unexecuted steps leave no record behind. For more on coordinating agent workflows, review the AgentDraft coordination layer documentation, our API documentation, and recent updates in our public changelog.

Frequently asked questions

How do I handle asynchronous human approvals with timeout enforcement for agent workflows?

Store the approval request as an explicit database record with a defined expires_at timestamp. The agent should pause execution and retrieve the status via polling or incoming webhooks. The database must use conditional writes to transition the state to expired when the current time exceeds the deadline, rejecting any late approval mutations from human reviewers.

How long should an agent wait for human approval before timing out?

Timeout durations depend on the reversibility and perishability of the target operation. Time-sensitive actions such as calendar holds or inventory reservations require short windows, ranging from 30 seconds to a few minutes. Operational workflows like sending communications or granting user permissions should provide two to four hours. Separate the agent's active execution thread wait from the request's overall ticket lifetime.

Should a late approval after the timeout still be accepted?

For irreversible operations, such as financial transfers, unvetted external emails, or system deployments, late approvals must be rejected at the storage layer. If an action is fully reversible, an agent architecture may permit a manual re-opening of the task, but the original request must remain permanently recorded as expired to preserve the integrity of the audit log.

How do I stop an agent from retrying the whole action when an approval expires?

Decouple the approval gate from the main workflow execution logic. When an approval expires, the agent should transition its execution state to an aborted or degraded status without triggering an automated retry loop from step zero. Ensure that all requests use deterministic idempotency keys generated from the action payload to prevent duplicate approval tickets from spawning on network retries.

Does an expired approval request appear in the audit trail?

Yes. A proper human-in-the-loop implementation writes every terminal transition, including expiration, directly to the append-only audit trail. The record must capture the unique request ID, the initiating agent, the action payload digest, the target expiration deadline, the timestamp of expiration, and the system actor responsible for closing the request.

Read the approvals endpoint and the audit record shape at https://agentdraft.io/for-agents/approvals, then exercise the expiry path on AgentDraft. AgentDraft's Developer tier is free with no card required: 1 seat, 3 agents, 1 mailbox, 1 connected calendar, 50 bookings a month, and 7-day audit retention. See plan limits at https://agentdraft.io/pricing.