Contents
- Four responsibilities need separate owners
- A spending policy must constrain the actual action
- Session keys restrict only what the implementation enforces
- MPC and trusted execution environments address different problems
- Test prohibited actions before using real money
- Stopping the agent must account for existing permissions
- Further reading by level
- Sources
- Read next
An agent may buy a dataset. The order names the supplier and the price. Arbitrary recipients and a budget the agent raises itself are out. It does not need the private keys for that: it proposes a payment, and a separate system checks the proposal and signs only when recipient, action and amount are allowed.
If that service signs whatever it is handed, a key in a vault does not help. The limit has to live in the check, and the check has to be tested before real funds are involved. Protocol sources were reviewed on October 10, 2026.
Four responsibilities need separate owners
The agent opens with a proposal: this dataset, this supplier, this price. Policy enforcement matches it against the allowed recipients, actions and amounts, and subtracts what is already reserved.
Signing comes after that, and only for payment data that is fully specified. A later step has to establish whether the payment executed and whether the dataset arrived. No reply means the status is unknown. It does not justify a second payment.
Four computers are not required. The agent must not be able to edit the rules or skip them. A narrow payment tool is wasted if an unbounded signing call sits beside it.
The check can sit in a trusted service, in the wallet contract, or in both. OWASP describes the underlying risk as excessive agency: the more functions, permissions and autonomy a system is given, the larger the damage from a mistake or from manipulated input.
A spending policy must constrain the actual action
A fictional test order: at most €2 per dataset and €20 per day, one approved supplier. A number written into the prompt is not a control. The technical rule has to pin down more than that:
- Network and asset: an approved chain ID and the exact token contract address. A ticker symbol is not enough. A euro cap needs a conversion rule, a price source and a defined response when the price is stale.
- Recipient and function: an approved destination, a permitted contract function and checked arguments. An approved router must not be able to insert an arbitrary recipient further down the call.
- Amount: a per-purchase cap and an aggregate cap across concurrent orders, including reserved amounts and fees.
- Time and replay: an expiry, one order that maps cleanly to the payment, and a suitable nonce or other replay lock.
- Permission changes: no autonomous upgrades, key changes, new delegations or unlimited token allowances.
Integer amounts have to use the token decimals correctly. Every action inside a batch is checked on its own. Unknown functions, and signing requests that cannot be interpreted, are rejected or sent to a human review step defined for that case.
What a proposal would actually trigger can be read before anything is signed. The Transaction Decoder reads recipient, value and nonce from a raw transaction. The Function Selector and the ABI Decoder translate the 4-byte selector and the calldata into a readable function and its arguments. The Address Validator checks the format and checksum of a recipient address. It does not prove that this is the approved recipient; that remains the allow-list in the policy check.
Session keys restrict only what the implementation enforces
A session key is limited by time or by function. How tight that limit is depends on the wallet implementation, not on the name. “May spend €20” fails if the same key can also sign an unlimited approve for an attacker.
ERC-4337 is the account-abstraction plumbing: a UserOperation, bundlers and an EntryPoint. It does not attach a finished spending policy to every smart account. Whether session limits exist, and where they are enforced, has to be verified in the implementation in use.
EIP-7702 lets an ordinary Ethereum account delegate code execution to an implementation. The delegation stays until it is changed or cleared. It is not scoped to a single transaction. Usable agent permissions still come from that implementation and from authorization that is actually correct.
Test the ordinary payment, and the ways around it: allowances, batched calls, admin functions.
MPC and trusted execution environments address different problems
In a suitable MPC signing scheme, several parties sign together from key shares. One party cannot complete a signature alone. Whether a complete key ever existed is a separate question, and it depends on generation, import and recovery. The label MPC settles neither that history nor whether the purchase was the right one.
A trusted execution environment can isolate code and data from some access by the surrounding system. It still needs a threat model that fits, reviewed code, and a deliberate handling of attestation and updates. A wrong authorization rule is still wrong after it is moved inside.
Two questions stay separate. Who can reach the signing material? Which actions can be authorized with it? The first answer does not supply the second.
Test prohibited actions before using real money
The first checks belong in an isolated environment: simulated payments, or testnet assets with no value. Production seeds do not go in there. These five cases make a usable acceptance set:
- An outside page tells the agent to swap the recipient. The proposed payment is rejected.
- Two orders try at the same time to spend the last of the available budget. Only the permitted reservation succeeds.
- An approved contract is called with a forbidden function, or with an unlimited token allowance. The signature is refused.
- An order times out after it was submitted. No new payment is created until the earlier status is resolved.
- An expired or revoked session key is used again. The action fails at the component that actually enforces the limit.
Record which rule stopped the attempt. A model that happens to be careful does not pass this test.
Stopping the agent must account for existing permissions
In an incident, halt new approvals and new signatures first. Then list what is already live: pending transactions, token allowances, active delegations, session keys, remaining balances.
Changing the key does not, by itself, cancel permissions a contract has already granted. Revoking those and securing the remaining funds needs an admin path set up in advance, preferably one the agent cannot use. Payments that have already settled are not undone. Actions still in flight can land while the response is running.
Rehearse that sequence before real funds are used: named owners, fallback access, records that can be traced. The wallet is limited when the limit still holds after something fails.
Further reading by level
| Source | Type | Level | What for |
|---|---|---|---|
| OWASP: Excessive Agency | Security standard | Beginner | Why too many functions, permissions and too much autonomy drive the risk; the basis for the spending rule. |
| How a wallet actually works | Article on this site | Beginner | Telling seed, key and address apart before you plan permissions. |
| Using a hardware wallet right | Article on this site | Beginner | Custody of your own holdings, as distinct from agent wallets. |
| ERC-4337 | Ethereum standard | Advanced | Account abstraction: accounts with their own validation logic for transactions. |
| EIP-7702 | Ethereum standard | Advanced | Lets an account delegate code; relevant to session keys and security considerations. |
| NIST: Threshold Cryptography | Government project | Advanced | Background on MPC and threshold schemes. |
| Model Context Protocol | Specification | Intermediate | How agents call tools; shows where permission boundaries run. |
| Self-custody quiz and seed phrase validator | Tools on this site | Beginner | Check your own custody. |
| Transaction Decoder, Function Selector, ABI Decoder and Address Validator | Tools on this site | Intermediate | Make a payment proposal readable before signing: recipient, nonce, function, arguments, address format. |
| What is a nonce?, How calldata is laid out, What the 4-byte selector means and Why addresses need checksums | Articles on this site | Beginner | Background on the fields the policy check compares. |
For the payment itself: What happens when AI agents pay for themselves. For cost and benefit: What an AI agent actually costs.
Sources
-
Intel: Software Guard Extensions.
-
OWASP: LLM06:2025 Excessive Agency — risks of excessive functionality, permissions and autonomy.
-
Ethereum: ERC-4337 and EIP-7702 — specifications and security considerations.
Read next
- When AI agents pay — reconcile payments and deliveries reliably.
- How a wallet works — distinguish seeds, keys and addresses.
- Geld 2.0 — understand digital value and its control.