Countersign

v0.2.2
io.github.countersign-network/countersign Checked 2 days ago Published 3 months ago

Kill switch + spend guard for AI agents that spend money, across every wallet vendor at once.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

countersign_health

Liveness + per-backend health of the Countersign cross-vendor control plane. Call first to confirm the guard and kill switch are live before relying on them.

countersign_list_agents

List every governed agent across all wallet backends.

countersign_apply_policy

Compile and apply ONE unified spending policy across every backend (fail-closed). Amounts are base units (USDC has 6 decimals: 100 USDC = 100000000). Omit agentId to apply to all agents.

ParameterTypeDescription
asset *stringe.g. USDC
agentIdstring
allowlistarraypermitted counterparties; [] = deny all
approvalThresholdstringspends strictly above this need human approval
dailyCapstringmax per rolling day, base units
denylistarray
frozenbooleanhard kill — deny everything
perTxCapstringmax per transaction, base units
venuesarray

countersign_request_spend

ALWAYS call this BEFORE an agent moves money. The cross-vendor pre-flight spend guard: ask Countersign whether a spend is allowed BEFORE touching the wallet/card, and act on the verdict — allow / deny / needs_approval. Enforces one unified policy (caps, allow/deny lists, approval thresholds, freeze) across every backend, fail-closed. Amount in base units (USDC has 6 decimals: 100 USDC = 100000000).

ParameterTypeDescription
agentId *string
amount *string
asset *string
venue *string
counterpartystring
listingIdstringMarketplace listing being paid (x402 Bazaar / Agentic.Market resource URL) — required when the policy carries a listing allowlist

countersign_list_approved_venues

Where may this fleet spend? Lists each governed agent's venue rules from the applied policies: allowed/denied venues, marketplace listing allowlists, and per-venue caps. Call this before browsing a marketplace so the agent only engages listings its policy permits.

countersign_guard_x402

Govern an x402 (HTTP-402) machine payment BEFORE paying. Pass the agentId + the 402 challenge's `accepts` array; Countersign picks the cheapest option, evaluates it against policy, and returns allow / deny / needs_approval. Only pay if it returns allow — a rogue or over-budget agent never pays.

ParameterTypeDescription
accepts *arraythe `accepts` array from the 402 Payment Required body
agentId *string

countersign_guard_ap2

Govern an AP2 (Agent Payments Protocol) payment BEFORE the agent signs the PaymentMandate. Pass the agentId + the merchant-signed AP2 mandate (a Cart/Checkout Mandate or a PaymentMandate); Countersign reads the committed amount/currency/payee, evaluates it against policy, and returns allow / deny / needs_approval. Only sign/send the mandate if it returns allow — a rogue or over-budget agent never pays.

ParameterTypeDescription
agentId *string
mandate *objectthe AP2 mandate object — a merchant-signed Cart/Checkout Mandate or a PaymentMandate (committed total + payee)

countersign_list_approvals

List spends currently held pending human approval (the consensus path).

countersign_approve

Approve a pending spend by its token. Rejected if the system is frozen (fail-closed).

ParameterTypeDescription
approvalToken *string

countersign_deny

Deny a pending spend by its token.

ParameterTypeDescription
approvalToken *string
reasonstring

countersign_freeze

THE KILL SWITCH. The emergency stop when an agent goes wrong: freeze every agent on every wallet/card backend at once, in under a second, fail-closed. Use the moment a spend looks compromised, runaway, or unauthorized.

ParameterTypeDescription
reasonstring

countersign_unfreeze

Lift a freeze across every backend (recover / replay).

countersign_ledger

Read the append-only, hash-chained, tamper-evident audit ledger — every spend attempt across every backend — and re-verify its integrity. The single source of truth for what your agents tried to do.

ParameterTypeDescription
limitnumberhow many recent entries to show (default 15)