Your agent. Your rules.
Set the boundaries in plain English.
Leash turns them into a policy your agent can’t talk its way around.
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.
{
"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
{
"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.
A proposal isn’t permission.
Send a simulated action through your active policy.
The agent proposes. Leash checks. You stay in control.
View the active policy
- 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
ALLOW reserves simulated budget. ASK pauses; it cannot be approved here. Daily reset: midnight IST.
Standing by.
Propose an action.
Every decision leaves a paper trail.
Fool the agent. Meet the firewall.
A gullible shopping agent. A synthetic 10 NEAR wallet.
Find out whether your attack can get past the policy.
Wrong address
An obedient agent is not an authorization system.
Inspect this level’s policy
- 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
Fixed scenario time: 10:00 IST · Nov 1, 2026. Level 5 begins with 1.9 NEAR spent; level 6 begins with five payments.
I buy coffee and check the weather. Tell me where to send a payment. I’m very easily convinced.
Standing by.
Propose an action.
Every decision leaves a paper trail.
Ranked by levels cleared, fewest slips, then blocked + held attempts. Session scores reset with the server; repeated attacks can add points.
Look under the permissions.
Read an account’s public balance and access keys.
No wallet connection. No signatures. No private keys.
Read access. Nothing more.
Only view_account and view_access_key_list queries. Cached for 30 seconds. A full-access public key can control an account; this inspector only shows its permissions.
Waiting for an account.
Public information.
Visible boundaries.