Documentation · v0.1 · mainnet

Use LeashFi
with confidence.

A practical guide to putting an AI agent behind deterministic policies on Robinhood Chain and Robinhood Agentic Trading.

ROBINHOOD CHAINMAINNET · 4663
01 · The model

What LeashFi does

LeashFi is the control layer between an AI agent and financial execution. The agent can create an intent, but policy decides whether that intent is allowed, needs owner approval, or must be blocked.

CHAIN PAYMENTS

Policy-enforced vault

Payments execute through the LeashFiVault on Robinhood Chain. Caps and recipient rules are enforced onchain.

AGENTIC TRADING

Fail-closed MCP gateway

Trading write tools are evaluated before they reach Robinhood's official remote MCP connection.

Trust boundaryThe agent signs chain transactions with its own key. The owner controls policy and approvals. Brokerage OAuth stays with the user's MCP client.
02 · First run

Quick start

For the first workspace, the dashboard is the fastest path. You do not need to generate an agent key inside LeashFi.

  1. Connect the owner wallet. Open the dashboard and sign the EIP-191 challenge. This wallet owns the workspace and reviews sensitive actions.
  2. Register the agent. Go to Dashboard → Agents, add a name and the agent's public EVM address, then select Chain or Trading MCP.
  3. Set guardrails. Configure daily cap, per-recipient cap, allowlists/blocklists, allowed assets, symbols, order types, and an approval threshold.
  4. Create an API key. In Settings → API keys, create a key and copy it immediately. Store it as a server-side secret.
  5. Fund and run. For Chain payments, fund the configured vault and the agent with enough ETH for gas. For trading, connect Robinhood through its official OAuth flow.
  6. Watch the dashboard. Use Activity, Approvals, and the LFI utility card to see execution, blocks, pending reviews, and usage.
Important: LeashFi registers an existing agent address. It does not create or persist the agent private key.
03 · Robinhood Chain

Run a Chain payment

Use @leashfi/sdk from your agent service. The SDK verifies the agent, loads the current policy, checks spend, and then submits directly to the policy vault. Use network: "mainnet" for chain ID 4663.

import { privateKeyToAccount } from "viem/accounts"
import type { Address, Hex } from "viem"
import { LeashFi, ROBINHOOD_ASSETS } from "@leashfi/sdk"

const agent = new LeashFi({
  account: privateKeyToAccount(process.env.AGENT_PRIVATE_KEY as Hex),
  network: "mainnet",
  vaultAddress: process.env.LEASHFI_VAULT_ADDRESS as Address,
  apiKey: process.env.LEASHFI_API_KEY!,
  walletId: process.env.LEASHFI_WALLET_ID!,
})

const result = await agent.pay({
  to: "0xRecipientAddress",
  amount: 60_000_000n, // 60 USDG, 6 decimals
  asset: ROBINHOOD_ASSETS.USDG,
  memo: "agent invoice",
})

console.log(result.status, result.transactionHash)
AssetDecimalsExample
ETH181 ETH = 1_000_000_000_000_000_000n
WETH181 WETH = 1e18
USDG660 USDG = 60_000_000n

A payment returns success, pending_approval, blocked, or a failure status. Keep the returned transaction hash and approval ID in your agent logs.

04 · Robinhood brokerage

Guard Agentic Trading

Robinhood brokerage access remains an OAuth connection between the user's MCP client and Robinhood. LeashFi sits in front of tool execution: read-only tools pass through, known order writes are checked, and unknown writes fail closed.

import {
  RobinhoodTradingGateway,
  TradingPolicyEngine,
} from "@leashfi/sdk"

const gateway = new RobinhoodTradingGateway(
  new TradingPolicyEngine({
    maxOrderNotionalUsd: 250_000_000n,
    dailyTradingNotionalUsd: 1_000_000_000n,
    tradedTodayUsd: 0n,
    allowedSymbols: ["AAPL", "MSFT", "BTC"],
    allowedOrderTypes: ["market", "limit"],
    allowOptions: false,
    allowCrypto: true,
    requireReview: true,
  }),
  callOfficialRobinhoodMcp,
  parseOrderIntent,
)

await gateway.callTool(toolCall)
Approval behaviorIf the trading policy returns approval, do not retry the write blindly. Show the owner the pending request, resolve it in Dashboard → Approvals, then retry only after approval.
Robinhood Agentic Trading connection guide ↗
05 · Control surface

Policies and approvals

Policies are the rules that every request must satisfy. Use the smallest permissions your agent needs, then expand deliberately.

SpendDaily and per-recipient caps, tracked independently per asset.
RoutingAllowlist or blocklist recipients and assets.
TradingSymbols, order types, options, crypto, order notional, and daily exposure.
Human reviewPause above-threshold actions for owner approval with expiry and replay protection.

A blocked request is not an approval request. A request above the configured threshold can wait for approval; an unknown tool, invalid address, or policy violation is rejected.

06 · Utility layer

$LFI, tiers, and API credits

LFI is optional for basic access and stays in the user's wallet. The application reads the wallet's LFI balance on Robinhood Chain and derives a tier for workspace entitlements.

HOLDERpositive balance2 agents · 500 credits/day
PRO1,000 LFI5 agents · 5,000 credits/day
TEAM10,000 LFI20 agents · 25,000 credits/day
Credits are not gas. They are server-side daily API request allowances. Current credit consumption applies to SDK payment-spend and trading-evaluation requests; it does not transfer or burn LFI.

Token contract: 0x2A09f1AB7FA98eC1b733814E49a0806b4f3333F3 · chain ID 4663.

07 · Before launch

Production checklist

  • Use a dedicated owner wallet and keep its private key out of the agent runtime.
  • Use a separate agent signer with only the permissions it needs.
  • Set conservative caps first; test a success, a block, and an approval path.
  • Keep API keys in server-side environment variables. Never commit them to GitHub or expose them in browser code.
  • Use a production RPC URL and confirm chain ID 4663 before sending funds.
  • Monitor approvals and blocked actions; treat unknown writes as expected failures.
Ready to operate?

Open your LeashFi workspace.

Get started →