
Smartpolicy
io.github.smartpolicy-protocolPublished by GitHub account smartpolicy-protocolv0.2.0Updated Oct 25, 2026
Runtime authorization for AI agents and smart contracts via an immutable on-chain policy registry
Overview
An MCP server that lets an AI agent ask an on-chain policy registry whether an action is allowed and receive a short-lived signed grant.
- What you can do
- Query the on-chain policy registry to check whether an agent, user or contract may perform a given action under a named policy, and receive a short-lived signed grant (EIP-712) that a contract or backend can verify. Optionally issue grants with a configured issuer key. Deploy the registry and verifier contracts to a chain from embedded bytecode. Point at a custom registry, verifier or EVM RPC endpoint instead of the public Sepolia defaults.
- When to use it
- Use it when you are building AI agents or smart contracts that need runtime authorization decisions from a shared, updatable policy registry, and you want the assistant to check permissions or obtain verifiable grants during a workflow. It is early-stage and not audited, so it suits experimentation and test networks rather than production trust.
- Requirements
- Runs locally as an npm package over stdio (Node.js). By default it connects to public Ethereum Sepolia; you can override the registry address, verifier address and EVM RPC endpoint through environment variables. Issuing grants requires the optional issuer private key environment variable.
Installation
In SourceWeft
- Open Smartpolicy in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
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.
Source: README.md at commit 534f4e3
Tools
0Version history
1- v0.2.0LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts