KeeperGate

KeeperGate

Enables AI agents to execute on-chain transactions through policy validation, KeeperHub orchestration, and tamper-evident evidence recording.

Category
访问服务器

README

KeeperGate — fail-closed execution assurance for AI agents

Decide locally. Execute through KeeperHub. Prove what actually landed onchain.

KeeperHub workflow Historical Sepolia receipt CI License: MIT

KeeperGate is an execution boundary for AI agents. It validates transaction intent, enforces cumulative policy, prevents duplicate submission, routes approved writes through KeeperHub, reconciles KeeperHub execution with an independent Sepolia RPC, and emits a tamper-evident evidence record.

The central invariant is simple: no confirmed receipt, no claim of execution. Demo mode never fabricates transaction hashes. Live failures stop closed.

Why this is different

KeeperHub already provides secure wallets, gas management, retries, and agentic-wallet payment limits. KeeperGate does not replace those controls. It adds application-level assurance around an agent's business intent:

  • token units are separated from USD policy value (amount vs amountUsd);
  • the 24-hour budget is cumulative per agent, not a per-transaction label;
  • denylist matching is exact, avoiding prefix false positives;
  • out-of-policy requests enter a real approve/reject flow;
  • caller retries reuse an idempotency key instead of broadcasting twice;
  • concurrent retries compete for an atomic idempotency claim before execution;
  • KeeperHub execute_workflow is reconciled through get_execution;
  • a transaction is confirmed only after an independent Sepolia receipt succeeds;
  • every record receives a canonical SHA-256 evidence hash and verify URL.

Architecture

Agent / ElizaOS
      |
      |  intent + amountUsd + idempotencyKey
      v
@keepergate/sdk  -- backend unavailable --> FAIL CLOSED
      |
      v
KeeperGate API
  1. validate address / amount / calldata shape
  2. exact denylist + allowlist + cumulative 24h budget
  3. block | request human approval | approve
      |
      | approved live intent only
      v
KeeperHub MCP
  execute_workflow -> get_execution -> canonical tx hash
      |
      v
Independent Sepolia JSON-RPC receipt check
      |
      v
SHA-256 evidence record -> /api/evidence/verify/:id

KeeperHub remains the execution layer and signer. KeeperGate never accepts a private key.

Verify in 60 seconds

Requires Node.js 20 or newer.

git clone https://github.com/xDzaky/KeeperGate.git
cd KeeperGate
npm ci
npm run check

npm run check runs workspace typechecks, the seven-request integration flow, all package builds, and the production dashboard build. The integration test deliberately uses demo mode and asserts:

  • five policy scenarios return their expected decisions;
  • demo approval has executionStatus=simulated;
  • demo approval has txHash=null;
  • the evidence pack reports zero confirmed transactions;
  • repeating the same idempotency key returns the original record.

Run the dashboard

One-command judge start:

./start.sh

Or run both development processes directly:

cp backend/.env.example backend/.env
npm run dev
  • Dashboard: http://localhost:3000
  • API: http://localhost:3001
  • Evidence: http://localhost:3001/api/evidence
  • Submission proof: http://localhost:3001/api/submission

The homepage includes a one-click Run judge tour. Complete SDK, ElizaOS, CLI, approval, production, and troubleshooting instructions are in docs/USAGE.md. Reviewers can use JUDGE_GUIDE.md.

Run live through KeeperHub

Set these in backend/.env:

DEMO_MODE=false
STRICT_MODE=true
KEEPERHUB_API_KEY=kh_...
KEEPERHUB_WORKFLOW_ID=...
KEEPERHUB_WALLET_INTEGRATION_ID=...
TURNKEY_WALLET_ADDRESS=0x...
KEEPERGATE_GATE_TOKEN=<random-client-token>
KEEPERGATE_ADMIN_TOKEN=<different-random-admin-token>
SEPOLIA_RPC_URL=https://ethereum-sepolia-rpc.publicnode.com
PUBLIC_URL=https://api.example.com
FRONTEND_URLS=https://dashboard.example.com

Then submit a uniquely keyed intent:

curl -X POST http://localhost:3001/api/gate/intercept \
  -H 'content-type: application/json' \
  -H 'x-agent-id: judge-demo-agent' \
  -H 'authorization: Bearer <gate-token>' \
  -d '{
    "to":"0x1111111111111111111111111111111111111111",
    "amount":"0.0001",
    "amountUsd":0.25,
    "token":"ETH",
    "idempotencyKey":"judge-demo-2026-001",
    "intent":"Demonstrate a guarded Sepolia transfer"
  }'

