Documentation

Security and limits

This page says what Countersign sends, what it stores, what it can and cannot show, and what is not built.

Where your data goes

A workspace on your own machine. The engine listens on 127.0.0.1 only. The ledger, the keys and the log stay under ~/.countersign. Nothing your agent does is sent anywhere. Two things do reach the hosted service. A receipt you choose to publish with countersign share is uploaded to it: see Evidence and offline verification. And countersign version and countersign update ask it whether there is a newer build. countersign version --offline skips that.

A hosted workspace. Each ask is sent to the hosted engine at https://app.trycountersign.ai, which decides it and stores the ledger.

What is sent to the engine

Every ask carries the same fields, whichever integration sends it.

SentNotes
Workspace id, passport id, request id
Tool nameFor example Bash or payments.send.
TargetA file path, a URL or whatever your code sets. May be empty.
A SHA-256 hash of the argumentsThe arguments themselves are not sent.
Facts (attrs)See below. These are what policy can read.
Cost and currencyWhen the caller sets them.
Session id and the caller's clock time
The agent's signature

After an allowed action, an outcome report sends ok or error and a hash of the result.

Never sent: the action's full arguments, file contents, command output, the agent's private key, the owner's private key.

Everything that is sent is written to the ledger and stays there. There is no route for deleting one ledger entry. The owner of a hosted workspace can delete the whole workspace in Settings, which removes its ledger and everything else held for it. Backups keep a copy for a while longer: see Backups.

Facts sent by the hook

By default (--facts full):

  • kind: the kind of action, such as shell or read
  • app: which agent sent it
  • user: the operating system account the agent runs under
  • host: the machine's short name
  • cwd: the working directory
  • command: the shell command, first 1,000 characters
  • program: the name of the program the command runs. Settings typed in front of the program (NAME=value) are passed over and are never the program name
  • file_path: the file path, for file tools
  • url: the URL, for web tools
  • mcp_server: the MCP server name, for MCP tools
  • mode: monitor, when the hook is recording only
  • stops: revoked, when a recording-only hook stops the tool once its passport is revoked
  • secret, secret_in, secret_repeat: only when the hook saw a key or token. The kinds found and where, never the value. See Secret exposure alerts.

For Codex's apply_patch tool the patch text is file contents, so it is not sent. The file the patch names is sent as file_path.

When the hook is also on the agent's prompt event, a prompt that holds a key or token is reported with the tool name prompt and the facts kind, app, user, host, cwd and the three secret facts. The prompt's text is not sent. A prompt with no key or token in it is not reported.

Minimal-facts mode

Add --facts minimal to the hook command to send less.

countersign hook --agent NAME --facts minimal

The hook then sends only:

  • kind
  • app
  • user and host
  • program: the program name, with no arguments and with no NAME=value setting typed in front of it
  • mcp_server
  • mode
  • secret, secret_in, secret_repeat, when a key or token was seen

No command, no file path, no URL, no working directory and no target are sent. The tool name and the hash of the arguments are still sent.

What you give up:

  • Rules that read the command, the path, the URL or the target never match.
  • The guard cannot match anything, so nothing is blocked or flagged by it. Rules on the kind of secret still work.
  • The log and the digest show the tool and the program name only.

In a fleet rollout, choose "Only the kind of action" when you build the script. The hook that countersign start installs uses full facts. To change it, edit the hook command in the agent's settings file.

Facts sent by the framework adapters

app, kind, and each top-level argument of the tool call that is text, a number or true/false, as arg.<name>, cut to 500 characters, with credential-shaped values blanked. Nested arguments are not sent. With facts set to minimal, no argument is sent. The Claude Agent SDK adapter sends what the hook sends and never the arg.<name> facts.

Facts sent by the endpoint guard

The same as the framework adapters, with app set to express or fastapi. The arguments are the request's body fields and its query and path parameters. Request headers are never sent.

What says which integration sent an ask

