Skip to content

EfeDurmaz16/sardis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2,324 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Sardis

Open-source financial authority layer for AI agents

Sardis lets agents transact only through signed mandates, deterministic policy checks, approval paths, revocation, and audit evidence before any wallet, card, stablecoin, payment API, or provider rail is used.

Website Β· Manifesto Β· Docs Β· Playground Β· Enterprise

npm version PyPI version License GitHub stars Last commit OpenSSF Scorecard Discord


What Sardis Is

Sardis is the open-source financial authority layer for AI agents. It sits between autonomous agents and money-moving systems so every consequential financial action is checked against a mandate, policy decision, approval path, revocation path, and audit packet before execution.

Sardis is not a card wrapper, prepaid wallet, or rail-specific payment app. It governs the authority to spend across stablecoin wallets, card programs, fiat payment APIs, x402-style HTTP payments, AP2/TAP mandates, provider-hosted wallets, and simulator rails.

The core primitive is verifiable authority before an agent can spend, subscribe, purchase, refund, settle, or trigger paid usage. Customers can bring their own providers; Sardis enforces the authority layer above them without needing to custody funds or become the merchant of record.

The deeper thesis is that agents do not just have a capability problem; they have a trust problem. Sardis treats money as the sharpest version of a broader substrate problem: how non-human actors perform consequential actions with explicit authority, reviewable state transitions, and durable evidence.

Layer Open source Hosted / commercial
Authority model Mandates, policies, approvals, revocation, audit packets Same semantics with managed org, RBAC, SSO, retention, and support
Provider execution Adapter interfaces, simulator, BYO credentials Managed credential vault, webhook handling, alerts, provider routing
Developer surface SDKs, MCP server, examples, protocol adapters Hosted dashboard, approval inbox, compliance workflows, audit export

Read the boundaries:


πŸ“¦ Quick Install

# MCP Server (Claude, Cursor, ChatGPT)
npx @sardis/mcp-server start

# Python SDK
pip install sardis

# TypeScript SDK
npm install @sardis/sdk

# LangChain
pip install sardis  # Uses sardis-sdk under the hood

# CrewAI
pip install sardis  # Compatible with CrewAI tools

# OpenAI Functions
pip install sardis  # Use with OpenAI function calling

# Gemini / ADK
pip install sardis  # Compatible with Google AI SDKs

# Vercel AI SDK
npm install @sardis/ai-sdk

What Problems Sardis Solves

AI agents can draft invoices, call paid APIs, buy tools, book travel, issue refunds, subscribe to services, and interact with merchants. The missing layer is not only "payments." It is the authority system that decides whether the agent was allowed to do the financial action in the first place.

Sardis provides:

  • Mandates -- who delegated authority to the agent, for what scope, under which limits.
  • Policy firewall -- deterministic checks before execution or signing.
  • Approvals -- step-up flows for high-risk, high-value, or ambiguous actions.
  • Revocation -- stop future execution when authority changes.
  • Provider adapters -- route approved actions to wallets, cards, stablecoins, payment APIs, or simulators.
  • Audit packets -- immutable evidence for operators, customers, partners, and reviewers.

Sardis can route approved actions to provider adapters. Live-money deployments depend on the configured provider account, jurisdiction, compliance program, and customer policy.


Protocol & Feature Maturity

Feature Status Description
Spending Policy Engine Implemented Deterministic NL-to-policy, atomic spend tracking
AP2 Mandate Verification Implemented Full mandate chain verification with evidence
Provider Adapter Model Implemented Rail-agnostic execution contract and simulator-first semantics
Policy Attestation API Implemented Signed attestation envelopes with Ed25519
PreExecutionPipeline Implemented Composable hook chain with fail-closed defaults
Hosted Checkout Pilot Merchant checkout flows with session security
ERC-8183 Agentic Jobs Pilot On-chain job escrow (conservative caps: 1% fee, USDC-only)
x402 Protocol Pilot HTTP-native micropayments
Card Provider Adapters Pilot Provider-backed virtual card execution behind explicit capability checks
Stablecoin Provider Adapters Pilot Provider-backed stablecoin execution behind explicit capability checks
Multi-chain (Polygon, Arbitrum) Experimental Chain routing implemented, not production-tested
UCP MCP Transport Experimental Partial implementation
FIDES Trust Graph Experimental DID-based trust federation

