Documentation

Fleet rollout and Coverage

A hook on one machine covers one agent. This page covers two further jobs:

  • Fleet rollout puts a hook on many machines, in a place ordinary users cannot edit, and gives each machine its own passport.
  • Coverage looks for actions that happened without a receipt.

Fleet rollout

How it works

  1. The owner signs the terms of a rollout once. The terms are the same fields as a passport: tools, tools that always need a human, how long each passport lasts. The rollout also sets how many machines may join and until when.
  2. The rollout has its own key, the enrolment key. It is packed into a token together with the engine's address and the rollout id.
  3. An administrator runs one script on each machine. The script installs the CLI, the token and a hook file for each agent.
  4. The first time a user's agent uses a tool, the hook finds no credential. It creates an agent key on that machine, writes a passport with the rollout's terms, signs it with the enrolment key and sends it to the engine. The key never leaves the machine.
  5. The engine checks the passport and records it. From then on the machine asks like any other agent.

The engine accepts a self-issued passport only when all of these hold:

  • its terms are exactly the ones the owner signed
  • the rollout is still open and has not been closed
  • the rollout is under its machine limit
  • the passport does not last longer than the rollout allows
  • it is signed by the rollout's enrolment key

So the token can only issue passports with the terms you signed. It cannot widen them.

Each passport is named after the user and the machine, for example ada@laptop. The credential is saved as ~/.countersign/agents/device.json in that user's home folder. Each user account on a machine enrols separately and counts as one machine.

Create a rollout in the console

  1. Open Rollouts and choose New rollout.
  2. Fill in the terms:

| Field | Meaning | |---|---| | Name | A name for the rollout. | | Tools each machine may use | * lets policy rules do the deciding. Tool names differ between agents, so * with rules on the kind of action is the simplest start. | | Always ask a human for | Optional tool names. | | Each passport lasts | 30 days, 90 days or 1 year. | | Machine limit | How many machines may enrol. 0 means no limit. | | Enrolment open for (days) | How long new machines may join. | | Granted under | Optional. The policy or agreement the delegation sits under. |

  1. Choose Sign and create. Your browser signs the terms with your key.
  2. In the rollout's panel, under Rollout script:
    • pick the agents to cover: Claude Code, Codex, Gemini CLI, Cursor, Grok CLI, Copilot CLI
    • pick what policy can read: "Commands, paths and URLs" or "Only the kind of action" (see Security and limits)
    • optionally switch on "Also block hooks users add themselves (Claude Code, Codex, Grok CLI)"
  3. Choose Download rollout script. The file is countersign-rollout.sh.

The token is kept in the browser that created the rollout. It is not stored on the server. From another browser the console cannot rebuild the script. Create a new rollout to get a fresh one.

What the script does

Run the script as root on each machine, by hand or through device management. It:

  1. downloads the CLI to /usr/local/bin/countersign
  2. writes the token to /etc/countersign/enroll.token
  3. writes a hook file for each chosen agent to that agent's system-wide location
  4. keeps a copy of any file it replaces, with .before-countersign added to the name. The copy is made once, so running the script again leaves it as it is.

The script checks the download against its published SHA-256 before it installs anything. If they differ it stops and installs nothing.

The hook command it installs is:

/usr/local/bin/countersign hook --agent device --format <agent>

With "Only the kind of action" chosen, --facts minimal is added. The hook enforces and fails closed: if the engine cannot be reached, the tool is blocked.

Where the hook files go:

AgentmacOSLinux
Claude Code/Library/Application Support/ClaudeCode/managed-settings.json/etc/claude-code/managed-settings.json
Codex/etc/codex/requirements.toml/etc/codex/requirements.toml
Gemini CLI/Library/Application Support/GeminiCli/settings.json/etc/gemini-cli/settings.json
Cursor/Library/Application Support/Cursor/hooks.json/etc/cursor/hooks.json
Grok CLI/etc/grok/managed_config.toml/etc/grok/managed_config.toml
Copilot CLI/etc/github-copilot/policy.d/countersign.json/etc/github-copilot/policy.d/countersign.json

"Also block hooks users add themselves" adds allowManagedHooksOnly: true to the Claude Code file and allow_managed_hooks_only = true to the Codex file and the Grok CLI file.

The Grok CLI file is its managed configuration, and the script writes the whole file. If your organisation already ships a /etc/grok/managed_config.toml, add the hook tables to that file yourself and leave Grok CLI out of the script. Grok runs hooks from /etc/grok in every folder, trusted or not, and a user cannot switch them off.

Create a rollout from the command line

countersign fleet add --name "Engineering laptops" --tools '*' --days 90 --max 50
enrolment  en_3b1f...
token      eyJzZXJ2ZXIi...

Put the token in /etc/countersign/enroll.token on each machine (or run `countersign enroll --token ...`).
It can only issue passports with these terms, to at most 50 machines, until 20 Dec 2026.

