Approvals
Some actions should wait for a person. Countersign calls this "ask a human". The API calls it escalate. The console labels it "Needs approval".
When an action is held
An action is held in three cases.
- A policy rule with the effect
escalatematches it. - Its tool is in the passport's "always ask a human" list (
escalate). - Its cost is over the passport's approval threshold (
escalate_over).
A blocked action is never held. An approval cannot override a block.
What happens, step by step
- The agent asks. The engine answers
escalate. The entryaction_escalatedis written to the ledger. The action does not run. - The agent is told to wait. A hook stops the tool and gives the agent this message:
``text Countersign: this action needs a human approval (<reason>). Recorded as event 57. Ask the user to approve request rq_... in Countersign, then retry the same action unchanged. ``
- The owner approves. The owner signs an approval for that exact action. The entry
approvalis written to the ledger. - The agent asks again. This is the re-attempt. The new ask names the held request as its parent. The engine checks the link and answers
allow. The entryaction_allowedis written, marked as approved. - The action runs.
The engine cannot run the action for the agent. Nothing happens after an approval until the agent asks again.
By default nothing tells the agent that you have decided. You go back to it and say "try again". An agent can listen for your decision instead and carry on by itself: see Listening for the decision.
The first entry stays in the ledger unchanged. The record shows the hold, the approval and the allowed re-attempt as three separate entries.
How to approve
Only the owner's signing key can approve. There are no approval alerts by email or chat. A held action waits until you look.
In the console
Open Approvals. Each waiting action shows the agent, the tool, the target, the facts and any cost. Press Approve. Your browser signs the approval. You can also approve from the receipt on the Activity page.
From the command line
countersign pending
rq_5f0c... seq 57 coding-agent asks Bash (prod-deploy-needs-human)
command: ./deploy --prod v41
kind: shell
countersign approve rq_5f0c... --note "release 41, agreed with Dana"
approved rq_5f0c.... The agent must ask again: the approval covers exactly this action, once.
--note is optional. It is recorded with the approval.
From Slack
A workspace with Slack alerts can also approve from the alert itself. The owner switches this on. It is off by default.
- In the console, open Settings, Alerts. Under Approve from Slack choose Turn on and sign.
- Ask each person who should approve to press Approve on an alert in Slack once. They are refused and nothing is approved. Their name then shows in Settings under Pressed Approve and were refused.
- The owner chooses Allow next to each person who should be able to approve.
From then on a named person presses Approve in Slack, confirms, and the message changes to say who approved and the receipt number. Anyone else who presses the button is refused. The agent must still ask again, as with any approval.
The other button, Open in Countersign, opens that one request on the Approvals page, where you approve with your own key. It is there whether or not approving from Slack is on.
What a Slack approval proves
It is weaker proof than an approval made in the console, and the receipt says so.
- An approval in the console or the CLI is signed with the approver's own key, which the service never holds.
- A button pressed in Slack reaches the service and no browser, so there is no key of that person's to sign with. The service makes a separate key and keeps it. The owner signs that key into the ledger as an approver, under the name Slack approvals (key held by the service). When a named person presses Approve, the service signs the approval with it.
- The owner's signature shows the owner chose to accept approvals made this way. The approval's signature shows the service made it. That a particular person pressed the button is the service's word, taken from a request Slack signed. It is not that person's signature, and whoever runs the service could make such an approval themselves.
- Each Slack approval records the person's Slack name, their Slack user id and the Slack workspace id in its note.
Turn off and sign withdraws the key under the owner's signature and deletes the service's copy. Approvals made with it before stay valid. Turning it on again makes a new key. The list of people is who may press the button; it is a setting held by the service, not a ledger entry.
Declining
A held action can be declined instead. In the console, Decline on the card asks for an optional reason and signs it. From the command line:
countersign decline REQUEST_ID --note "not to that recipient"
A decline is signed by the same people who may approve. It closes the action: it cannot be approved afterwards, and a retry that names it is refused. An agent that retries is told the request was declined, with your note. An agent that listens is told as soon as you decline. The share of held actions that people decline is the human override rate in the Controls report.
An action nobody answers stays held. It is counted as waiting, not as declined.
What an approval covers
An approval covers one exact action, once.
Exact. The approval is bound to a hash of the action's content: the workspace, the passport, the tool, the target, the hash of the arguments, every fact, the cost and the currency. If any of these differ in the re-attempt, the link does not hold.
Once. The first allowed re-attempt uses the approval up. A second re-attempt that names the same parent is refused.
For the same agent. The re-attempt must come under the same passport.
When the link does not hold, the engine refuses the ask with the reason invalid_attempt_link and records the refusal. This happens when:
- the agent retried before anyone approved
- the action changed between the hold and the re-attempt
- the approval was already used
- the parent named is not a held action of the same passport
When a passport is revoked, its held actions drop off the waiting list. Every later ask under that passport is refused.
Listening for the decision
After you approve, the agent has to ask again. An agent that listens does that by itself, as soon as you have decided.
Coding agents
Run this on the machine the agent runs on:
countersign listen 1h
The window can be anything from 1m to 24h. countersign listen off turns listening off. countersign listen with nothing after it shows what each agent is set to. countersign connect AGENT --wait 1h sets the window when you connect an agent. Restart the agent afterwards: a session that is already open keeps its old settings.
With a window set, this is what happens when an action is held.
- The hook stops the tool, as before. The agent is told to tell you which request is waiting and to end its turn:
``text Countersign: this action needs a human approval (<reason>). Recorded as event 57. Tell the user that request rq_... is waiting for approval in Countersign, then end your turn. Do not retry it yet and do not look for another way to do it. Countersign listens for the decision for 1 hour and will tell you to run the action again when it is approved. ``
- The hook listens as the turn ends. Every coding agent runs a hook at the end of a turn. That hook asks the engine how the request stands: every 2 seconds at first, every 30 seconds after an hour. The turn stays open while it listens.
- You approve. The agent is told to run the same action again, unchanged. It does. The hook links the action to your approval, as it always has, and the action runs.
- Or you decline. The agent is told the request was declined, with your note. Nothing runs.
- Or nobody decides inside the window. The turn ends and you are told the hook has stopped listening. The request is still waiting. Approve it later and tell the agent to try again.
The window starts when the action is held, not when the turn ends. If you go on to other work in the same session, each turn that ends inside the window listens again. After the window none does.
What to know before you rely on it:
- The session has to stay open. The listening happens inside the agent's own turn. Close the agent, or stop the turn yourself, and the listening ends. The request stays, and the approval still works when the agent runs the action again.
- The agent must send the same action. The approval covers exactly what was held. If the agent changes anything it is a new action, and it is held again.
- A late approval acts on things as they are then. The command is the one you approved. What it acts on may have changed in the hours between.
- Only an enforced agent is ever held. An agent in recording-only mode has nothing to listen for.
- Listening is not recorded. Asking how a request stands writes nothing to the ledger. The hold, the approval and the allowed re-attempt are recorded as before.
- The engine must be build 2026.11.29.4 or newer. With an older engine the hook says it cannot listen, and the turn ends.
- Each agent decides how long a hook may run.
listentells the agent to give this hook the window and one minute more. No agent's documentation states an upper limit. The longest wait run in a real session is in the table below.
How each agent listens, and what has been run in a real session of it:
| Agent | Listens in its | Run in a real session |
|---|---|---|
| Claude Code | Stop hook | Approved, declined, and a window that ran out, in claude -p sessions. One approval came 11 minutes after the hold. |
| Codex | Stop hook | The same four, in codex exec sessions. |
| Grok CLI | Stop hook | Approved, in a grok -p session. Grok lets a hook carry a turn on at most 8 times. |
| Cursor | stop hook | Approved, in the interactive command-line agent. cursor-agent -p does not run the stop hook, so nothing listens there and a held action waits for you, as before. The desktop app was not run. Cursor takes at most 5 follow-ups in a row from one hook. |
| Gemini CLI | AfterAgent hook | Not run. Written to Gemini CLI's documentation. |
| Copilot CLI | agentStop hook | Not run. Written to Copilot CLI's documentation. It lets a hook carry a turn on at most 8 times. |
| Hermes Agent | It cannot listen. Hermes runs a hook at the end of a turn only when the turn edited code, and gives a hook 5 minutes at most. A held action waits for you to say "try again". | |
| OpenClaw | It cannot listen. The plugin is told of tool calls only. A held action waits for you to say "try again". |
countersign listen says the same for each agent it finds. The scripts for the real sessions are in qa/listenlive, with what they showed.
MCP gateways
A gateway has no turn to listen in. With --wait it holds the call itself:
countersign mcp --agent NAME --wait 10m -- <server command>
countersign gateway --agent NAME --upstream https://server.example/mcp --wait 10m
A held call then stays open at the gateway. When you approve, it goes to the server in the same call. When you decline, the agent gets your decline as the tool's error. When nobody decides inside the window, the agent gets the same answer as with no --wait, and retries after the approval.
The agent's own time limit for a tool call still applies, and it is usually minutes, not hours. An agent that gives up while its call waits gets nothing sent on its behalf afterwards, even if you then approve: the approval is kept for when the agent sends the call again. Leave --wait off for a platform with a short time limit on tool calls.
SDKs and framework adapters
guard() takes wait, in seconds. See Node SDK and Python SDK below. The framework adapters and the route guards take the same option. Keep it below your framework's own time limit for a tool call: a call the framework has given up on still runs if it is approved while the guard waits.
From a script
countersign wait rq_5f0c... --agent coding-agent --for 1h
wait asks as the agent, with the agent's own credential, so it works on a machine that has no signing key and no API key. It exits 0 when the request is approved, 3 when it is declined and 4 when the time runs out.
The re-attempt, by integration
Hooks
The hook handles the link for you. It remembers each held action for 24 hours. When the agent runs the same action again, the hook adds the parent request id itself.
- If the owner has approved, the action is allowed and runs.
- If nobody has approved yet, the engine refuses the re-attempt and the agent gets this message:
``text Countersign: this action is waiting for a human approval (request rq_...). It has not been approved yet. Do not retry until the user confirms it is approved. ``
A re-attempt of a request you declined is answered with the decline and your note, and the hook forgets the action: sent again, it is a new request.
After 24 hours the hook forgets the held action. The same action then starts again as a new request and is held again.
The working directory is one of the facts the hook sends. The same command run from a different directory is a different action and needs its own approval.
MCP gateway
The gateway works the same way as the hook. It tells the agent to retry the same call unchanged once a human has approved. The remote gateway does the same and answers at once, so an agent platform with a short time limit on tool calls is not left waiting. With --wait either gateway holds the call open instead: see MCP gateways above.
Framework adapters
The adapters give the model the reason as the tool's result, with the request id. When the model calls the tool again with the same arguments, the adapter adds parent itself. The order the model writes the argument names in does not matter. The adapter remembers the held call in memory only, so keep one guard for the life of the program.
Node SDK
guard() throws CountersignBlocked when the action is held. The error has needsApproval set to true and requestId set to the held request. After the owner approves, call guard() again with the same tool, arguments and options, plus parent:
try {
await agent.guard('payments.send', body, send, { target: body.to, cost: body.amount, currency: 'USD' })
} catch (err) {
if (!err.needsApproval) throw err
// ...wait until the owner has approved err.requestId...
await agent.guard('payments.send', body, send,
{ target: body.to, cost: body.amount, currency: 'USD', parent: err.requestId })
}
Python SDK
guard() raises Blocked when the action is held. The exception has needs_approval set to true and request_id set to the held request. Re-attempt with parent:
try:
agent.guard("payments.send", body, send, target=body["to"], cost=body["amount"], currency="USD")
except Blocked as e:
if not e.needs_approval:
raise
# ...wait until the owner has approved e.request_id...
agent.guard("payments.send", body, send, target=body["to"], cost=body["amount"],
currency="USD", parent=e.request_id)
To have the SDK wait for you, pass wait, in seconds. guard() then asks the engine how the held request stands until a person has decided, and makes the re-attempt itself:
await agent.guard('payments.send', body, send, { target: body.to, cost: body.amount, currency: 'USD', wait: 3600 })
agent.guard("payments.send", body, send, target=body["to"], cost=body["amount"], currency="USD", wait=3600)
Approved in that time, the action runs. Declined, guard() throws with declined set and the person's note in note. Undecided, it throws as it does with no wait.
agent.held(requestId) (agent.held(request_id) in Python) asks once and answers waiting, approved, declined, used or revoked. agent.waitFor(requestId, { timeout }) (agent.wait_for(request_id, timeout=...)) asks until a person has decided. Both ask with the agent's own key and record nothing. An operator script can still list waiting actions with GET /v1/pending.
From the command line
countersign ask --agent coding-agent --tool Bash --attr kind=shell --attr "command=./deploy --prod v41" --parent rq_5f0c...
The tool, target, --args, every --attr, the cost and the currency must match the held ask.
Approvals in recording-only mode
In recording-only mode the hook never holds the agent. A rule that asks for a human is recorded as would ask and the action runs.
The engine does not treat these asks differently. They still appear in countersign pending and on the console's Approvals page, although nothing is waiting. Approving one has no effect on the agent.
Where to see the history
- The receipt for a held action in the console shows each step under "What happened": asked, sent to a human, approved by whom, retried and allowed as which receipt.
countersign log --allprintsapprovalentries with the approver and the note.- An allowed re-attempt is shown as "Allowed, approved" in the console's ledger. In
countersign logit is an ordinaryokline.