Skip to main content

The Payment Infrastructure Layer for Autonomous AI Agents

Project description

OmniClaw

Economic Execution and Control Layer for Agentic Systems โ€” Policy-controlled payments with Circle Gateway nanopayments (EIP-3009), x402 protocol support, gasless transactions, and per-agent wallet isolation.

๐Ÿ“ฆ PyPI ยท ๐Ÿงช Tests: 1220 passed


Why OmniClaw?

In the Agent Era, software can act economically. But current wallets fail when software, not humans, is the operator:

  • Full key access = extreme risk (agent can drain the wallet)
  • Human approval = kills speed and autonomy
  • No spending limits = agent can spend unlimited

Where Stripe helps merchants accept human payments, OmniClaw governs autonomous agents making machine payments โ€” with policy, trust verification, and concurrency safety built in.

OmniClaw solves this by separating:

  1. Financial Policy Engine (owner runs) - holds private keys, enforces policy
  2. Execution Layer (agent uses) - thin CLI that only does what policy allows

The agent never touches the private key. It only talks to the CLI. The owner decides what the agent can do via policy.json.


Architecture: Three Components

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                         OMNICLAW SYSTEM                            โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                     โ”‚
โ”‚   OWNER SIDE (runs the Financial Policy Engine)   AGENT SIDE (uses CLI)     โ”‚
โ”‚   โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•   โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•   โ”‚
โ”‚                                                                     โ”‚
โ”‚   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚   โ”‚  Financial Policy Engine   โ”‚                โ”‚     OmniClaw CLI   โ”‚   โ”‚
โ”‚   โ”‚  (uvicorn server)          โ”‚โ—„โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บโ”‚  (thin client)     โ”‚   โ”‚
โ”‚   โ”‚                            โ”‚   HTTPS        โ”‚                    โ”‚   โ”‚
โ”‚   โ”‚  - Holds private key       โ”‚                โ”‚  - pay             โ”‚   โ”‚
โ”‚   โ”‚  - Enforces policy         โ”‚                โ”‚  - deposit         โ”‚   โ”‚
โ”‚   โ”‚  - Signs transactions      โ”‚                โ”‚  - withdraw        โ”‚   โ”‚
โ”‚   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ”‚            โ”‚                                      โ”‚                 โ”‚
โ”‚            โ”‚      Circle Nanopayment             โ”‚                 โ”‚
โ”‚            โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                 โ”‚
โ”‚                           โ”‚                                          โ”‚
โ”‚                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”                                  โ”‚
โ”‚                    โ”‚   Circle    โ”‚                                  โ”‚
โ”‚                    โ”‚   Gateway   โ”‚                                  โ”‚
โ”‚                    โ”‚   (USDC)    โ”‚                                  โ”‚
โ”‚                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                                  โ”‚
โ”‚                                                                     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Why Two Parts?

Component Who Runs It What It Does
Financial Policy Engine Owner/human Holds private key, enforces policy, signs transactions
CLI (agent uses) Agent Thin client - sends requests, gets responses. Cannot bypass policy

Key Concepts

1. Two Wallets Every Agent Has

Every agent has two wallets:

Wallet How It Works
EOA (External Owned Account) Derived from OMNICLAW_PRIVATE_KEY. Holds actual USDC on-chain. Used to sign deposits.
Circle Developer Wallet Created via policy.json. Where withdrawn funds go. The "circle wallet."

2. Why Deposit + Pay + Withdraw?

Your USDC starts here:         Then moves here:              Ends up here:
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   EOA    โ”‚ โ”€depositโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บ โ”‚  Gateway   โ”‚ โ”€โ”€payโ”€โ”€โ”€โ”€โ”€โ”€โ–บ โ”‚    Seller    โ”‚
โ”‚ (on-chain)โ”‚   (on-chain)    โ”‚  Contract  โ”‚   (x402)     โ”‚    EOA       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                  โ”‚                              โ”‚
                                  โ”‚ withdraw                     โ”‚
                                  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บ Circle Developer Wallet
  • Deposit: Move USDC from your EOA โ†’ Gateway (on-chain, costs gas)
  • Pay: Use Gateway for gasless payments (x402 protocol)
  • Withdraw: Move USDC from Gateway โ†’ your Circle wallet

3. Why Gasless Nanopayments?

Circle's Gateway supports EIP-3009 - off-chain authorization:

  • No gas needed for payments
  • Instant settlement
  • Circle batches and settles on-chain
  • Sub-cent transactions are economically viable

This is what makes agent-to-agent commerce practical โ€” agents can trade at high frequency without bleeding gas on every transaction.

4. Seller Side: Accept Payments from Other Agents

OmniClaw isn't just for buyers. You can protect your own endpoint behind x402 and accept payments from other agents:

from omniclaw.protocols.nanopayments import GatewayMiddleware

# Protect any async endpoint
middleware = GatewayMiddleware(
    price="0.01",  # 0.01 USDC per call
    seller_address="0xYourAddress",
)

app = FastAPI()
app.add_middleware(GatewayMiddleware, price="0.01")

@app.get("/api/data")
async def get_data():
    return {"data": "expensive information"}

This opens your service to agent-to-agent commerce โ€” other agents can pay your endpoint using gasless nanopayments.


Quick Start

1. Install

pip install omniclaw
# or
uv add omniclaw

2. Environment Variables (Required)

# Required to run
export OMNICLAW_PRIVATE_KEY="0x..."     # Your agent's private key
export OMNICLAW_AGENT_TOKEN="your-token" # Token from policy.json
export OMNICLAW_AGENT_POLICY_PATH="/path/to/policy.json"
export CIRCLE_API_KEY="your-circle-key" # Circle API key