Status key: Implemented = code and tests exist in the public repository. Pilot = functional with conservative limits and active hardening. Experimental = code exists, not production-tested.


Key Features

  • Provider-neutral authority layer -- govern cards, wallets, stablecoins, payment APIs, x402, AP2, TAP, and simulator rails
  • Mandates and spending policy -- "Max $50/tx, $200/day, SaaS vendors only"
  • Pre-execution policy firewall -- fail-closed checks before signing, issuing, paying, refunding, or settling
  • Approval and revocation flows -- step-up before risky actions, kill switch when authority changes
  • Provider adapter contract -- capability declarations, idempotency, signed webhooks, revocation windows, audit fields
  • 15+ AI framework integrations -- LangChain, CrewAI, OpenAI Agents, Claude SDK, Google ADK, A2A, AgentKit, Vercel AI SDK, MCP, and more
  • Agent-to-agent escrow -- Cryptographic mandate chain for A2A payments
  • KYA (Know Your Agent) -- Trust scoring and behavioral anomaly detection
  • Double-entry audit ledger -- Append-only transaction history with cryptographic proofs
  • Protocol support -- AP2 and TAP (production), x402 (pilot), UCP and A2A (partial)

πŸš€ Quick Start

Python (5 lines)

from sardis import Sardis

sardis = Sardis(api_key="sk_...")
result = sardis.payments.create(
    agent_id="agent_abc",
    amount="50.00",
    token="USDC",
    recipient="merchant@example.com"
)
print(f"Payment: {result.tx_hash}")

TypeScript

import { SardisClient } from '@sardis/sdk';

const client = new SardisClient({ apiKey: 'sk_...' });
const agent = await client.agents.create({ name: 'my-agent' });
const wallet = await client.wallets.create({
  agent_id: agent.agent_id,
  currency: 'USDC',
  limit_per_tx: '100.00',
});
const tx = await client.wallets.transfer(wallet.wallet_id, {
  destination: '0x...',
  amount: '25.00',
  token: 'USDC',
  chain: 'base_sepolia',
  domain: 'openai.com',
});

MCP (Claude Desktop / Cursor)

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "sardis": {
      "command": "npx",
      "args": ["@sardis/mcp-server", "start"]
    }
  }
}

That's it. Your agent now has a bounded financial authority surface instead of unconstrained payment access.


🎯 Framework Integrations

Framework Package Install
MCP (Claude, Cursor, ChatGPT) @sardis/mcp-server npx @sardis/mcp-server start
LangChain sardis pip install sardis
CrewAI sardis pip install sardis
OpenAI Functions sardis pip install sardis
Gemini / ADK sardis pip install sardis
Vercel AI SDK @sardis/ai-sdk npm install @sardis/ai-sdk
Claude Agent SDK sardis pip install sardis
LlamaIndex sardis pip install sardis
Mastra @sardis/sdk npm install @sardis/sdk

All frameworks use the same policy engine, mandate model, provider adapters, and audit semantics.


Architecture

Every financial action follows a single authority path before execution. There are no alternative code paths that bypass policy checks.

                         AI AGENT
              (Claude, Cursor, LangChain, OpenAI)
                          |
                     MCP / SDK
                          |
            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
            β”‚  FinancialActionOrchestratorβ”‚
            β”‚    (single entry point)    β”‚
            β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          |
            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
            β”‚   PreExecutionPipeline    β”‚
            β”‚                           β”‚
            β”‚  Composable hooks:        β”‚
            β”‚  - Policy evaluation      β”‚
            β”‚  - Spend tracking         β”‚
            β”‚  - Dedup check            β”‚
            β”‚  - Compliance gate        β”‚
            β”‚  - KYA trust scoring      β”‚
            β”‚                           β”‚
            β”‚  Fail-closed: any hook    β”‚
            β”‚  failure blocks the tx    β”‚
            β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          |
            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
            β”‚   PROVIDER ADAPTER        β”‚
            β”‚   Cards / wallets / APIs  β”‚
            β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          |
               +──────────┴──────────+
               |                     |
         Stablecoin Rails      Fiat / Card Rails
         Wallet providers      Payment providers
         x402 / AP2 / TAP      BYO provider acct
               |                     |
         β”Œβ”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”΄β”€β”€β”€β”€β”
         β”‚  LEDGER   β”‚         β”‚  LEDGER β”‚
         β”‚  Append   β”‚         β”‚  Append β”‚
         β”‚  Only     β”‚         β”‚  Only   β”‚
         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Key design principles:

  • Fail-closed -- Default deny on all policy, compliance, and security checks
  • Provider-neutral -- Sardis governs execution without requiring one custody, wallet, card, or payment provider
  • Audit everything -- Append-only ledger with signed attestation envelopes for every decision

