leash®
A SPENDING FIREWALL
FOR AI AGENTS ON NEAR
PERSONAL SECURITY SYSTEM
EST. 2026 / VOL. 01
LEASH 5150
AGENT SPENDING CONTROL UNIT
SYSTEM READY
LEASH OS v1.0Demo mode: synthetic dataNEAR / TESTNET DEMO
01 / POLICY LAB

Your agent. Your rules.

Set the boundaries in plain English.
Leash turns them into a policy your agent can’t talk its way around.

WRITE THE RULESINPUT / 01
PLAIN ENGLISH → DETERMINISTIC RULES149/1600
No AI guesswork.
Just rules you can read.
What can I write?

Separate rules with semicolons or newlines. Try “only methods brew on coffee.near”, “block evil.near”, “only tokens NEAR”, or “only between 9am and 9pm”. Missing fields use the documented defaults.

COMPILED POLICYACTIVE
Daily budget
2 NEAR
Per payment
0.5 NEAR
Ask human above
0.3 NEAR
Payment frequency
5 / hour
Active hours · IST
All hours
Allowed receivers
coffee.nearweather.near
Allowed tokens
NEAR
Method constraints
All methods unless restricted
Every proposed action is checked against these rules.
NEAR function-call access keys2 KEY SPECS

Preview the native NEAR permissions. A function-call key restricts receivers, methods and gas allowance; Leash supplies the additional policy checks.

coffee.near
{
  "receiver_id": "coffee.near",
  "method_names": [],
  "allowance": "2000000000000000000000000"
}

Command template · substitute your account and public key. Running it yourself adds a key on testnet.

near account add-key YOUR_ACCOUNT.testnet grant-function-call-access --allowance '2 NEAR' --receiver-account-id 'coffee.near' --method-names '' use-manually-provided-public-key YOUR_PUBLIC_KEY network-config testnet sign-with-keychain send
weather.near
{
  "receiver_id": "weather.near",
  "method_names": [],
  "allowance": "2000000000000000000000000"
}

Command template · substitute your account and public key. Running it yourself adds a key on testnet.

near account add-key YOUR_ACCOUNT.testnet grant-function-call-access --allowance '2 NEAR' --receiver-account-id 'weather.near' --method-names '' use-manually-provided-public-key YOUR_PUBLIC_KEY network-config testnet sign-with-keychain send
  • Preview only. Leash never runs these commands. Replace YOUR_ACCOUNT.testnet and YOUR_PUBLIC_KEY with your account and an existing public key; use a distinct key for each receiver.
  • Allowance limits cumulative gas fees, not transferred value or a daily budget. This preview uses the daily budget as a gas-allowance suggestion; choose an appropriate gas cap before running it.
  • Function-call keys cannot make native transfers or attach deposits. Standard ft_transfer needs a 1-yocto deposit, so this key cannot directly authorize it.
  • Daily resets, per-payment caps, hourly limits, human approval, token rules, argument checks and time windows require a trusted runtime or on-chain enforcement beyond an access key.
  • One receiver per function-call key: create one key per receiver. Splitting keys does not enforce a shared budget.
  • coffee.near: empty method_names means ALL contract methods. Add an explicit method rule to reduce authority.
  • weather.near: empty method_names means ALL contract methods. Add an explicit method rule to reduce authority.
Policy JSON & compiler defaults
{
  "dailyBudgetYocto": "2000000000000000000000000",
  "perTxCapYocto": "500000000000000000000000",
  "allowlist": [
    "coffee.near",
    "weather.near"
  ],
  "blockedReceivers": [],
  "allowedMethods": {},
  "askHumanAboveYocto": "300000000000000000000000",
  "maxTxPerHour": 5,
  "activeHours": null,
  "allowedTokens": [
    "NEAR"
  ]
}

Defaults: 2 NEAR/day, 0.5/payment, ask above 0.3, 5/hour, NEAR only, no receivers until specified. All hours are IST; daily budgets reset at midnight IST.

A later recognized clause replaces the same setting; block clauses accumulate. Missing method rules permit all methods. Review the compiled policy before use.

NEXT STEPLet’s see what gets through.
VIEW ONLY. NO KEYS. NO TRANSACTIONS.
TRUST IS GOOD. BOUNDARIES ARE BETTER.