A non-custodial Soroban treasury that lets a business hand an autonomous AI agent real money to spend β where the contract, not the model's good behaviour, enforces the limits. The owner funds it from their own wallet, connects any MCP agent with one command, and every payment is checked, attributed and settled on Stellar in sub-cents.
Formerly PRISM β renamed to Eunomia ahead of mainnet. Hackathon results, tester evidence and on-chain history in this repo refer to the same product.
βΆ Live app Β· π Docs Β· π₯ Demo video Β· π Connect your agent Β· πΊ Roadmap Β· π Deployment & proofs
Not a mock-up: one treasury, paid from twice and refused twice β over the per-payment cap, then to an address nobody approved.
Mainnet beta. Eunomia runs on Stellar mainnet with real funds. During the beta every treasury carries a deposit cap fixed at creation; the contracts' addresses are in
DEPLOYMENT.md.
AI agents can reason, plan and act β right up until they need to pay for something. Today no business gives an LLM agent a wallet, for two reasons:
- Safety. One hallucination, jailbreak or prompt-injection and the wallet is drained.
- Accounting. An agent making hundreds of small payments is impossible to reconcile.
So agents "research and recommend" but never transact. Eunomia removes the blocker: the agent gets a budget, not the keys.
A leash, not a wallet. An agent spends on a Leash β scoped, expiring authority β never with the keys to the vault.
| Guarantee | How | |
|---|---|---|
| Bound | The agent can't overspend or pay the wrong address | The Soroban contract enforces a policy (payee whitelist Β· per-payment limit Β· rolling 24h limit Β· monthly budget) and rejects violations on-chain |
| Revoke | Authority ends on its own, or the moment the owner says so | The agent signs with a Leash: a session key with a spending cap and a deadline. The owner can revoke it, pause the treasury or withdraw at any time |
| Connect | Any MCP agent can spend from it β Claude included | eunomia-mcp: one command makes the agent's key, one signature puts it on the Leash |
| Account | Every payment is attributable, with zero overhead | Spend is tracked per task in the contract; read straight off-chain |
| Trust | The agent can pay counterparties the owner never listed, once they have earned it | A payee passes if whitelisted OR its on-chain ERC-8004 reputation β₯ threshold |
| Outcome | Pay only for delivered work | Escrow locks funds; released on approval, refunded after a deadline |
The business keeps custody the whole time β funds live in the owner's own Soroban contract. Eunomia is the guardrails + accounting + rail, never the custodian.
Vocabulary: a Leash is the time-bound, spend-capped session key an agent signs with.
The agent signs its own pay(task, to, amount). The contract runs the policy gate, in order, on every call:
1. spender.require_auth() the Leash key while a Leash is active β else the root agent
2. not paused else Paused (#9)
3. amount > 0 else InvalidAmount (#1)
4. payee whitelisted OR reputation else PayeeNotWhitelisted (#2) / BelowReputationThreshold (#5)
5. amount β€ per-payment limit else ExceedsTaskLimit (#3)
6. Leash spent + amount β€ its cap else ExceedsSessionLimit (#10)
7. 24h spend + amount β€ daily limit else ExceedsDailyLimit (#4)
8. amount β€ free balance else InsufficientFreeBalance (#6)
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
write accounting β transfer β emit event
An expired Leash is not an error code: its key simply stops being the spender, so step 1 fails for it. Rejections are the product working β a prompt-injected drain hits step 4 and reverts; funds never move.
- Owner is the root of trust: creates the treasury, funds it, sets the rules, and can pause or withdraw at any time.
- Treasury factory does the whole setup under one owner signature β deploy, policy, first payee, Leash, funding, registry β atomically: if any part is refused, nothing is created.
- Agent never holds funds β it holds a Leash: time-bound, spend-capped, instantly revocable.
- Treasury (Soroban) enforces every rule on-chain: payee whitelist or earned ERC-8004 reputation, per-payment cap, rolling 24h cap, monthly budget, Leash limits, pause state. An out-of-policy payment reverts. It holds one token, fixed at creation β XLM or Circle's USDC β and takes deposits through its own capped
deposit. - x402: when a service answers
402 Payment Required, the quoted charge settles through the same policy gate β an over-limit or wrong-payee quote never reaches settlement. A USDC treasury can settle USDC-priced x402 offers; the asset has to be the treasury's own.
eunomia-mcp is an MCP server and TypeScript SDK. The agent's key is made on the agent's machine and never leaves it; the owner only signs a cap and a deadline.
# 1 Β· on the agent's machine β makes the key, prints it and the MCP client config
EUNOMIA_RPC_URL=<a Stellar mainnet RPC> npx -y eunomia-mcp init --treasury <C⦠treasury id>
# 2 Β· the owner pastes that key in the dashboard (Agent page) and signs once
# 3 Β· add the server to the MCP client β for Claude Code:
claude mcp add eunomia -e EUNOMIA_TREASURY=<Cβ¦> -e EUNOMIA_RPC_URL=<https://β¦> -- npx -y eunomia-mcp@0.3.1The agent's key pays its own fees, so its account needs a few XLM first (eunomia-mcp init says how much). The dashboard prints command 1 with the treasury's id already in it β on the Agent page, and during setup too: a treasury's address follows from its salt, so the form settles it before the treasury exists, and one signature creates the treasury and puts the agent on its Leash.
| Tool | What the agent gets |
|---|---|
check_budget |
What it may spend right now β caps, 24h remainder, Leash, free balance, the unit the amounts are in β and, given an amount, the contract's own refusal codes ahead of time |
list_allowed_payees Β· check_payee |
Who the treasury will pay, each address re-verified on-chain |
pay |
A payment signed by the Leash key β to + amount, or an x402 payment requirement. A refusal is not an error: it comes back with the stage and the contract's error code |
request_exception Β· check_exception |
Ask the owner for a payment the policy refuses; the owner resolves it on the dashboard with an on-chain action |
Full reference: packages/mcp/README.md.
A first-time user creates a treasury with Face ID, a fingerprint or a device PIN. Under the hood that is a WebAuthn passkey controlling a Stellar smart wallet (passkey-kit), and the wallet calls the treasury factory as itself, so the treasury's owner β and every authority over it β is the user's own C-address. Transaction fees are sponsored, so nobody needs to hold XLM to get started. Browser wallets (Freighter, Albedo, LOBSTR via WalletConnect) work exactly as before.
A treasury holds XLM or Circle's USDC, chosen at creation. The owner deposits from their own wallet β a classic account or the passkey wallet β through the treasury's deposit, which moves the treasury's own token and enforces the beta's deposit cap.
The treasury factory and the treasury registry are the two fixed contracts; per-user treasuries are deployed by the factory and indexed by the registry, so they have no fixed address. Addresses, wasm hashes and verified on-chain results: DEPLOYMENT.md.
Eunomia ran publicly before the mainnet beta: 18 external testers, 17 treasuries they deployed themselves, 16 out-of-policy payments the contract refused, and 14 feedback responses averaging 4.9 / 5 β what testers hit went straight into the product. The record, with its method and what was left out, is in DEPLOYMENT.md.
Tried Eunomia? Tell us what to fix next: share feedback β
An owner should be able to show an auditor, an investor or a counterparty that the agent stayed inside its rules without showing them the payments. The ZK layer that does it is built β a circuit (Circom Β· Poseidon commitments Β· Poseidon-Merkle membership Β· a 16-payment batch) and an on-chain verifier (Groth16 / BN254, through Soroban's native pairing host function) that re-reads the limits, the payee root and the period total from the treasury itself β and was verified end to end before mainnet. It is not deployed in the mainnet beta: its trusted setup is a single-party development setup, and a mainnet verifier wants a multi-party ceremony first. The honest scope is in SECURITY.md.
# Contracts β test & build
cargo test --manifest-path contracts/treasury/Cargo.toml
stellar contract build --manifest-path contracts/treasury/Cargo.toml
# App β landing + dashboard
cd web
npm install
npm test # unit tests
cp .env.example .env.local # then fill in EUNOMIA_RPC_URL and the factory and registry ids
npm run dev # http://localhost:5173The app is built for one network, mainnet, and refuses to build without the settings that pin it: the RPC, the factory and the registry (web/src/networks.ts). The deposit caps live in the factory, one per token.
contracts/treasury/ Soroban bounded treasury v4 β policy gate + escrow + agent sessions + lifecycle + deposit cap
contracts/treasury_factory/ one owner signature: deploy + policy + payees + Leash + funding + registry, atomically
contracts/treasury_registry/ permissionless wallet β treasury discovery index (cross-device recovery)
contracts/compliance_verifier/ on-chain BN254 Groth16 verifier (ZK) + attestation β not deployed in the beta
contracts/policy/ compliance policy for OpenZeppelin's Confidential Token (whitelist OR reputation, amount hidden)
contracts/reputation_oracle/ ERC-8004-style reputation registry (stellar-8004 stand-in)
circuits/ Circom compliance circuit + circomkit tests + trusted setup
packages/mcp/ eunomia-mcp β MCP server + SDK: connect any AI agent to a treasury (Apache-2.0, on npm)
packages/x402/ bounded x402 buyer (gate an x402 payment, settle via the treasury)
packages/prover/ snarkjs β Soroban byte encoder + proof fixtures
packages/treasury-client/ generated TypeScript client (regen: `npm run generate`)
packages/registry-client/ generated TypeScript client for the treasury registry
packages/factory-client/ generated TypeScript client for the treasury factory
web/ landing + app (Vite Β· React 19 Β· TS)
web/worker/ Cloudflare worker: static assets + the fee-sponsoring relay for passkey wallets
web/docs-site/ the docs site (VitePress) served at /docs
workers/chain-indexer/ cron worker: chain events β Supabase
supabase/migrations/ telemetry tables (activity with tx hashes, feedback, funnel, chain events)
docs/PLAYBOOK.md how to build policy-bounded agent spending on Stellar β patterns, addresses, gotchas
docs/RUNBOOK.md incidents and routine: revoke, pause, withdraw; relay top-up, alerts, key rotation
COMPARISON.md where Eunomia sits among the platform pieces, funded projects and 2026 hackathon work, sourced
DEPLOYMENT.md mainnet addresses, how they were deployed, verified results
- Contracts: Rust /
soroban-sdk26 (Soroban, Stellar mainnet) - Confidential (ZK, after the beta): Circom +
circomlib(BN254) Β· snarkjs Groth16 Β· on-chain verifier viasoroban-verifier-gen(bn254_multi_pairing_check) - Agent side:
eunomia-mcpβ Model Context Protocol server over stdio + SDK, x402 v2 payment requirements - Client:
stellar contract bindings typescriptβ typed clients - Frontend: Vite + React 19 + TypeScript Β· GSAP + framer-motion Β· Playwright, including a live passkey run against production
- Onboarding: WebAuthn passkeys β Stellar smart wallets (
passkey-kit), with sponsored fees - Trust + rails: ERC-8004 agent identity + reputation-gated payees Β· escrow for pay-on-delivery Β· a bounded x402 buyer that caps an agent's pay-per-use API spend
- Non-custodial β funds never leave the owner's own contract; Eunomia cannot move funds outside the policy.
- Checks-effects-interactions β accounting is written before the transfer, so a failed or reentrant transfer reverts the whole call atomically.
- No front-runnable init β the policy is set atomically in the constructor at deploy time.
- Fee sponsorship is not custody β the account that pays transaction fees cannot redirect a payment: authority rides on the user's own signature, bound to their address. The relay that pays them is rate-limited and capped by a daily fee budget.
- No keys in the app β every signer is a wallet, a passkey or the agent's own key on its own machine; a build gate refuses any bundle that carries a secret seed.
Full security model, audit-finding status, known limitations, and how to report a vulnerability: SECURITY.md.
- Bekir Erdem β contract & engine (the Soroban treasury and core).
- Seyit Ali DeΔirmen β money system & the screen (muxed funding rail + UX).
MIT Β© 2026 Bekir Erdem Β· Seyit Ali DeΔirmen β contracts, circuits, app and clients.
The published agent package, packages/mcp (eunomia-mcp on npm), is Apache-2.0.
These licenses cover the code, not the brand: the Eunomia name, mark and logos are trademarks of Bekir Erdem and Seyit Ali DeΔirmen and are not licensed under MIT or Apache-2.0. You may use them unmodified to refer to the project; a fork must ship under its own name and logo. The full terms and the logo files are in the brand repository β see its usage policy.