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
| Error | Code | Raised when |
|---|---|---|
PolicyError (a core SpecError) | hitl.policy_invalid | A 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 |
ActionDenied | hitl.denied | A gated function, tool or raise_for_status() was not granted. .status says why (denied, expired, cancelled); .authorization carries the decision, message and code |
ApprovalPending | hitl.approval_pending | Suspend mode: the call waits for a person. .approval is the pending approval. Adapters turn it into the framework's interrupt |
HitlError | hitl.<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.
| Code | When | Retry |
|---|---|---|
hitl.no_approver | An ask with no approver or channel that can answer, or a delivery that failed | No |
hitl.store_unavailable | The store failed or could not be reached (also raised by the store itself on open) | Yes, when the store is back |
hitl.receipt_failed | A receipt required before execution could not be written | Yes |
hitl.invalid_args | The arguments failed the tool's input schema or cannot be canonical JSON (an unsafe integer, a cycle, NaN) | No |
hitl.already_used | The approval was already consumed, or the execution key already settled | No |
hitl.not_approved | redeem found no approval for this exact action (for example, arguments changed after approval) | No |
hitl.policy_changed | The current policy denies at consume what was approved earlier | No |
hitl.digest_mismatch | The arguments about to run are not the ones approved | No |
hitl.limit_contention | A limit reservation could not be made under contention | Yes |
hitl.approval_stale | An approved approval was not used before its use_by; the action is asked again | No (ask again) |
hitl.execution_key_mismatch | An 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_progress | Another caller holds the live lease on this derived execution key. Authorization.retryable is true | Yes, after the lease |
hitl.policy_unavailable | The policy resolver failed, timed out or returned an invalid policy for this tenant; other tenants are unaffected | Yes |
hitl.resource_failed | The tool's resource callback threw while building the action | No |
hitl.history_unavailable | An invariant needs history for a scope whose history was lost (tainted) or cannot be read | After 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.
| Code | When | Retry |
|---|---|---|
hitl.not_a_member | The reviewer is not in the approver's members, the host reviewer said no, or the reviewer failed or timed out | No |
hitl.self_approval | The reviewer is the person the agent acts for | No |
hitl.identity_unavailable | The identity resolver failed or timed out, so self-approval could not be checked | Yes |
hitl.digest_mismatch | The review echoed a digest other than the one under review | No |
hitl.edits_not_allowed | An edit on a rule without edits: true | No |
hitl.edits_redacted | An edit over a redacted request on a rule without edits: redacted | No |
hitl.bad_request | A review without a reviewer identity (by), or an answer to an outdated Slack card | No |
hitl.edit_touches_redacted | An 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 one | No |
hitl.expired | The approval expired before the answer arrived | No |
hitl.already_decided | (conflict) The approval was already decided | No |
hitl.contention | (conflict) Too many concurrent answers lost the compare-and-set | Yes |
Inbound requests
Returned by gate.webhooks() before any review is read, as { "error": "<code>" } with the status shown.
| Code | Status | When |
|---|---|---|
hitl.signature_missing | 401 | Signature headers are absent |
hitl.signature_invalid | 401 | No signature matches the raw body, or the timestamp is not a number |
hitl.signature_stale | 401 | The timestamp is outside the 5 minute window |
hitl.link_expired | 401 | A signed link is past its expiry |
hitl.method_not_allowed | 405 | Not a POST |
hitl.request_invalid | 400 | Unreadable body or a missing link token |
hitl.review_invalid | 400 | The review in the body is not a valid review (also raised by respond for invalid input) |
hitl.webhook_failed | 500 | A channel callback failed unexpectedly; reported through on_error |
Exceptions
HitlError codes for misuse or a broken world.
| Code | When | Retry |
|---|---|---|
hitl.key_required | Suspend mode with no call_id and no key for an action that needs approval | No |
hitl.action_invalid | An action without a tool name | No |
hitl.gate_options | Invalid or conflicting gate options (a policy and a policy_resolver) | No |
hitl.policy_input | Something that is not a policy was passed as one | No |
hitl.policy_resolver | gate.policy read on a gate that resolves a policy per tenant: use policy_for(tenant) | No |
hitl.config_invalid | An invalid redaction key, or a shared store with the default redactor and no key | No |
hitl.redact_key | A redaction key rotation the configuration does not support | No |
hitl.channel_config | A channel is misconfigured (a missing token, secret, URL or fetch) | No |
hitl.channel_failed | Slack, a webhook endpoint or the terminal failed; the gate turns a failed delivery into hitl.no_approver | Yes |
hitl.resource_failed | A tool's resource callback threw: the call is denied (fail closed), since a deny or ask rule may match on the resource | No |
hitl.args_required | consume(approval_id) on an approval whose stored args were redacted, without the args to execute | No |
hitl.channel_closed | The 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 timeout | No |
hitl.store_invalid | Invalid store options (a Postgres table prefix) | No |
hitl.store_unsupported | The store lacks an operation the call needs (history updates) | No |
hitl.read_only | A write on a store opened read-only | No |
hitl.cursor_invalid | An invalid list cursor | No |
hitl.not_found | cancel of an approval that does not exist | No |
hitl.contention | cancel kept losing compare-and-set races | Yes |
hitl.unknown_execution | settle with a key no consume recorded | No |
hitl.tenant_mismatch | An execution key or history remedy that belongs to another tenant | No |
hitl.receipts_unavailable | receipts=True on a store without receipts | No |
hitl.receipt_invalid | An operator_action entry without action or by, or with a reserved key | No |
hitl.receipt_contention | A receipt append kept losing the chain head | Yes |
hitl.receipt_lock | The file receipt lock could not be taken | Yes |
hitl.filesystem_unavailable | (TypeScript) A file path was given on a runtime without a filesystem; pass inline policies or a store | No |
hitl.checkpointer_required | The LangGraph middleware ran without a checkpointer | No |
hitl.adapter_options | Invalid adapter options | No |
hitl.adapter_unsupported | (TypeScript, OpenAI Agents) A tool cannot be bound to the arguments it will execute with this SDK version | No |
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 instead | No |
hitl.scope_required | The OpenAI Agents, Vercel AI SDK or Pydantic AI adapter got no scope or action hook | No |
hitl.ticket_ambiguous | (Claude Agent SDK) Identical calls from several sessions wait on an unbound tool server | No |
hitl.too_many_interruptions | An OpenAI Agents run kept pausing for approvals | No |
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.
| Code | Where | When |
|---|---|---|
hitl.receipt_lost | on_error | The executed receipt could not be written after retries |
hitl.hook_failed | on_error | An on_decided hook still failed after its retries |
hitl.history_lost | on_error, events | Invariant history for an action was lost after retries; its scopes are tainted |
hitl.execution_lost | on_error, settle result | This process no longer holds the execution it tries to settle (changed: false) |
hitl.unsettled | executed receipt error_type | sweep() settled an execution nobody settled before the lease and reservation TTL |
hitl.args_mismatch | on_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_timeout | Hook deny reason | (Claude Agent SDK) No decision arrived before the hook's bounded wait, so the call was denied |
Core codes
| Code | When |
|---|---|
core.tool_args_invalid | A 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:
| Issue | When |
|---|---|
shared_secret_quorum | A quorum above 1 routed to a webhook channel, which counts as one person |
overlay_on_timeout_allow | A tenant overlay sets on_timeout: allow (overlays may only tighten) |
overlay_default | A tenant overlay sets a default |
reviewer_required | members: { permission } with no reviewer on the gate |
invariant_not_enforceable | An 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.
| Finding | Level | When |
|---|---|---|
approver_unreachable | error | An ask whose approver has no reachable channel |
shared_secret_quorum | error | As above |
default_allow | warning | default: allow |
member_channel | error | A members entry whose identity prefix is not the approver's channel (auto: entries excepted) |
open_approver | warning | An approver with no members: anyone who can answer on its channel counts as it |
model_routed_approver | warning | An 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_timeout | warning | on_timeout: allow on a rule or approver |
allow_shadowed | warning | An allow rule a deny rule fully covers |
tool_uncovered | warning | With --tools: a tool no rule mentions |
dead_path | error on deny / ask, warning on allow | With --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 |