Possible execution states:

State Meaning Transaction claim
not_submitted blocked or waiting for approval none
simulated demo policy passed none
submitted KeeperHub accepted the run; receipt not yet confirmed no confirmed claim
confirmed KeeperHub hash has a successful Sepolia receipt explorer link shown
failed KeeperHub or the onchain receipt failed none

Human approval

An over-budget or non-allowlisted request returns HTTP 202 and a txId. An operator can approve or reject it with the admin token:

curl -X POST http://localhost:3001/api/gate/<txId>/approve \
  -H 'authorization: Bearer <admin-token>'

curl -X POST http://localhost:3001/api/gate/<txId>/reject \
  -H 'authorization: Bearer <admin-token>'

Approval executes once through the same KeeperHub reconciliation path. Rejection never touches KeeperHub.

Evidence API

curl http://localhost:3001/api/evidence
curl http://localhost:3001/api/evidence/verify/<record-id>
curl http://localhost:3001/api/evidence/download > keepergate-evidence.json
curl -X POST http://localhost:3001/api/evidence/reconcile/<submitted-record-id> \
  -H 'authorization: Bearer <admin-token>'

The evidence hash commits to the intent, decision, workflow ID, execution ID, execution state, mode, and transaction hash. Changing any committed field invalidates verification.

GET /api/submission separately re-checks the public historical transaction through the configured Sepolia RPC. It labels that receipt as pre-Evidence-v2 and never attaches it to demo records.

Historical KeeperHub execution

The earlier prototype produced this KeeperHub-linked Sepolia transaction:

An independent JSON-RPC check confirms chain ID 11155111 and a successful receipt. Correction to the original prototype notes: the outer sponsored/relayed transaction has zero native value and targets an execution contract; it is not a direct 0.0001 ETH self-transfer. A fresh v0.3 live run should be captured for final judging so the evidence format, KeeperHub run, and chain receipt all correspond to the submitted code.

Packages

Path Purpose
backend/ policy, KeeperHub MCP client, reconciliation, evidence API
packages/sdk/ fail-closed TypeScript client
packages/plugin-eliza/ ElizaOS secure-transfer action
packages/dashboard/ simulation, policy, and evidence UI
packages/scaffold/ safe onboarding CLI; never invents a workflow or tx hash
test/run.mjs self-contained integration test

Submission artefacts: DORAHACKS_SUBMISSION.md, JUDGE_GUIDE.md, and CHANGELOG.md.

Security model

  • no private key or seed phrase is accepted;
  • the SDK never sends a KeeperHub API key to the proxy;
  • live execution errors cannot fall back to an approved fake result;
  • demo and live evidence are distinguishable in storage and UI;
  • the public Simulation Lab is permanently dry-run and cannot call KeeperHub, even when the backend is live;
  • policy writes and human approvals require an admin token;
  • production gate access requires a separate client token;
  • production refuses missing or identical gate/admin tokens;
  • dashboard origins are explicitly allowlisted and API responses include baseline security headers;
  • mutating API requests receive request IDs and a bounded per-client write rate;
  • malformed EVM addresses, decimal amounts, and calldata are rejected;
  • CI rejects known private-key and fake-hash generator patterns.

See SECURITY.md before using any wallet associated with an earlier revision.

Honest limitations and submission status

  • The dashboard is a local judging surface; no public deployment is included yet.
  • The DoraHacks BUIDL form still needs to be completed on the platform.
  • The historical transaction predates evidence v2; capture a new live run after rotating credentials.
  • USD valuation is supplied by the caller. A production deployment should bind it to a trusted oracle quote and expiry.
  • The current workflow executes a native transfer. ERC-20 and arbitrary contract calls need asset-specific workflow templates.
  • Private routing, gas strategy, and transaction ordering are KeeperHub guarantees; KeeperGate records their execution result but does not reimplement them.
  • The dashboard temporarily pins Next.js 16.3.0-preview.8, the first release outside the current high-severity advisory range; move to the corresponding stable release as soon as it is published. Production dependencies currently audit clean. A low-severity Windows-only esbuild dev-server advisory remains in tsup's build-time dependency tree.

License

MIT

Submission preflight

npm run submit:check

This runs typechecks, integration tests, every workspace build, the production dependency audit, and current-tree submission/secret checks.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选