KeeperGuard is a policy firewall that gets an AI agent from intent to a verified onchain transaction through KeeperHub without handing the model a private key. It enforces a recipient allowlist and amount cap, locks mainnet, simulates every write, broadcasts with an idempotency key, follows KeeperHub's polling hints, and accepts success only when the final response contains an onchain transaction hash.
The first transaction executed end to end by KeeperGuard is live on Base Sepolia: 0xd61f552e...214ffab. KeeperHub sponsored the gas, so no user funds were deposited or spent.
Watch the
67-second uncut demo.
It shows a fail-closed rejection, a live KeeperHub simulation, the recorded
terminal proof, independent RPC verification, and the safety test suite. The
recording script is available at scripts/demo.ps1.
KeeperHub already exposes the primitives for safe execution, but a new builder has to assemble them across account setup, wallet discovery, chain discovery, simulation, idempotency, status polling, and explorer verification. Several official onboarding paths stop at a read-only workflow rather than a real transaction. KeeperGuard turns the safe path into one reproducible agent loop and fails closed when any proof is missing.
Requirements:
- Node.js 22 or newer
- A verified KeeperHub account
- A revocable organization API key with the
kh_prefix
Set the key only for the current shell. Do not save it in the repository.
PowerShell:
$env:KEEPERHUB_API_KEY = Read-Host 'KeeperHub API key'Bash:
read -rsp 'KeeperHub API key: ' KEEPERHUB_API_KEY
export KEEPERHUB_API_KEYCheck that the organization wallet and Base Sepolia are ready:
npm run doctor -- --chain 84532 --jsonSimulate a zero-value self-transfer. Replace the address with the organization
wallet returned by doctor:
npm start -- \
--chain 84532 \
--to 0xYourOrganizationWallet \
--amount 0 \
--allow-recipientThe default is simulation only. Nothing is signed or broadcast. If the result
passes, repeat the exact intent with --broadcast:
npm start -- \
--chain 84532 \
--to 0xYourOrganizationWallet \
--amount 0 \
--allow-recipient \
--broadcastKeeperGuard prints the final explorer link and writes a redacted JSONL audit
trail to .keeperguard/audit.jsonl. If a connection is interrupted after
broadcast, rerun with the idempotency key recorded in the
broadcast_authorized event.
The model can propose an intent, but it cannot relax the execution policy.
- Discover the live chain catalog from KeeperHub.
- Reject disabled chains and all mainnets.
- Normalize addresses and decimal amounts without floating-point arithmetic.
- Require an explicit recipient allowlist and enforce the amount cap.
- Simulate the exact intent and require
success: truepluswouldRevert: false. - Persist an idempotency key before broadcast.
- Poll according to
X-Poll-Interval-Hint. - Require
completed, the expected chain, and a transaction hash. - Redact credentials from the audit trail.
The Turnkey-backed KeeperHub wallet signs inside secure infrastructure; KeeperGuard never receives a private key.
AI agent / operator
|
v
KeeperGuard intent policy
allowlist | cap | testnet lock
|
v
KeeperHub simulation
|
v
KeeperHub sponsored execution
|
v
receipt + explorer proof + redacted audit
Run the dependency-free test suite and verify the committed transaction proof against the public Base Sepolia RPC:
npm test
npm run check
npm run verify-proofThe tests cover mainnet lockout, recipient and cap enforcement, strict decimal parsing, simulation-before-broadcast ordering, idempotency headers, 429 retry hints, terminal proof validation, chain mismatch, and credential redaction.
Building this starter surfaced a concrete agent onboarding gap: the REST direct
execution routes support simulate: true, but the MCP direct execution tools
do not expose it. The companion KeeperHub patch adds a strict optional boolean
to the EVM paths in all three MCP write tools, forwards it to the existing
dry-run paths, rejects unsupported Solana simulation before the API call, and
documents a safe first-write sequence. This lets an MCP-native agent preflight
without switching surfaces or risking an accidental broadcast. See
KeeperHub PR #1858.
See Onboarding findings and the full threat model.
KeeperGuard is a testnet-first hackathon starter. Mainnet is intentionally locked in this release. It is not financial advice and has not been audited.