πŸ“‚ Repository Structure

sardis/
β”œβ”€β”€ packages/               # Core monorepo packages
β”‚   β”œβ”€β”€ sardis-core/        # Domain models, config, database
β”‚   β”œβ”€β”€ sardis-api/         # FastAPI REST endpoints
β”‚   β”œβ”€β”€ sardis-chain/       # Blockchain execution, chain routing
β”‚   β”œβ”€β”€ sardis-protocol/    # AP2/TAP protocol verification
β”‚   β”œβ”€β”€ sardis-wallet/      # Wallet management, MPC
β”‚   β”œβ”€β”€ sardis-ledger/      # Append-only audit trail
β”‚   β”œβ”€β”€ sardis-compliance/  # KYC (iDenfy) + AML (Elliptic)
β”‚   β”œβ”€β”€ sardis-cards/       # Card provider adapter experiments
β”‚   β”œβ”€β”€ sardis-mcp-server/  # MCP server for Claude/Cursor
β”‚   β”œβ”€β”€ sardis-sdk-python/  # Full Python SDK
β”‚   β”œβ”€β”€ sardis-sdk-js/      # TypeScript SDK
β”‚   β”œβ”€β”€ sardis-cli/         # Command-line tool
β”‚   └── sardis-checkout/    # Merchant checkout flows
β”œβ”€β”€ sardis/                 # Simple Python SDK (public interface)
β”œβ”€β”€ contracts/              # Solidity smart contracts
β”‚   └── src/
β”‚       β”œβ”€β”€ SardisWalletFactory.sol
β”‚       β”œβ”€β”€ SardisAgentWallet.sol
β”‚       └── SardisEscrow.sol
β”œβ”€β”€ apps/
β”‚   β”œβ”€β”€ dashboard/          # React admin dashboard
β”‚   β”œβ”€β”€ landing/            # Public website
β”‚   └── canvas-site/        # Technical canvas source
β”œβ”€β”€ playground/             # Interactive demo sandbox
β”œβ”€β”€ examples/               # Usage examples
β”œβ”€β”€ demos/                  # Demo applications
β”œβ”€β”€ docs/                   # Public technical documentation
└── tests/                  # Integration tests

πŸ“š Documentation


🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Quick contribution checklist:

  • Fork the repository
  • Create a feature branch: git checkout -b feature/your-feature
  • Make your changes with tests
  • Run the test suite: uv run pytest tests/
  • Submit a pull request

Development setup:

# Clone the repository
git clone https://github.com/EfeDurmaz16/sardis.git
cd sardis

# Install dependencies
uv sync

# Run tests
uv run pytest tests/

# Start local API server
uvicorn sardis_api.main:create_app --factory --port 8000

πŸ”— Links


πŸ“„ License And Open-Core Boundary

The public repository is licensed under the terms in LICENSE. See OPEN_CORE.md for the product boundary between the open-source authority layer and the hosted Sardis Cloud operations layer.

The intended split is:

  • Open source -- mandate semantics, policy evaluation, provider interfaces, simulator providers, SDKs, protocol adapters, examples, and audit schemas.
  • Hosted / commercial -- dashboard, RBAC/SSO, approval inbox, managed provider credentials, webhook operations, compliance workflows, audit retention, alerts, and support.

Sardis -- Open-source financial authority for AI agents
Mandates | Provider Adapters | Approvals | Revocation | Audit

Built for the AI agent ecosystem
Β© 2026 Efe Baran Durmaz

About

Open-source financial authority layer for AI agents: signed mandates, policy-gated execution, approvals, revocation, and audit evidence before money moves.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors