Give an AI a wallet.
Keep the keys to the vault.
An AI agent holding a wallet can be talked into giving it away. Agent Allowance puts the spending limit below the AI, where words cannot reach it: a NEAR access key that can only ask, and a vault contract that decides.
A model cannot tell an instruction from a fact.
Your prompt, a web page it reads, an email it parses — it all arrives as one stream of text. Whoever controls any of that text can steer the agent.
It is unsolved
Prompt injection is ranked the top risk for LLM applications by OWASP. Every defence lowers the odds. None closes the door.
It has cost real money
In 2024 an agent called Freysa held a prize pot under one rule: never transfer it. After hundreds of attempts, someone talked it into releasing about $47,000.
A rule in a prompt is more text
A limit written into the agent's instructions or code is something an attacker can argue with or overwrite. A limit enforced by the network is not.
Two gates. Neither of them reads English.
The agent never holds the money. It holds one key that can do one thing: ask a vault to pay, within rules the owner wrote as code.
A function-call access key is bound to one contract and a list of methods, and can never attach a deposit. A leaked agent key cannot transfer funds, reach an exchange, or touch anything else on NEAR. Enforced by the network.
Per-payment cap, rolling 24-hour cap, recipient allowlist, per-agent switch and a global kill switch — the same rules for native NEAR and for every NEP-141 token.
A policy per agent, per asset.
Per-payment cap
The most a single request may move. A request above it is refused before anything else is considered.
Rolling 24-hour cap
A budget that refills on its own. Spending is debited before the transfer and restored if the transfer fails.
Recipient allowlist
Up to twenty addresses the agent may pay. Everyone else is refused, whatever the amount and whatever the reason given.
Kill switch
One call pauses every agent; another disables or revokes a single one. Both need the owner's full-access key.
Stablecoins included
NEP-141 tokens run through the same evaluator as native NEAR, so a token policy cannot drift from the rules.
On-chain audit trail
Every allowed and denied request is a NEP-297 event, including the text the agent submitted. It costs no contract storage.
What happens when the agent is compromised.
| Approach | A compromised agent can | Runs unattended | Enforced by |
|---|---|---|---|
| Agent holds a full-access key | take everything in the account | Yes | Nothing |
| Limits in the agent's prompt or code | take everything — the limit is text the attacker now controls | Yes | The agent itself |
| A human approves every payment | take nothing without a signature | No | The signers |
| Agent Allowance | only make payments the policy already permits | Yes | The NEAR protocol and a contract |
It bounds the loss; it does not prevent a permitted payment from being a foolish one. What it does not solve.
Agents under policy.
Read from agent-allowance.testnet in a single view call,
refreshed every thirty seconds.
Nothing here asks to be trusted.
Attack it
Nine attacks signed with the agent's real key: six that try to go around the vault, three that try to go through it. In the browser, or from a terminal with nothing installed.
Verify it
A read-only check of every claim on this site against the chain: the keys, the policy, the balances, the recorded transactions, and that the one private key in the repository is the restricted one.
The key is public. The money is still there.
The agent's private key is printed on the next page. Use it.