REIN
Sign inGet started
Getting started

Quick start

Get REIN running with your AI agent in under 90 seconds. This guide covers Claude Code (MCP) — see the sidebar for other runtimes.

01

Create a vault

Open the REIN dashboard and connect your Solana wallet. Click New vault — this writes a Policy PDA on Solana devnet and gives you a vault address.

Open dashboard
02

Set your policy

In the policy editor, configure your spending rules. These are written to your Policy PDA — not stored in a database.

// Example policy (set in the dashboard UI)
{ "daily_cap_usdc": 50.00, // max per UTC day "per_tx_cap_usdc": 5.00, // max per transaction "step_up_threshold": 10.00, // pause & notify above this "allowlist": ["api.brave.com", "api.anthropic.com"] }
03

Install the MCP server (Claude Code / Cursor)

Run rein init in your project root. It auto-detects your runtime and writes the MCP config.

npx rein init

Paste your vault address when prompted. The CLI writes .rein/config.json and injects the MCP server into your Claude Code or Cursor settings.

04

Make your first spend

Your agent now has access to rein_spend, rein_balance, and rein_history as MCP tools. For the TypeScript SDK:

// TypeScript SDK
import { ReinClient } from '@rein/sdk'; const rein = new ReinClient({ vault: 'YOUR_VAULT_ADDRESS', network: 'devnet' }); // Enforced on-chain — will throw PolicyViolationError if rules fail const receipt = await rein.spend({ recipient: 'api.brave.com', amount_usdc: 0.02, memo: 'web search' }); console.log(receipt.signature); // Solana tx sig
What happens on success

Funds move. A Receipt PDA is created in the same transaction. Your dashboard updates in real time via WebSocket.

What happens on violation

Transaction reverts. No funds move. The agent receives a typed PolicyViolationError with the specific rule that failed.

Claude Code integration Python SDK