io.github.smartpolicy-protocol/smartpolicy

Registre officiel IA et agents

Runtime authorization for AI agents and smart contracts via an immutable on-chain policy registry

Installation

Ajoutez ceci à la configuration MCP de votre client (Claude Desktop : claude_desktop_config.json ; Cursor : .cursor/mcp.json ; VS Code et les autres utilisent la même forme « mcpServers »).

NPM package @smartpolicy/mcp
Claude Code
claude mcp add smartpolicy -e 'SMARTPOLICY_REGISTRY=<SMARTPOLICY_REGISTRY>' -e 'SMARTPOLICY_VERIFIER=<SMARTPOLICY_VERIFIER>' -e 'SMARTPOLICY_RPC_URL=<SMARTPOLICY_RPC_URL>' -e 'SMARTPOLICY_ISSUER_KEY=<your smartpolicy_issuer_key>' -- npx -y @smartpolicy/mcp@0.2.0
Configuration JSON (Claude Desktop, Cursor, VS Code)
{
    "mcpServers": {
        "smartpolicy": {
            "command": "npx",
            "args": [
                "-y",
                "@smartpolicy/mcp@0.2.0"
            ],
            "env": {
                "SMARTPOLICY_REGISTRY": "<SMARTPOLICY_REGISTRY>",
                "SMARTPOLICY_VERIFIER": "<SMARTPOLICY_VERIFIER>",
                "SMARTPOLICY_RPC_URL": "<SMARTPOLICY_RPC_URL>",
                "SMARTPOLICY_ISSUER_KEY": "<your smartpolicy_issuer_key>"
            }
        }
    }
}

Variables d'environnement

  • SMARTPOLICY_REGISTRY PolicyRegistry contract address (omit for the public Sepolia default)
  • SMARTPOLICY_VERIFIER GrantVerifier contract address (omit for the public Sepolia default)
  • SMARTPOLICY_RPC_URL EVM RPC endpoint (omit for the public Sepolia default)
  • SMARTPOLICY_ISSUER_KEY secret Optional grant-issuer private key; enables the grant_issue tool

Documentation

Tirée du README du projet sur GitHub, actualisée chaque semaine. Les liens ouvrent GitHub.

Sommaire
  1. SmartPolicy
  2. Why
  3. What this is NOT
  4. Architecture (short version)
  5. Repository layout
  6. Lineage
  7. License

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-mcp runs zero-config against Sepolia, npx smartpolicy-mcp deploy bootstraps 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 0xAgent perform action under policy N?" 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)

┌─────────────┐   MCP / REST (x402 metered)   ┌──────────────────┐
│  AI agents   │ ────────────────────────────▶ │ SmartPolicy MCP  │
│  & services  │ ◀──── signed grants ────────  │ server (TS)      │
└─────────────┘                                └────────┬─────────┘
                                                        │ reads + grant issuance
┌─────────────┐   inherit Gate modifier        ┌────────▼─────────┐
│  Protected   │ ────── view calls ──────────▶ │ PolicyRegistry   │
│  contracts   │                               │ (Base, immutable)│
└─────────────┘                                └──────────────────┘

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

contracts/   Solidity core: PolicyRegistry, PolicyGate, interfaces (Foundry)
mcp/         MCP server + REST API (TypeScript, x402 metering)
sdk/         TypeScript client SDK (@smartpolicy/sdk) — reads, grants, tx-building
docs/        Integration guides (planned)

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.

Questions fréquentes

Qu'est-ce que io.github.smartpolicy-protocol/smartpolicy ?

Runtime authorization for AI agents and smart contracts via an immutable on-chain policy registry

Comment installer io.github.smartpolicy-protocol/smartpolicy ?

Il s'exécute sur votre machine. Dans Claude Code : claude mcp add smartpolicy -e 'SMARTPOLICY_REGISTRY=<SMARTPOLICY_REGISTRY>' -e 'SMARTPOLICY_VERIFIER=<SMARTPOLICY_VERIFIER>' -e 'SMARTPOLICY_RPC_URL=<SMARTPOLICY_RPC_URL>' -e 'SMARTPOLICY_ISSUER_KEY=<your smartpolicy_issuer_key>' -- npx -y @smartpolicy/mcp@0.2.0. Pour les autres clients, collez la configuration JSON de cette page dans leurs réglages MCP.

Faut-il une clé API pour io.github.smartpolicy-protocol/smartpolicy ?

Oui. Il attend SMARTPOLICY_ISSUER_KEY, à renseigner dans sa configuration.

io.github.smartpolicy-protocol/smartpolicy est-il open source ?

Oui. Son code est sur GitHub sous licence Apache-2.0.

Qui maintient io.github.smartpolicy-protocol/smartpolicy ?

Il est publié par smartpolicy-protocol. AI.tn le référence sans le maintenir ni le recommander.

Issu du registre MCP officiel. Être listé n'est pas une recommandation : vérifiez le code et les permissions d'un serveur avant de lui donner accès à vos données.