Skip to content

kushwahaamar-dev/kartein

Repository files navigation

Kartein

The programmable spending firewall for autonomous AI agents.

Kartein is a policy enforcement layer that sits between AI agents and the blockchain. Every transaction is validated against configurable rules — per-transaction limits, daily caps, recipient whitelists, time restrictions, and category budgets — before it reaches the chain.

Built for Synthesis — the first builder event you can enter without a body.

Synthesis Alignment

Agents That Pay

AI agents make autonomous payments via x402. Kartein validates every transaction against programmable policies before settlement. Integration with Locus payment infrastructure on Base provides USDC spending controls with full audit trails.

Agents That Trust

Trust is programmable. Each agent operates within defined boundaries — spending limits, approved recipients, time windows. The policy engine enforces 8 sequential trust checks on every transaction. Trust isn't assumed; it's verified.

Agents That Cooperate

Multiple agents share a managed vault with individual budgets. One agent's limits don't affect another. Cooperative spending with individual accountability — agents work together without stepping on each other's resources.

Agents That Keep Secrets

Agent wallet keys are isolated per-agent and never exposed cross-boundary. Policy rules act as access control — agents can only interact with approved endpoints. The Locus integration provides gasless transactions without exposing private keys.

Architecture

Agent → x402 Payment Request → Kartein Policy Engine → Approve/Block → Settlement
                                      │
                              ┌───────┴───────┐
                              │  8 Checks:     │
                              │  1. Frozen?    │
                              │  2. Per-tx     │
                              │  3. Daily cap  │
                              │  4. Budget     │
                              │  5. Whitelist  │
                              │  6. Blocklist  │
                              │  7. Category   │
                              │  8. Time       │
                              └───────────────┘
                                      │
                              ┌───────┴───────┐
                              │               │
                          Solana          Base (Locus)
                          Devnet          Mainnet

Five-Layer Architecture

Layer Function
Vault Budget pool with per-agent allocation
Policy Engine 8 programmable validation checks
x402 Proxy Intercepts HTTP 402 payment requests
AI Monitor Anomaly detection on spending patterns
Dashboard Real-time monitoring with kill switch

Tech Stack

Component Technology
Frontend Next.js 16, React 19, TypeScript
UI Tailwind CSS, shadcn/ui, Framer Motion
State Zustand
Solana @solana/web3.js, @solana/spl-token
Base/Ethereum viem, Locus Payment API
Charts Recharts
Testing Vitest (23 tests)
Deployment Vercel

Features

  • Agent Terminal — type natural language commands, watch the policy engine respond
  • Guided Demo — 14-step scripted narrative demonstrating all policy checks
  • Real on-chain settlement — approved transactions create real Solana devnet transfers
  • Multi-chain — Solana devnet + Base mainnet (via Locus)
  • Policy Engine — 8 configurable checks per transaction
  • Kill Switch — freeze any agent or all agents instantly
  • Spending Analytics — cumulative charts with approved/blocked breakdown
  • 23 unit tests — complete policy engine test coverage

Getting Started

git clone https://github.com/kushwahaamar-dev/kartein.git
cd kartein
npm install
npm run dev

Open http://localhost:3000.

Environment Variables (optional)

# Locus API key for Base chain payments
NEXT_PUBLIC_LOCUS_API_KEY=claw_dev_your_key_here

Live Demo

Live on Vercel

Demo Flow

  1. Click "Launch Dashboard" → click "Guided Demo"
  2. Watch 14 scripted steps demonstrating all policy checks
  3. Use the Agent Terminal — type "Buy $50 of compute from AWS" → BLOCKED
  4. Request SOL airdrop → approved transactions settle on-chain
  5. Click Explorer links → verify real transactions on Solana devnet

API

Policy Check

POST /api/policy
{
  "agent": { ... },
  "amount": 10.00,
  "recipient": "0x...",
  "category": "compute"
}

Health

GET /api/health

Testing

npm test
# 23 tests covering all 8 policy checks

Bounty Tracks

This project targets:

  • Agents That Pay — x402 payment validation with Locus
  • Agents That Trust — programmable trust via policy engine
  • Agents That Cooperate — shared vault, individual budgets
  • Agents That Keep Secrets — key isolation, policy-as-access-control

License

MIT


Built at Synthesis 2026 — the first builder event you can enter without a body.

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors