HITLReference

Errors and codes

Every hitl.* code, where it appears (an outcome value, a rejected review, an HTTP response or an exception), and which ones are worth retrying.

Outcomes are values. authorize returns an Authorization for denied, expired and pending actions; respond returns conflict or rejected instead of raising; gate.webhooks() answers with a status code. Exceptions are for gated calls that must stop the tool, and for misuse or a broken world. Every error carries a stable code and a docs_url / docsUrl. The codes and their meaning are the same in Python and TypeScript; make docs fails if a code in the TypeScript sources is missing here, or listed here and gone from the sources.

Error types

ErrorCodeRaised when
PolicyError (a core SpecError)hitl.policy_invalidA policy fails the schema or a lint error, at construction or reload(). Each issue has a path, file, line, column and an issue code (below). Also an Authorization code: a deny or ask rule conditions on an args field the tool's input schema does not have ("rule large: args.amout is not a field of issue_refund; did you mean amount?"), so the call is denied
ActionDeniedhitl.deniedA gated function, tool or raise_for_status() was not granted. .status says why (denied, expired, cancelled); .authorization carries the decision, message and code
ApprovalPendinghitl.approval_pendingSuspend mode: the call waits for a person. .approval is the pending approval. Adapters turn it into the framework's interrupt
HitlErrorhitl.<reason>Misuse or a broken world (the codes below marked "exception")

Refusals

Set on Authorization.code (and on ActionDenied.authorization) when an action is refused for a reason other than a plain policy or human deny. These are values: authorize returns them.

CodeWhenRetry
hitl.no_approverAn ask with no approver or channel that can answer, or a delivery that failedNo
hitl.store_unavailableThe store failed or could not be reached (also raised by the store itself on open)Yes, when the store is back
hitl.receipt_failedA receipt required before execution could not be writtenYes
hitl.invalid_argsThe arguments failed the tool's input schema or cannot be canonical JSON (an unsafe integer, a cycle, NaN)No
hitl.already_usedThe approval was already consumed, or the execution key already settledNo
hitl.not_approvedredeem found no approval for this exact action (for example, arguments changed after approval)No
hitl.policy_changedThe current policy denies at consume what was approved earlierNo
hitl.digest_mismatchThe arguments about to run are not the ones approvedNo
hitl.limit_contentionA limit reservation could not be made under contentionYes
hitl.approval_staleAn approved approval was not used before its use_by; the action is asked againNo (ask again)
hitl.execution_key_mismatchAn execution key was reused for a different action, or an approval bound to one execution key (bind_execution_key, execution_key="call_id") was consumed with another (what some integrations call approval.mismatch)No
hitl.execution_in_progressAnother caller holds the live lease on this derived execution key. Authorization.retryable is trueYes, after the lease
hitl.policy_unavailableThe policy resolver failed, timed out or returned an invalid policy for this tenant; other tenants are unaffectedYes
hitl.resource_failedThe tool's resource callback threw while building the actionNo
hitl.history_unavailableAn invariant needs history for a scope whose history was lost (tainted) or cannot be readAfter an operator clears the taint

Review rejections

On a rejected (or conflict) RespondResult. The channel shows them to the person who answered, and rejections are recorded on the receipt chain.

CodeWhenRetry
hitl.not_a_memberThe reviewer is not in the approver's members, the host reviewer said no, or the reviewer failed or timed outNo
hitl.self_approvalThe reviewer is the person the agent acts forNo
hitl.identity_unavailableThe identity resolver failed or timed out, so self-approval could not be checkedYes
hitl.digest_mismatchThe review echoed a digest other than the one under reviewNo
hitl.edits_not_allowedAn edit on a rule without edits: trueNo
hitl.edits_redactedAn edit over a redacted request on a rule without edits: redactedNo
hitl.bad_requestA review without a reviewer identity (by), or an answer to an outdated Slack cardNo
hitl.edit_touches_redactedAn edit still contains a redaction marker (any string containing [redacted); the approval stays pending. Web, webhook and Console answer 422. The gate also refuses granted args that contain oneNo
hitl.expiredThe approval expired before the answer arrivedNo
hitl.already_decided(conflict) The approval was already decidedNo
hitl.contention(conflict) Too many concurrent answers lost the compare-and-setYes

Inbound requests

Returned by gate.webhooks() before any review is read, as { "error": "<code>" } with the status shown.

CodeStatusWhen
hitl.signature_missing401Signature headers are absent
hitl.signature_invalid401No signature matches the raw body, or the timestamp is not a number
hitl.signature_stale401The timestamp is outside the 5 minute window
hitl.link_expired401A signed link is past its expiry
hitl.method_not_allowed405Not a POST
hitl.request_invalid400Unreadable body or a missing link token
hitl.review_invalid400The review in the body is not a valid review (also raised by respond for invalid input)
hitl.webhook_failed500A channel callback failed unexpectedly; reported through on_error

Exceptions

HitlError codes for misuse or a broken world.

CodeWhenRetry
hitl.key_requiredSuspend mode with no call_id and no key for an action that needs approvalNo
hitl.action_invalidAn action without a tool nameNo
hitl.gate_optionsInvalid or conflicting gate options (a policy and a policy_resolver)No
hitl.policy_inputSomething that is not a policy was passed as oneNo
hitl.policy_resolvergate.policy read on a gate that resolves a policy per tenant: use policy_for(tenant)No
hitl.config_invalidAn invalid redaction key, or a shared store with the default redactor and no keyNo
hitl.redact_keyA redaction key rotation the configuration does not supportNo
hitl.channel_configA channel is misconfigured (a missing token, secret, URL or fetch)No
hitl.channel_failedSlack, a webhook endpoint or the terminal failed; the gate turns a failed delivery into hitl.no_approverYes
hitl.resource_failedA tool's resource callback threw: the call is denied (fail closed), since a deny or ask rule may match on the resourceNo
hitl.args_requiredconsume(approval_id) on an approval whose stored args were redacted, without the args to executeNo
hitl.channel_closedThe terminal's stdin closed (EOF) before an answer. Not a decision: the prompt ends, the approval stays pending and ends as decided elsewhere or expired at its timeoutNo
hitl.store_invalidInvalid store options (a Postgres table prefix)No
hitl.store_unsupportedThe store lacks an operation the call needs (history updates)No
hitl.read_onlyA write on a store opened read-onlyNo
hitl.cursor_invalidAn invalid list cursorNo
hitl.not_foundcancel of an approval that does not existNo
hitl.contentioncancel kept losing compare-and-set racesYes
hitl.unknown_executionsettle with a key no consume recordedNo
hitl.tenant_mismatchAn execution key or history remedy that belongs to another tenantNo
hitl.receipts_unavailablereceipts=True on a store without receiptsNo
hitl.receipt_invalidAn operator_action entry without action or by, or with a reserved keyNo
hitl.receipt_contentionA receipt append kept losing the chain headYes
hitl.receipt_lockThe file receipt lock could not be takenYes
hitl.filesystem_unavailable(TypeScript) A file path was given on a runtime without a filesystem; pass inline policies or a storeNo
hitl.checkpointer_requiredThe LangGraph middleware ran without a checkpointerNo
hitl.adapter_optionsInvalid adapter optionsNo
hitl.adapter_unsupported(TypeScript, OpenAI Agents) A tool cannot be bound to the arguments it will execute with this SDK versionNo
hitl.args_unstable(LangGraph, OpenAI Agents) Validating the granted arguments again changes them, so they would not run as approved. Core tools (gate.wrap, gate.tool) raise core's core.tool_args_unstable insteadNo
hitl.scope_requiredThe OpenAI Agents, Vercel AI SDK or Pydantic AI adapter got no scope or action hookNo
hitl.ticket_ambiguous(Claude Agent SDK) Identical calls from several sessions wait on an unbound tool serverNo
hitl.too_many_interruptionsAn OpenAI Agents run kept pausing for approvalsNo

Reported, never raised

These describe something that already happened after a side effect, or in the background. They reach on_error / onError, events or receipts, never the caller's return value.

CodeWhereWhen
hitl.receipt_loston_errorThe executed receipt could not be written after retries
hitl.hook_failedon_errorAn on_decided hook still failed after its retries
hitl.history_loston_error, eventsInvariant history for an action was lost after retries; its scopes are tainted
hitl.execution_loston_error, settle resultThis process no longer holds the execution it tries to settle (changed: false)
hitl.unsettledexecuted receipt error_typesweep() settled an execution nobody settled before the lease and reservation TTL
hitl.args_mismatchon_error, executed receipt(Claude Agent SDK) A built-in tool ran with arguments that differ from the approved ones, because a later hook changed them
hitl.hook_timeoutHook deny reason(Claude Agent SDK) No decision arrived before the hook's bounded wait, so the call was denied

Core codes

CodeWhen
core.tool_args_invalidA gated core tool got arguments that fail its JSON Schema input_schema. Core validates before any middleware, so the gate never runs

Policy issue codes

A PolicyError lists issues. Most are schema codes (type, enum, a missing or unknown key, duration_invalid, path_invalid, name_invalid). These are specific to HITL:

IssueWhen
shared_secret_quorumA quorum above 1 routed to a webhook channel, which counts as one person
overlay_on_timeout_allowA tenant overlay sets on_timeout: allow (overlays may only tighten)
overlay_defaultA tenant overlay sets a default
reviewer_requiredmembers: { permission } with no reviewer on the gate
invariant_not_enforceableAn invariant uses followed_by, which can only be asserted after a run

viewport-hitl check adds lint findings: errors fail the check, warnings do not.

FindingLevelWhen
approver_unreachableerrorAn ask whose approver has no reachable channel
shared_secret_quorumerrorAs above
default_allowwarningdefault: allow
member_channelerrorA members entry whose identity prefix is not the approver's channel (auto: entries excepted)
open_approverwarningAn approver with no members: anyone who can answer on its channel counts as it
model_routed_approverwarningAn approver whose to: is a JSONPath that can read the args ($.args... or a wildcard in its place): the model picks who is asked; route from context instead
fail_open_timeoutwarningon_timeout: allow on a rule or approver
allow_shadowedwarningAn allow rule a deny rule fully covers
tool_uncoveredwarningWith --tools: a tool no rule mentions
dead_patherror on deny / ask, warning on allowWith --tools: a condition on an argument path no named tool has (a misspelled field turns the gate off). At run time, with the tool's input schema known, such a deny or ask rule denies the call with hitl.policy_invalid

On this page