Karatum Guard · testnets
A certificate the wallet enforces
Karatum certifies, per agent build and task class, that an agent's verified outcomes are good enough (VALID, STALE or EXPIRED). Karatum Guard moves that verdict into the wallet: a Safe or an ERC-4337 smart account operated by an AI agent executes a transaction only while the agent's certificate for that kind of task is VALID on-chain, the target is allow-listed, and the amount fits the cap of the agent's tier. The human admin keeps a bypass, so a lapsed certificate can never lock the funds.
How it decides
1 · Certificate registry
Once a day the attester publishes one Merkle root over every certificate that is VALID off-chain and bound to a wallet. A leaf is (agent, task type, tier, karats, expiry). Anyone can prove a leaf, which caches it in one storage slot; guards read status(agent, taskType). Tiers: 1 ≥ 12K, 2 ≥ 18K, 3 ≥ 22K. A certificate stops counting when it expires, when the attester revokes it, or when it is missing from the latest roots (SUPERSEDED).
2 · Safe guard and ERC-7579 module
KaratumSafeGuard (Safe v1.4.1 checkTransaction) and KaratumGuard7579 (validator + hook) share one policy engine: allow-listed targets mapped to task types, certificate VALID at tier ≥ minTier, per-transaction and per-day caps scaled by the tier (native and ERC-20), no delegatecall, no self-calls, no gas refunds. If roots stop arriving, the account's own fail-open / fail-closed setting decides; an expired or revoked certificate always blocks.
3 · Preflight pass
POST /v1/guard/preflight runs the exact call on an Anvil fork of the target chain, runs the account's guard on that fork, reads the agent's certificate, and answers PASS / WARN / BLOCK. On PASS it signs a 10-minute EIP-712 pass bound to the account, the call, the Safe nonce and the chain. A Safe can require it (requirePreflight). The success probability it signs is the lower bound of the agent's 95% Wilson interval of verified successes, and 0 if the simulation fails.
4 · Agents
The AgentKit provider karatum_guard preflights every transaction and sends only on PASS, through the Safe with the pass attached. The guard re-checks everything on-chain, so a stale preflight cannot let a revoked agent through.
Live demo on Base Sepolia
| Outcome | What happened | Transaction |
|---|---|---|
| Passed | PASS: certified agent pays 0.0004 ETH to an allow-listed payee with a fresh preflight pass · pass signed at 90.34% Safe 0x8dde…f6a7 · 2026-10-15 22:09:12 UTC | 0xf9d6…f06e |
| Blocked | BLOCKED: 0.0015 ETH is over the agent's tier capValueOverTxCap(0.0015 ETH > cap 0.001 ETH)Safe 0x8dde…f6a7 · 2026-10-15 22:09:13 UTC | 0x0bc3…8252 |
| Blocked | BLOCKED: target is not on the Safe's allow-listTargetNotAllowed(0xa6B0…Eb60)Safe 0x8dde…f6a7 · 2026-10-15 22:09:13 UTC | 0xcc15…e5e4 |
| Blocked | BLOCKED: the agent has no Karatum certificateCertificateNotValid(agent 0x3BfD…4547, web3, NONE)Safe 0x3340…5904 · 2026-10-15 22:09:14 UTC | 0x1678…e232 |
| Blocked | BLOCKED: certificate revoked on-chainCertificateNotValid(agent 0xE651…9606, web3, REVOKED)Safe 0x8dde…f6a7 · 2026-10-15 22:09:18 UTC | 0x001a…3bbe |
| Passed | PASS again: certificate re-issued in a new root and re-proven · pass signed at 90.34% Safe 0x8dde…f6a7 · 2026-10-15 22:09:40 UTC | 0xa668…1807 |
| Passed | PASS: certified agent pays 0.0004 ETH to an allow-listed payee with a fresh preflight pass · pass signed at 90.34% Safe 0x8dde…f6a7 · 2026-10-17 09:41:55 UTC | 0xbd77…e1b3 |
| Blocked | BLOCKED: 0.0015 ETH is over the agent's tier capValueOverTxCap(0.0015 ETH > cap 0.001 ETH)Safe 0x8dde…f6a7 · 2026-10-17 09:41:55 UTC | 0xd76d…998a |
| Blocked | BLOCKED: target is not on the Safe's allow-listTargetNotAllowed(0xa6B0…Eb60)Safe 0x8dde…f6a7 · 2026-10-17 09:41:56 UTC | 0x64de…adc4 |
| Blocked | BLOCKED: the agent has no Karatum certificateCertificateNotValid(agent 0x3BfD…4547, web3, NONE)Safe 0x3340…5904 · 2026-10-17 09:41:57 UTC | 0x7be0…ab56 |
| Blocked | BLOCKED: certificate revoked on-chainCertificateNotValid(agent 0xE651…9606, web3, REVOKED)Safe 0x8dde…f6a7 · 2026-10-17 09:42:06 UTC | 0xe93f…6a5c |
| Passed | PASS again: certificate re-issued in a new root and re-proven · pass signed at 90.34% Safe 0x8dde…f6a7 · 2026-10-17 09:42:30 UTC | 0xb717…6a87 |
Setup, roots and proofs (21 transactions)
- Safe A (certified agent): Safe v1.4.1 created (owners: agent + admin, threshold 1) — 0x01d4…e344
- Safe B (uncertified agent): Safe v1.4.1 created (owners: agent + admin, threshold 1) — 0x0ad3…ac70
- Safe A: admin configures the Karatum Guard policy (agent 0xE651B3…, allow-list, tier caps, preflight pass required) — 0x96bd…1df7
- Safe A: admin sets KaratumSafeGuard as the Safe transaction guard — 0x6ff9…dc2b
- Safe B: admin configures the Karatum Guard policy (agent 0x3BfDEb…, allow-list, tier caps) — 0x10f7…d016
- Safe B: admin sets KaratumSafeGuard as the Safe transaction guard — 0x96b7…5143
- attester publishes certificate root, epoch 2 (1 leaves): demo setup (build-a-careful-v1 bound to the agent wallet) — 0xb6c9…55e4
- attester publishes certificate root, epoch 3 (1 leaves): demo setup (build-a-careful-v1 bound to the agent wallet) — 0x9d73…bc44
- Merkle proof caches the agent certificate on-chain (epoch 3, tier 3, 22K) — 0x8b01…bb30
- attester revokes the agent's web3 certificate (kill switch) — 0xc3ad…afad
- attester publishes certificate root, epoch 4 (1 leaves): re-issue after revocation — 0x7dc9…6c4d
- Merkle proof caches the agent certificate on-chain (epoch 4, tier 3, 22K) — 0x52d8…ea4b
- Safe A: admin configures the Karatum Guard policy (agent 0xE651B3…, allow-list, tier caps, preflight pass required) — 0xb053…0ece
- Safe A: admin sets KaratumSafeGuard as the Safe transaction guard — 0x6e54…39e2
- Safe B: admin configures the Karatum Guard policy (agent 0x3BfDEb…, allow-list, tier caps) — 0xde8c…8dd3
- Safe B: admin sets KaratumSafeGuard as the Safe transaction guard — 0xa1a1…0d13
- attester publishes certificate root, epoch 2 (7 leaves): demo setup (build-a-careful-v1 bound to the agent wallet) — 0x9b52…045a
- Merkle proof caches the agent certificate on-chain (epoch 2, tier 3, 22K) — 0xf88d…fadd
- attester revokes the agent's web3 certificate (kill switch) — 0x0601…8c6e
- attester publishes certificate root, epoch 3 (7 leaves): re-issue after revocation — 0x10eb…a28e
- Merkle proof caches the agent certificate on-chain (epoch 3, tier 3, 22K) — 0x627a…943c
Contracts and roots
| Network | Contracts | Latest root |
|---|---|---|
| Base Sepolia chain 84532 | Registry 0x3799…0Ae6 Safe guard 0xb4c6…9CB0 7579 module 0xC959…12ee | Epoch 47 · 8 leaves · 0xe0cf…42d3 valid until 2026-12-03 03:46:38 UTC · leaf set |
| Ethereum Sepolia chain 11155111 | Registry 0xc66B…83D3 Safe guard 0x0c2e…8366 7579 module 0x171F…647f | Epoch 45 · 8 leaves · 0x0ee8…4440 valid until 2026-12-03 03:46:38 UTC · leaf set |
Leaves are certificates that are VALID off-chain and bound to a wallet (a build registered with its wallet, or an explicit operator binding). Preflights answered so far: 17. Preflight signer 0x062c49Fd9b459d6838b23081d8EaaE171c444C2B.
Use it
Protect a Safe
// 1. Admin-executed Safe tx: configure the policy on KaratumSafeGuard (Base Sepolia)
guard.configure(
{ agent, admin, defaultTaskType: keccak256("karatum.task.web3"), minTier: 1,
failOpen: false, requirePreflight: true, preflightSigner, minSuccessBps: 9000,
txCap: [0, 0.0001 ether, 0.0005 ether, 0.001 ether], // wei per tx, by tier 0..3
dailyCap: [0, 0.0003 ether, 0.0015 ether, 0.003 ether] },
[{ target: payee, allowed: true, taskType: 0x0 }], // allow-list
[]) // ERC-20 caps (optional)
// 2. Admin-executed Safe tx: safe.setGuard(KaratumSafeGuard)
// From now on, any transaction NOT executed by the admin must pass the guard.Preflight a transaction
curl -s https://karatum.com/v1/guard/preflight -H 'content-type: application/json' -d '{
"chainId": 84532,
"agent": "0xAGENT",
"account": "0xSAFE",
"tx": { "to": "0xPAYEE", "value": "400000000000000", "data": "0x" }
}'
# -> { verdict: PASS | WARN | BLOCK, successProbability, reasons, simulation, pass: { trailer, expiresAt } }
# Safe signatures = ownerSignatures ++ pass.trailer (79 bytes, "KGP1")AgentKit
import { AgentKit } from "@coinbase/agentkit";
import { karatumGuardActionProvider } from "@karatum/agentkit-actions";
const agentkit = await AgentKit.from({
walletProvider, // Base Sepolia
actionProviders: [karatumGuardActionProvider({ allowSend: true })],
});
// actions: guard_preflight, guarded_send_transaction (sends only on PASS), guard_statusProve a certificate
GET /v1/guard/proof?agent=0x…&taskClass=web3 returns the leaf, epoch and Merkle proof per chain; anyone can submit it to KaratumCertRegistry.prove. Karatum proves the agents of the accounts it watches after every root.
Runbook: docs/runbooks/guard.md. Contracts: contracts/src/guard (Foundry unit tests and fork tests against the real Safe v1.4.1 on Base Sepolia).
Scope
- Testnets only (Base Sepolia, Ethereum Sepolia). The contracts have had an internal security review, not an external audit.
- The ERC-7579 module is covered by unit tests against a minimal 7579 account; it has not yet run on a production 7579 account.
- The demo agent wallet is a Karatum testnet key bound to a Karatum house build for the demo; the certificate behind it is the build's real one.
- Safe modules bypass Safe 1.4.1 transaction guards: keep modules off on agent Safes (the agent itself cannot enable one).