The orchestration layer between AI agents and the financial system
Agent-agnostic. Model-agnostic. Enterprise-ready.
AgentRails connects any AI agent to payment infrastructure with the budget controls, transaction logging, and compliance that businesses demand.
As AI agents proliferate, they need to transact. But:
- LLM providers (OpenAI, Anthropic, Google) build models, not payment rails
- Agent frameworks (LangChain, CrewAI, Semantic Kernel) orchestrate reasoning, not money
- Model routers (ClawRouter, etc.) optimize inference costs, not compliance
No one owns the bottleneck between intelligent agents and the financial system.
AgentRails is payment orchestration infrastructure for the agentic economy:
| What We Do | What We Don't Do |
|---|---|
| Connect agents to financial rails | Build AI models |
| Enforce budget policies | Route to different LLMs |
| Log every transaction | Compete with agent frameworks |
| Provide audit trails | Lock you into our stack |
"The value is not in the application. It is in the connective tissue between applications, data, and decisions."
— Jordi Visser, "Palantir as Signal"
AgentRails is the connective tissue between AI agents and the financial system.
| Old Model (SaaS) | New Model (Agentic) |
|---|---|
| Per-seat pricing | Per-transaction pricing |
| Humans use software | Agents use APIs |
| Monthly subscriptions | Micropayments per action |
| $50/seat/month | $0.001 per API call |
AgentRails provides the payment rails for this new model via the x402 protocol.
Once agents are wired to AgentRails:
- Transaction history lives here
- Budget policies are configured here
- Compliance audit trails are here
- Switching means rebuilding all of it
Works with any AI agent, any framework, any model:
- OpenAI GPT-4o, Claude, Gemini, Llama, Mistral
- LangChain, CrewAI, AutoGen, Semantic Kernel
- Custom agents, enterprise agents, open-source agents
- Research options using built-in knowledge bases
- Make informed decisions via AI reasoning
- Execute USDC payments on Arc blockchain
- Manage budgets with constraint enforcement
- Settle instantly with sub-second finality
- Persist forever with PostgreSQL database
- Pay for APIs using HTTP 402 micropayments
- Monetize your APIs with one line of code
- EIP-3009 signed authorizations (gasless)
- Multi-network support (Arc, Base, Ethereum)
- Budget controls (per-transaction, daily, weekly limits)
- Destination whitelists/blacklists
- Approval workflows for high-value transactions
- Complete audit trail for compliance
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Any AI Agent │ │ AgentRails │ │ Financial │
│ │ │ │ │ System │
│ - GPT-4o │────▶│ - Orchestrate │────▶│ │
│ - Claude │ │ - Authorize │ │ - USDC │
│ - Llama │ │ - Log │ │ - Arc/Base │
│ - Custom │ │ - Settle │ │ - Banks (soon) │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│
▼
┌─────────────────┐
│ Governance │
│ │
│ - Budgets │
│ - Policies │
│ - Audit Logs │
└─────────────────┘
┌─────────────┐ ┌─────────────┐
│ AI Agent │ │ API Server │
└──────┬──────┘ └──────┬──────┘
│ │
│ 1. GET /api/protected/data │
│ ─────────────────────────────────────────► │
│ │
│ 2. 402 Payment Required │
│ X-PAYMENT-REQUIRED: {amount, payTo} │
│ ◄───────────────────────────────────────── │
│ │
│ 3. AgentRails signs EIP-3009 auth │
│ (budget check + policy validation) │
│ │
│ 4. GET /api/protected/data │
│ X-PAYMENT: {signed_authorization} │
│ ─────────────────────────────────────────► │
│ │
│ 5. Verify → Settle → Log │
│ │
│ 6. 200 OK + X-PAYMENT-RESPONSE │
│ {data + transactionHash} │
│ ◄───────────────────────────────────────── │
- .NET 8.0 SDK
- Docker Desktop (for PostgreSQL)
- Circle Developer Account
git clone https://github.com/agentrails/agentrails.git
cd agentrails
docker run --name agentrails-db \
-e POSTGRES_PASSWORD=dev_password_change_in_prod \
-e POSTGRES_DB=agentrails \
-p 5432:5432 \
-d postgres:16cd src/AgenticCommerce.API
# Circle Configuration (for blockchain settlement)
dotnet user-secrets set "Circle:ApiKey" "your-circle-api-key"
dotnet user-secrets set "Circle:EntitySecret" "your-entity-secret-hex"
dotnet user-secrets set "Circle:WalletAddress" "0xYourWalletAddress"
dotnet user-secrets set "Circle:WalletId" "your-wallet-id"
# Optional: OpenAI for built-in agent reasoning
dotnet user-secrets set "OpenAI:ApiKey" "your-openai-api-key"dotnet run --launch-profile httpsNavigate to https://localhost:7098/swagger to explore the API.
[X402Payment(0.01, Description = "Premium analysis")]
[HttpGet("analysis")]
public IActionResult Analysis()
{
var payer = HttpContext.GetX402Payer();
return Ok(new {
data = "Premium content",
paidBy = payer
});
}That's it. Your endpoint now requires $0.01 USDC per request. AgentRails handles verification, settlement, and logging automatically.
| Endpoint | Description |
|---|---|
POST /api/agents |
Create agent with budget |
POST /api/agents/{id}/run |
Execute autonomous task |
POST /api/agents/{id}/purchase |
Direct payment execution |
GET /api/agents/{id} |
Get agent state |
| Endpoint | Description |
|---|---|
GET /api/x402/protected/analysis |
Example paid endpoint ($0.01) |
GET /api/x402/protected/data |
Micropayment endpoint ($0.001) |
POST /api/x402/facilitator/verify |
Verify payment signatures |
POST /api/x402/facilitator/settle |
Execute on-chain settlement |
GET /api/x402/payments |
Payment history |
GET /api/x402/stats |
Analytics |
┌─────────────────────────────────────────────────────────────┐
│ AgentRails.API │
│ (REST Controllers + x402 Middleware) │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ ORCHESTRATION LAYER │ │
│ ├─────────────────────────────────────────────────────┤ │
│ │ • Agent lifecycle management │ │
│ │ • Budget enforcement │ │
│ │ • Policy evaluation │ │
│ │ • x402 payment handling │ │
│ │ • Transaction logging │ │
│ └─────────────────────────────────────────────────────┘ │
│ │
│ ┌──────────────────┐ ┌────────────────────────────┐ │
│ │ Blockchain │ │ Persistence │ │
│ │ • Circle DCW │ │ • Agents │ │
│ │ • Arc Network │ │ • Transactions │ │
│ │ • EVM Chains │ │ • x402 Payments │ │
│ │ • EIP-3009 │ │ • Audit Logs │ │
│ └──────────────────┘ └────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘
- Backend: ASP.NET Core 8.0 / C#
- Database: PostgreSQL 16 + Entity Framework Core 8
- Blockchain: Circle Developer Controlled Wallets + Arc
- Payments: x402 V2 Protocol (EIP-3009/EIP-712)
- Crypto: Nethereum.Signer for ECDSA signatures
- API: REST with OpenAPI/Swagger
| Network | Chain ID | Environment |
|---|---|---|
| arc-testnet | 5042002 | Development |
| arc-mainnet | TBD | Production |
| base-sepolia | 84532 | Development |
| base-mainnet | 8453 | Production |
| ethereum-sepolia | 11155111 | Development |
| ethereum-mainnet | 1 | Production |
The orchestration layer for agent payments — like Palantir connects AI to enterprise data, AgentRails connects AI agents to financial rails.
| Layer | Who Wins | Example |
|---|---|---|
| AI Models | Commoditizing | OpenAI, Anthropic, open source |
| Agent Frameworks | Fragmented | LangChain, CrewAI, Semantic Kernel |
| Model Routers | Niche | ClawRouter |
| Payment Orchestration | Winner-take-most | AgentRails |
- Not an LLM (we're model-agnostic)
- Not an agent framework (we're agent-agnostic)
- Not a model router (we don't optimize inference costs)
- Not a wallet provider (we orchestrate wallets)
For LLM cost optimization, we recommend solutions like ClawRouter. AgentRails focuses on what happens after your agent decides to act—executing compliant, auditable transactions.
For regulated industries requiring advanced governance:
- Policy Engine: Spend limits, rate limiting, destination controls
- Approval Workflows: Human sign-off for high-value transactions
- Advanced Audit: Immutable decision logs for compliance
- Multi-Tenant: Organization-level isolation
- Admin Dashboard: Real-time monitoring
Contact sales@agentrails.io for licensing.
- API keys encrypted at rest
- RSA-OAEP-SHA256 for Circle authentication
- Budget constraints enforced cryptographically
- EIP-712 typed data signing (tamper-proof)
- EIP-3009 signature verification (ECDSA recovery)
- Complete audit trail for every transaction
- Transaction Finality: <1 second (Arc deterministic finality)
- x402 Verification: <50ms
- Database Queries: <50ms (indexed PostgreSQL)
- Core orchestration infrastructure
- x402 V2 protocol implementation
- Circle/Arc blockchain integration
- Multi-network support
- Enterprise policy engine
- Multi-tenant architecture
- Fiat on/off ramps
- Additional blockchain networks
- SDK for popular languages
We welcome contributions! See CONTRIBUTING.md for guidelines.
MIT License - See LICENSE for details.
Built with:
- Circle - USDC infrastructure and Arc blockchain
- x402.org - Payment protocol specification
- PostgreSQL - Production-grade database
- Nethereum - .NET Ethereum library
- GitHub Issues: Create an issue
- Sales: sales@agentrails.io
- Twitter: @agentrails
AgentRails: The connective tissue between AI agents and the financial system.
Built for the agentic economy.