Skip to main content
Loading…
AS Albert Schaper
  • 01Home
    • Profile & Career
    • Expertise
    • Overview
    • Results
    • Technical Depth
  • 04Projects
  • 05Contact
  • 06Insights
  • 07Tools
AS

Albert Schaper

01Home
Profile & CareerExpertise
OverviewResultsTechnical Depth
04Projects05Contact06Insights07Tools

AI · Finance · Entrepreneur

Home / Insights / AI Agent Wallets: Protect Keys and Enforce Spending Limits
Insights

AI Agent Wallets: Protect Keys and Enforce Spending Limits

Protecting a key does not prevent a bad payment. A practical architecture, spending policy, adversarial tests and incident-response sequence.

By Albert Schaper AI Expert & Entrepreneur
30 September 2026 ·Updated 10 November 2026 AI AgentsCrypto
Auf Deutsch lesen LinkedIn X
The short version, in 30 seconds
  • The agent does not need to know the private key. It proposes a payment order; a separate system checks and signs.
  • A securely stored key does not prevent a wrong payment. What matters is that the signing service checks proposals and does not accept every one.
  • The spending rule must limit the actual action, not just the intent; session keys only limit what the implementation really checks.
  • MPC and secure execution environments solve different problems than spending limits; they do not replace the check.
  • Test the forbidden cases before real money, and build the stop so that existing rights are revoked too.
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:

  1. An outside page tells the agent to swap the recipient. The proposed payment is rejected.
  2. Two orders try at the same time to spend the last of the available budget. Only the permitted reservation succeeds.
  3. An approved contract is called with a forbidden function, or with an unlimited token allowance. The signature is refused.
  4. An order times out after it was submitted. No new payment is created until the earlier status is resolved.
  5. 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

SourceTypeLevelWhat for
OWASP: Excessive AgencySecurity standardBeginnerWhy too many functions, permissions and too much autonomy drive the risk; the basis for the spending rule.
How a wallet actually worksArticle on this siteBeginnerTelling seed, key and address apart before you plan permissions.
Using a hardware wallet rightArticle on this siteBeginnerCustody of your own holdings, as distinct from agent wallets.
ERC-4337Ethereum standardAdvancedAccount abstraction: accounts with their own validation logic for transactions.
EIP-7702Ethereum standardAdvancedLets an account delegate code; relevant to session keys and security considerations.
NIST: Threshold CryptographyGovernment projectAdvancedBackground on MPC and threshold schemes.
Model Context ProtocolSpecificationIntermediateHow agents call tools; shows where permission boundaries run.
Self-custody quiz and seed phrase validatorTools on this siteBeginnerCheck your own custody.
Transaction Decoder, Function Selector, ABI Decoder and Address ValidatorTools on this siteIntermediateMake 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 checksumsArticles on this siteBeginnerBackground 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

  • NIST: Multi-Party Threshold Cryptography.

  • 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.
More Insights
  • AI Agents

    When AI Agents Pay: Approvals, Fees and Preventing Duplicate Payments

    From purchase request to reconciled receipt: what payment protocols address, how tiny payments can become economical, and what to do after a timeout.

  • AI Agents

    Hermes or OpenClaw: The Agent That Stays On

    You want an agent on a machine that stays on. OpenClaw is the gateway. Hermes is the worker runtime, with an optional hosted agent. Hosting, skills and day-to-day checks differ.

  • Crypto

    How Calldata Is Laid Out: Selector, Arguments, and Offsets

    After the selector's four bytes, arguments follow in 32-byte words. Static values sit in place, dynamic values point onward with an offset measured without the selector.

Albert Schaper
About the author

AI expert and entrepreneur with a finance background and a focus on execution. I support companies as a partner and partly with own capital, mainly on strategy, financing and sales, and advise teams on putting AI to work. LinkedIn

← All Insights
AS

AI · Finance · Entrepreneur

Navigation

HomeAboutExpertiseProjectsContactInsightsTools

Projects

Best-AI.orgBitAutorGeld 2.0Pharmaceutical company

Tools

ETH Unit ConverterAddress ValidatorQR Code GeneratorSeed Phrase ValidatorWallet Generator

© Albert Schaper. All rights reserved.

Privacy / Imprint