# Network (testnet or mainnet)
export OMNICLAW_NETWORK="ETH-SEPOLIA"    # or ETH-MAINNET
export OMNICLAW_ENV="production"         # set for mainnet

# RPC for on-chain operations
export OMNICLAW_RPC_URL="https://..."
# Nanopayments CAIP-2 is derived from OMNICLAW_NETWORK (EVM only)

3. Start Financial Policy Engine (Owner)

uvicorn omniclaw.agent.server:app --port 8080

This runs the Financial Policy Engine that holds the private key and enforces policy.

4. Configure CLI (Agent)

Agent runtime should set these (no interactive setup required):

export OMNICLAW_SERVER_URL="http://localhost:8080"
export OMNICLAW_TOKEN="your-agent-token"

Optional: persist config locally for dev workflows:

omniclaw-cli configure --server-url http://localhost:8080 --token your-token --wallet primary

CLI output is agent-first (JSON, no banner). For human-friendly output set:

export OMNICLAW_CLI_HUMAN=1

Note: omniclaw and omniclaw-cli point to the same CLI.


For BUYERS (Paying for Services)

Step 1: Get USDC

Send USDC to your EOA address (derived from OMNICLAW_PRIVATE_KEY)

Step 2: Deposit to Gateway

omniclaw-cli deposit --amount 10

โ†’ Moves USDC from EOA โ†’ Circle Gateway contract (on-chain, costs gas)

Step 3: Pay for Services

# Pay another agent
omniclaw-cli pay --recipient 0xDEAD... --amount 5

# Or pay for x402 service (URL)
omniclaw-cli pay --recipient https://api.example.com/data --amount 1

โ†’ Uses gasless nanopayments via x402 protocol (Gateway CAIP-2 derived from OMNICLAW_NETWORK, EVM only)

Step 4: Withdraw to Circle Wallet

omniclaw-cli withdraw --amount 3

โ†’ Moves USDC from Gateway โ†’ your Circle Developer Wallet


For SELLERS (Receiving Payments)

Option A: Simple Transfer

Just share your address, receive payments directly:

omniclaw-cli address  # Get your address to share

Option B: x402 Payment Gate (Recommended)

Expose your service behind payment:

omniclaw-cli serve \
  --price 0.01 \
  --endpoint /api/data \
  --exec "python my_service.py" \
  --port 8000

This opens http://localhost:8000/api/data that requires USDC payment to access.


Complete CLI Commands

Command Description Example
configure Set server URL, token, wallet configure --server-url http://localhost:8080 --token mytoken --wallet primary
address Get wallet address address
balance Get wallet balance balance
balance-detail Detailed balance (EOA, Gateway, Circle) balance-detail
deposit Deposit USDC to Gateway deposit --amount 5
withdraw Withdraw to Circle wallet withdraw --amount 2
withdraw-trustless Trustless withdraw (~7-day fallback) withdraw-trustless --amount 2
withdraw-trustless-complete Complete trustless withdraw after delay withdraw-trustless-complete
pay Make payment pay --recipient 0x... --amount 5
simulate Simulate payment simulate --recipient 0x... --amount 5
serve Expose x402 payment gate serve --price 0.01 --endpoint /api --exec "echo hello"
status Agent status status
ping Health check ping
ledger Transaction history ledger --limit 20

Default Policy.json

Copy and edit examples/policy-simple.json:

For full policy options, see docs/POLICY_REFERENCE.md

{
  "version": "2.0",
  "tokens": {
    "YOUR_AGENT_TOKEN": {
      "wallet_alias": "primary",
      "active": true,
      "label": "Your Agent Name"
    }
  },
  "wallets": {
    "primary": {
      "name": "Primary Wallet",
      "limits": {
        "daily_max": "100.00",
        "per_tx_max": "50.00"
      },
      "recipients": {
        "mode": "allow_all"
      }
    }
  }
}

Environment Variables Reference

Variable Required Description
OMNICLAW_PRIVATE_KEY Yes Agent's private key for signing
OMNICLAW_AGENT_TOKEN Yes Token matching policy.json
OMNICLAW_AGENT_POLICY_PATH Yes Path to policy.json
OMNICLAW_NETWORK No Network (ETH-SEPOLIA, ETH-MAINNET)
OMNICLAW_ENV No Set to "production" for mainnet
OMNICLAW_RPC_URL No RPC endpoint for on-chain ops
CIRCLE_API_KEY Yes Circle API key
OMNICLAW_SERVER_URL No CLI server URL (for configure)

Documentation


License

MIT โ€” ยฉ 2026 Omnuron AI. See LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

omniclaw-0.0.3.tar.gz (207.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

omniclaw-0.0.3-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file omniclaw-0.0.3.tar.gz.

File metadata

  • Download URL: omniclaw-0.0.3.tar.gz
  • Upload date:
  • Size: 207.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for omniclaw-0.0.3.tar.gz
Algorithm Hash digest
SHA256 8aa8f0d40237a89220719f131ee6f34b5592f536a0a4254f4c1f912c3f8c5634
MD5 4ce3a8c30a051fb6930ec3178c05e449
BLAKE2b-256 bc97150ce9404804ac6bed00434fcd6f041cb59f1aff691d2aa09416c49732eb

See more details on using hashes here.

File details

Details for the file omniclaw-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: omniclaw-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for omniclaw-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6944d073f8dd91efea2a6fe719e39e35f0b8c2b211bf4e11156dac9285166eae
MD5 ea2893d0689e2f286804323a21bfacac
BLAKE2b-256 f6153b360c0ee59224007712cdfcc1d8aaf621e2bc2d4af0a7c1e64e69d89ca5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page