The command line prints the token. It does not write a script. You install the CLI and the hook files yourself.

A machine finds its token in this order: the COUNTERSIGN_ENROLL_TOKEN environment variable, ~/.countersign/enroll.token, then /etc/countersign/enroll.token.

To enrol a machine at once, without waiting for the first tool call:

countersign enroll                 # uses the token installed on this machine
countersign enroll --token TOKEN   # or give it directly

Other commands:

countersign fleet list             # each rollout, its state and how many machines enrolled
countersign fleet close EN_ID      # stop new machines joining

Close a rollout

Closing stops new machines from enrolling. Machines already enrolled keep their passports until those are revoked or expire. In the console, open the rollout and choose Close enrolment.

To stop one machine, revoke its passport on the Agents page or with countersign agent revoke.

When a machine's passport expires

A self-issued passport lasts for the number of days the rollout sets. After that the engine refuses the machine's asks, and an enforcing hook blocks every tool call. The machine does not enrol again by itself, because it still holds its old credential.

To renew, extend the passport: Renew on the Agents page, or countersign agent amend NAME --ttl 2160h.

Updating the machines in a rollout

Run the rollout script again as root. It installs the current build and changes nothing else. A user cannot update a managed machine: countersign update stops and says the program was installed by the organisation. See Updating.

What has not been verified

  • The rollout script has been run as root on clean Linux machines, on both processor types. It has not been run on macOS, where the hook files go to other paths.
  • On those Linux machines the agent was stood in for by Claude Code's documented hook payload. No real agent session has been run against a hook file in a system location.
  • The macOS system path for Gemini CLI is unconfirmed. The Linux path is from its documentation.
  • In a single user's own settings, the Claude Code and Codex hooks have been run in live sessions. The Gemini CLI, Cursor and Copilot CLI hooks were tested against the tools' documented payloads.
  • The Grok CLI file was read by Grok CLI 1.0.92 from a settings folder of its own, which listed the four hooks as managed and the switch as on. It has not been run from /etc/grok on a managed machine.

Limits to know

  • The token file is readable by every user on the machine. Anyone who can read it can enrol further machines, with the terms you signed, until the rollout closes or reaches its limit. Treat the token like a password and set a machine limit.
  • A hook file in a system location stops ordinary users from removing the hook. Someone with admin rights on their own machine can still remove it. Coverage and receipt checks are how you detect that.
  • A self-issued passport cannot be bound to an Agent Name Service identity.
  • The workspace plan's agent allowance applies to enrolled machines too.

Coverage

The ledger holds every action that was asked for. Coverage is about actions that were not asked for: a hook was removed, a second credential was used, or a person acted directly.

The console's Coverage page gives three ways to find and close that gap.

1. Compare against what your tools saw

Take the activity log of a tool the agent uses, such as a payment processor's event list, an audit log or a database log. Give Countersign the actions it shows. Each one is matched to an allowed action in the ledger. Anything left over happened without a receipt.

In the console, paste one action per line: time, tool, target, and optionally who.

2026-11-12T21:38:52Z, payments.send, vendor/northwind, treasury-bot
2026-11-12T21:41:07Z, payments.send, vendor/unknown-7

The time can be an ISO date and time or a Unix time in seconds or milliseconds. A line can also be a JSON object with at (or time or timestamp), tool, target and actor. Choose the matching window (5 minutes, 10 minutes or 1 hour) and press Check coverage.

From a script:

curl -s https://app.trycountersign.ai/v1/coverage/check \
  -H "Authorization: Bearer $COUNTERSIGN_API_KEY" \
  -d '{"window_seconds":600,"observations":[{"at":1794520000,"tool":"payments.send","target":"vendor/northwind"}]}'

The answer has total, covered, uncovered (the list of unmatched actions) and window_seconds.

How matching works:

  • An observation matches an allowed action with the same tool name.
  • If the observation names a target, the target must be the same.
  • The allowed action must have been decided within the window before or after the observation's time. The default window is 600 seconds.
  • Each allowed action accounts for one observation. When several qualify, the nearest in time is used.
  • One check takes at most 50,000 observations.

Limits:

  • Tool names and targets in the other system's log must be written the same way the agent writes them when it asks. You may need to map them first.
  • The check runs when you run it. It does not watch a log continuously.

2. Agents that have gone quiet

An agent that used to ask and has stopped may have had its hook removed. The Coverage page lists active passports whose last ask was more than seven days ago. The Rollouts page shows the same count per rollout as "silent for 7+ days".

This is a hint. A machine that was switched off looks the same.

3. Make the tool demand a receipt

This is the strongest of the three. Every allowed action comes with a short-lived ticket signed by the engine. Put a check in front of the service the agent calls, and the service refuses any request that does not carry a valid ticket. An agent that skipped the gate has no ticket.

See Receipt checks.