Every hook, adapter and gateway adds an app fact, and a platform fact when you name one. They are part of the signed ask, they can be read by policy, and the Integrations page is built from them. They are what the agent's side says about itself: an agent's own code could send a different app. They show what is connected. They are not proof of which program sent an ask. The proof of who asked is the agent's signature.

What says who ran an action

The hook and the MCP gateways add a user fact (the operating system account) and a host fact (the machine's short name) to every ask. The ledger's Who column is built from them, and policy can read them. They are what the machine says about itself, under the agent's signature: someone with control of the machine could report a different name. They are not a verified sign-in. The SDKs and the framework adapters do not send them unless your code passes them as attrs.

Entries recorded before 25 November 2026 do not carry them. For those the console shows the name from the passport when it has the form account@machine, and "Not recorded" otherwise.

Facts sent by the MCP gateway

mcp_server, host, and each top-level argument of the tool call that is text, a number or true/false, as arg.<name>, cut to 500 characters. Also risk, risk_source, tool_hash and tool_changed: the grade the gateway gives the tool from the server's own hints, a short hash of the tool's definition, and a flag when that definition has changed. The definition itself is not sent. See Tool risk in the MCP gateway. Nested arguments are not sent. The gateway has no minimal mode. The gateway on the same machine also sends user. The remote gateway is a service shared by many callers, so it sends host and no user. It never sends the caller's sign-in headers or the MCP session id. The session is recorded as a hash.

Facts sent by the SDKs

Only what your code passes as target, attrs and cost.

Secret redaction

The hook replaces text that looks like a credential with a marker before the ask is signed and sent. The engine, the policy and the ledger see the marker.

curl -H "Authorization: [redacted: a bearer token]" https://api.example.com/v1/items

The shapes it knows:

ShapeMarker
A PEM private key, from its BEGIN line to its END linea private key
An AWS access key idan AWS access key
A GitHub tokena GitHub token
Keys starting sk-, Stripe keys starting sk_live_, sk_test_, rk_live_ or rk_test_, Slack tokens starting xox, Google keys starting AIza, npm tokens starting npm_, GitLab tokens starting glpat-an API key
A Slack, Discord or Microsoft Teams webhook addressa webhook address
Bearer followed by a long tokena bearer token
A JSON web tokena signed web token
A user name and password inside a URLa password in a URL
NAME=value or NAME: value where the name contains api_key, secret, token, passwd, password or autha secret assigned on the command line

The hash of the arguments is taken from the real arguments, so the entry is still bound to what actually ran.

Limits of redaction:

  • It is a pattern check. It will miss a secret in a shape it does not know.
  • It covers the hook's command and url facts only. File paths are not redacted.
  • A private key is blanked up to its END line, or as far as the text looks like key material. An encrypted key in the older format has header lines between BEGIN and the body, and the blanking stops at those.
  • The MCP gateway redacts argument values with the same pattern check. It has no minimal-facts mode.
  • The SDKs and countersign ask do not redact. Do not put secrets in target or attrs.

Publishing has its own check. countersign share and the console refuse to publish a receipt whose target or facts match any of the shapes above. That check has the same limit.

What the hosted service stores about your account

For a console account, the server stores:

  • your name and email
  • a salted hash of a secret your browser derives from your password
  • an encrypted copy of your signing key that only your password opens
  • when you have a recovery code: a salted hash of a secret derived from the code, and a second encrypted copy of the signing key that only the code opens
  • for each passkey you add: its id, the name you gave it, when you added it, and another encrypted copy of the signing key that only that passkey opens. An account can have up to 10 passkeys, and you can remove one in Settings.
  • your role in the workspace, and which plan the workspace is on
  • hashes of session tokens, and for each session when it began, the hour it was last used and the kind of browser, such as "Chrome on macOS". The browser's version and your network address are not kept with it.
  • whether your email address is confirmed and when, which version of the Terms you accepted and when, and which optional email you have turned off
  • a hash of the workspace's API key

The password and the recovery code are never sent. The browser derives the secrets with PBKDF2 (SHA-256, 310,000 rounds) and encrypts the key with AES-GCM. The server cannot read your signing key.

A passkey opens the key and does not sign you in. The browser asks the passkey for a secret only it can produce (the WebAuthn PRF extension), and encrypts a copy of the signing key under a key made from that secret with HKDF-SHA-256. The secret never leaves the browser, and the server checks nothing the passkey says. A session alone can store a passkey's copy, because making a copy that opens anything needs the signing key itself.

Signing in with Google or Microsoft

You can connect a Google account or a Microsoft account and use it to sign in. The service asks the provider for three things: your account id with that provider, your email address and your name. Google also sends your Google Workspace organisation's domain, if you have one. Microsoft also sends the id of your organisation's directory, if the account is a work or school one.

The server stores the account id, the email address and the organisation domain or directory id, so that it recognises the same account next time and can show the workspace's team which sign-in method is connected. The first time you sign in this way with no workspace, one is made for you from that name and email address.

The service reads no mail, calendar, contacts, files or other Google or Microsoft data. Disconnecting a sign-in method in Settings deletes the stored account id.

Email addresses and the mail we send

The hosted service mails a new account a link, and the address counts as confirmed once the link is followed. Signing in with Google or Microsoft as that address, or joining through an invitation mailed to it, confirms it as well.

  • An unconfirmed account does not hold its address. Anyone can type any address into sign-up. If another account confirms the address, that account has it. The first is set aside: it keeps its workspace and can never confirm that address.
  • Sign-up does not say whether an address is in use. The answer is the same either way. The difference is in the mail, which only the person who reads that inbox sees.
  • An unconfirmed workspace cannot reach other people or pay. It cannot invite anyone, connect alerts, publish a receipt or change plan. It records and decides as normal.
  • Links. A confirmation link works once, for 24 hours. An invitation works once, for 7 days. The service stores a hash of each code, not the code. The code travels in the part of the address after #, which the browser does not send to the server when it loads the page, and the console removes it from the address bar.
  • Caps. One address gets at most five confirmation mails a day, whoever asks. One workspace can mail 50 invitations a day and gets one "waiting for approval" mail every ten minutes at most.
  • What a sent mail leaves behind. Mail waits in a queue until it is sent. Once it is sent, the queue keeps that it was sent and deletes the content, links included. The rest of the row is deleted 7 days after the mail was written. A mail that could not be sent is kept whole until the same 7 days are up.
  • What an invitation stores. The address it was mailed to and the name of the person who sent it, until it is used or runs out.
  • Who carries it. Mail is sent through Resend. It sees the recipient's address and the content of each message. A "waiting for approval" mail contains the agent's name, the tool and up to 300 characters of the target, after secret blanking.

Mail written to support@, security@, privacy@ and [email protected] is received by Resend and forwarded to the person who runs the service. A copy stays in Resend's account.

An engine you run yourself sends no customer email, and there an account counts as confirmed when it is made.

Sessions

A sign-in lasts 30 days. Settings lists every browser signed in to your account and can end any of them. Changing the password, or setting a new one with the recovery code, ends every other session of the account.

When the password and the recovery code are both lost

Nobody can open the signing key. The operator can release the email address so that it can be used again, and nothing else. The release is a link mailed to the address itself, so it takes someone who can read that inbox. It removes the account and, for an owner, cancels the subscription. The ledger is kept.

A session lasts 30 days, or until you sign out. The server holds a hash of the session token and deletes sessions that have run out once a day. After 10 wrong passwords or recovery codes for one email in 15 minutes, sign-in for that email is locked until the 15 minutes are up.

For a paid plan on the hosted service, the server stores the customer id and subscription id that Stripe gives back. Card details go to Stripe and never reach the service.

The console is served with a content security policy that loads script only from its own origin, and it cannot be framed by another site.

What the console keeps in your browser

The console sets no cookies. It keeps four things in the browser's storage:

  • the session token and the account details it shows
  • the signing key, as a key the browser will sign with and will not hand back to any script
  • small conveniences: the theme, how some pages were left, and the tokens of rollouts made in that browser, so their install scripts can be shown again
  • the recovery code, in the one tab that shows it, so that a reload does not lose it. It is removed when you say you have saved it, when you sign out, or when the tab closes.

Signing out ends the session and leaves the signing key in that browser. The key is used only for the account it belongs to and is removed when a different account signs in there. "Sign out and forget key" removes it. Someone who can use your browser profile while you are signed in can sign with your key.

Slack addresses and the Slack approver key

When you connect a Slack channel, the server stores the channel's incoming-webhook address. It is stored encrypted, under a key made from a secret that is kept apart from the database. A copy of the database alone does not give the address away.

When you switch on approving from Slack, the service holds a key to sign those approvals. That key is not stored. It is made each time from the same secret and a random value kept in the database.

Both still rest on the service: whoever runs it can post to the channel and can sign with that key. See Approvals.

What the hosted service writes to its log

One line for each request: which route was called, the workspace id once the caller has proved it, the HTTP status and how long it took. One line for each database statement that failed, without the values in it.

The log never holds a request or response body, a query string, an API key, a session token or a webhook address. For a route with an id in it, such as a passport id, the line holds the route's pattern and not the id.

An engine on your own machine logs only what failed, to ~/.countersign/local/engine.log.

Request counts

So that sign-up, sign-in, asks and publishing cannot be flooded, the service counts requests by network address. Most of these counts are held in memory for a short time. For sign-up, sign-in and publishing the count is also written to the database against the address, for a window of an hour at most, and old counts are deleted as new ones are written.

The count of wrong passwords and recovery codes is kept against a hash of the email address. The limits on email are counted the same way: against a hash of the address for confirmation mail, and against the workspace for invitations and approval mail.

What the people who run the service are told

So that a person can help customers, the team that runs the hosted service is sent a message when an account is made, when a workspace starts paying or passes its allowance, when a request to the service fails, and when you write to us. A message carries the workspace name and plan, the name and email address on the account and, when you write to us, what you wrote.

The canary workspace

The hosted service is checked from outside every few minutes, with a workspace of its own that holds no customer data. Whether the service is up is shown at https://status.trycountersign.ai.

Backups

The hosted database can be put back to any moment in the last 7 days. A full backup is also taken each night. It is encrypted and kept for 30 days.

A backup alone cannot sign a decision or open a Slack address: it does not hold the secret that the engine's keys are made from.

After a workspace is deleted the service keeps one line about it: the workspace's id, which is a random string, the time it was deleted, and whether a subscription was stopped with it. It holds no name, no address and nothing that was recorded.

Deleting a workspace or removing a member does not reach backups already taken. The data can stay in them for up to 30 days.

What is deleted without you asking

  • Sessions, 30 days after they start.
  • Invitations, one-time links and half-finished connections to Google, Microsoft or Slack, when they run out.
  • Slack alerts waiting to be sent, 7 days after they were written.
  • A call kept on a machine while the engine was unreachable, after 14 days if it was never handed in.
  • A Free workspace that was never used, after 30 days: see Other limits.

Ledger entries are never deleted while the workspace exists.

The algorithms

Each of these is a published standard. None is our own design.

Used forAlgorithm
Every hash in a ledger, and the hash of an action's argumentsSHA-256 (FIPS 180-4)
The tree that commits to a whole ledgerThe Merkle tree of RFC 6962 section 2.1, with SHA-256
Every signature: the engine's, an agent's, a person'sEd25519 (RFC 8032)
The bytes that are hashed and signedDeterministic CBOR (RFC 8949)
The engine's keys, each made from one root secretHKDF with SHA-256 (RFC 5869)
Values the service stores sealed, such as Slack addressesAES-256-GCM
Your signing key, as stored for youAES-GCM under a key your browser derives with PBKDF2 (SHA-256, 310,000 rounds)

Builds before 2026.11.27.3 used BLAKE3 where SHA-256 is used now. A ledger or evidence pack from one of them is not read by a newer build. See Updating.

Who can do what

HolderCanCannot
The agent's credentialAsk under its passport. Report outcomes.Anything else.
The owner's signing keyIssue, amend and revoke passports. Activate policy. Create rollouts. Approve held actions.
The workspace API key, or a console sessionRead the ledger, passports, policy and waiting approvals. Export. Publish a receipt and take it down. Run a coverage check. Revoke a passport. Close a rollout. Turn ANS support on or off. Replace the API key.Issue or amend a passport, activate policy, create a rollout or approve an action. Each of these must carry the owner's signature, which the engine checks.
The owner in person: the owner's console session, or the API key with the owner's signature on the requestChange the plan. Buy or remove action packs. Open the billing page. Delete the workspace.
A fleet enrolment tokenIssue passports with exactly the terms the owner signed, up to the machine limit, while the rollout is open.Widen the terms.

Two points in this table are worth care.

Revoking needs no signature. The API key alone can revoke a passport or close a rollout. The console calls this the kill switch. It lets an operator stop an agent without the signing key. The ledger records whether a revocation carried the owner's signature.

A browser opened with countersign open is a console session. It holds no signing key, and the console shows it as view-only. The API treats that session as a reader. It can read what an admin reads, and publish or take down a receipt link. It cannot revoke a passport, replace the API key, change the plan or change any setting. The one-time link works once and expires after five minutes.

What someone with access to the machine can still do

Countersign does not sandbox the agent. A coding agent runs as your user and can read and change the files you can.

On a personal machine, you or a process running as you can:

  • remove the hook with countersign stop or by editing the agent's settings file
  • switch to recording only with countersign guard off, by editing the credential file, or by adding --mode monitor to the hook command
  • read ~/.countersign/config.json, which holds the owner's signing key and the API key
  • read the agent's credential and ask under its passport from another program
  • delete ~/.countersign, including the ledger

For a workspace on your own machine, you also hold the engine's key (in ~/.countersign/local). You could build a different ledger and sign it. A ledger kept on your own machine is your own record. It shows that the record has not been changed since it was written only to someone who trusts the keeper, or who holds an earlier receipt or head from it.

In a fleet rollout, the hook file sits in a system location that ordinary users cannot edit. Someone with admin rights on their own machine can still remove it. Three things catch an agent that goes around the gate:

  • a tool-side comparison (Coverage)
  • the list of agents that have gone quiet
  • receipt checks, where the service the agent calls refuses requests without a ticket

See Fleet rollout and Coverage and Receipt checks.

What a receipt does and does not show

  • A receipt says what was asked for and what was decided. Whether the action then did what it said is the agent's own report.
  • Times are the engine's clock, taken on trust. The time inside an ask is the caller's clock.
  • Decisions are signed by a software key.
  • Ledger heads are signed and are not published anywhere public. A ledger rolled back to an earlier state is detectable only by someone who kept a later head or receipt.
  • The ledger holds what was asked. An action taken without asking is not in it.

What is not built

Not builtWhat exists today
A signer inside attested hardwareDecisions are signed by a key held in software. Every ledger says so in its first entry.
Public anchoring of the ledgerLedger heads are signed by the engine and are not published to any public log.
Approving from inside an email or a chat message, signed by the personA held action can be posted to a Slack channel and mailed to the people who can approve it, each with a link to the console. See Team, alerts and replay. An email has no approve button. An owner can switch on approving from the Slack message. Those approvals are signed by a key the service holds, not by the person who pressed the button, so they are weaker proof than an approval made in the console or the CLI. See Approvals.
Getting a lost signing key backThe key opens with the password, the recovery code or a passkey. With none of them it is gone, for an owner and for a member. Nobody at Countersign can reset or replace it.
An independent check on outcomesAn outcome is the agent's own word.
Local verification of the ANS log's signed answerThe counterparty lookup trusts the log's answer over TLS.
An account for a command-line workspaceA workspace made with countersign start has no password. countersign email gives it an address for mail, and that is not a way to sign in. If the machine is lost, so are its keys.
Changing an account's email addressAn account keeps the address it was made with.
A second sign-in stepSign-in is a password, or a Google or Microsoft account. There is no one-time code step.

The console's plan page and Settings describe a signer in attested hardware and public anchoring as part of one plan. Neither exists today on any plan.

Other limits

  • Hooks. The Claude Code, Codex, Gemini CLI, Cursor, Grok CLI and Hermes Agent hooks have been run in live sessions. Grok CLI runs a hook in a user's own settings only in a folder that user has trusted, and Hermes Agent runs a hook only once its user has approved it. The OpenClaw plugin has been run with OpenClaw 2026.11.12 in turns started at a terminal, and not with a gateway or a chat. OpenClaw's agent exec does not load it unless given --state-dir. The Copilot CLI hook was tested against that tool's documented payloads.
  • The guard matches text. See Guard.
  • When the engine cannot be reached. A hook you connected yourself lets the agent carry on, keeps each call on the machine and hands it in when the engine answers, where it is recorded as having run while the engine was unreachable. Until then those calls are on that machine only, and someone with access to the machine can delete them before they are handed in. A fleet rollout's hook stops the agent instead. See Guard.
  • Passports expire. A passport made in the console lasts 1 year unless you choose 90 or 30 days. The owner is told in the workspace's Slack channel 14 days and 3 days before one runs out, the Agents page lists it for a month before, and countersign doctor warns from 30 days out. The passport that countersign start creates lasts 365 days. After that the engine refuses the agent's asks. In recording-only mode the agent is not held up: each call is recorded as refused and shown as "Ran anyway", and the person at the terminal is told once in each session. With the guard on, every tool call is blocked. Extend the passport with countersign agent amend claude-code --ttl 8760h.
  • Single-use tickets are per process. See Receipt checks.
  • Rate limits. The engine limits requests per caller address on the routes that need no credential, such as sign-up, sign-in, asks and publishing. It also limits how fast one workspace may ask, how many workspaces are made in an hour, and how many failed sign-ins one email may have. A caller over a limit gets HTTP status 429. See API reference.
  • The monthly action allowance. Free includes 2,500 recorded actions a month. Pro includes 25,000, plus 25,000 for each of up to three action packs. Team includes 100,000, plus 100,000 for each action pack. On a paid plan going over never stops anything. On Free, on the hosted service, recording stops for the rest of the month once a workspace has recorded twice its allowance (5,000): the engine then refuses new asks without recording them, and says so. One kind of ask is still answered and recorded past the stop: an ask under a revoked passport, so that Revoke reaches the agent whatever the count. And the rules do not stop with the recording: a hook from build 2026.11.29.2 on is told what the policy decides, marked as not recorded, and an enforcing hook acts on it. The Plan page says how many actions went unrecorded in the month. It does not say what they were: nothing about them is kept. What the agent does next depends on its hook. A hook that fails closed blocks the action. A hook that fails open, or only records, lets it through unrecorded, and tells the person at the terminal once in each session that Countersign is not recording, with the day recording starts again. Those actions are not recorded later. A workspace that countersign start keeps on your own machine has no allowance and never stops.
  • Size limits. An ask, a policy and a published receipt each have a largest size. See API reference.
  • Alerts are sent after the answer. An alert to Slack is stored with the decision it is about and sent once the agent's answer has been written. If Slack does not take it, it is tried again, five times at most over about fifteen minutes, and Settings shows that the last alert failed.
  • Workspaces that are never used are removed. A workspace on the Free plan that is 30 days old, has never issued a passport or opened a rollout, has no member besides its owner, has never had a card and has recorded no action is deleted, with its account. A workspace that has done any one of those is kept.