
Smartpolicy
io.github.smartpolicy-protocol由 GitHub 账号 smartpolicy-protocol 发布v0.2.0更新于 Oct 25, 2026
Runtime authorization for AI agents and smart contracts via an immutable on-chain policy registry
概览
一个 MCP 服务器,让 AI 代理向链上策略注册表查询某操作是否被允许,并获得短期签名授权。
- 可以做什么
- 查询链上策略注册表,判断某个代理、用户或合约在指定策略下能否执行某操作,并获得可供合约或后端验证的短期签名授权(EIP-712)。在配置了签发者密钥时可选择签发授权。使用内置字节码把注册表和验证器合约部署到链上。可改用自定义的注册表、验证器或 EVM RPC 端点,而非默认的公共 Sepolia。
- 适用场景
- 适用于构建需要从可更新的共享策略注册表获取运行时授权决策的 AI 代理或智能合约,并希望助手在工作流中检查权限或取得可验证授权。项目处于早期且未经审计,适合实验和测试网络,而非生产环境的信任基础。
- 运行要求
- 以 npm 包形式通过 stdio 在本地运行(需要 Node.js)。默认连接公共 Ethereum Sepolia;可通过环境变量覆盖注册表地址、验证器地址和 EVM RPC 端点。签发授权需要可选的签发者私钥环境变量。
安装
在 SourceWeft 中
- 打开 控制台中的 Smartpolicy,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
SmartPolicy
Runtime authorization for AI agents and smart contracts.
Define what an agent, a user, or a contract is allowed to do — once, as a policy. Enforce it everywhere: on-chain via a minimal verifier, off-chain via an MCP server and REST API that AI systems consume directly. Update the rules without redeploying anything.
Status (2026-06-12): core contracts live on Ethereum Sepolia (Etherscan-verified, addresses in contracts/deployments/sepolia.json); 54 Foundry tests green; MCP server v0 packaged —
npx smartpolicy-mcpruns zero-config against Sepolia,npx smartpolicy-mcp deploybootstraps any chain from embedded bytecode; AI-consumability proven by unaided fresh-agent execution tests (incl. cold start on an empty chain). NOT audited; internal until mature — no public repo or registry listings yet. Current state, decisions, and how to resume work: PLAN.md.
Why
Every team shipping AI agents hits the same wall: the agent can technically do anything its keys allow, and the only ways to constrain it are hardcoded prompts or redeployed code. Every smart contract team hits the mirror image: access rules baked into the contract at deploy time.
SmartPolicy separates the rule from the enforcement point:
- A policy lives in the on-chain Registry: members, admins, conditions, expiry, and mutability flags. It is data, not code. Changing a rule is a transaction, not a redeploy.
- Enforcement happens wherever the action happens:
- A smart contract inherits one modifier and checks the Registry (free view call).
- An AI agent (or the service in front of it) asks the MCP server / REST API:
"may
0xAgentperformactionunder policyN?" and receives a short-lived signed grant (EIP-712) that any contract or backend can verify.
What this is NOT
- Not a token. There is no protocol token, no ICO, no governance theater. Revenue is fees: a small fee on on-chain policy writes, and metered (x402) pay-per-call on the hosted API. Reads and verification are free.
- Not upgradeable. The core Registry is immutable once deployed. Trust comes from code you can read, not admin keys you have to trust. New protocol versions are new deployments.
- Not an oracle. SmartPolicy answers "is this allowed?", not "what happened in the world?". Condition values that depend on external facts are attested via signed grants from sources the policy owner chooses.
Architecture (short version)
See ARCHITECTURE.md for the full design and the rationale for every decision (chain, fees, trust model, what was deliberately dropped from v1).
Repository layout
Lineage
SmartPolicy is a clean rewrite of the strongest ideas from a 2025 prototype ("Smart Policy Protocol", Sepolia): the policy registry, the tiered integration model, and hybrid on-chain + signed-token enforcement. The rewrite deliberately drops the SPOL token/ICO/governance suite, the sports-prediction oracle, the factory contracts, and the upgradeable-proxy trust model, and fixes the known security issues (tx.origin checks, missing reentrancy guards, header-only API auth).
License
Apache-2.0 — see LICENSE.
来源:README.md,提交 534f4e3
工具
0版本历史
1- v0.2.0最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分