Join our Newsletter — 33% off our NHI Course
Home› Guides› AI Agents with Crypto Wallets Security Guide: Scoped…
Guide Fraud Prevention

AI Agents with Crypto Wallets Security Guide: Scoped Keys, Spending Limits and Safe Signing

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 27 October 2026 13 min read
On this page

An AI agent that holds a wallet key can be talked into an irreversible transfer by a single injected instruction, and on-chain there is no fraud team to call and no chargeback. Agents are now being given wallets to pay for APIs, trade, rebalance treasuries and run on-chain operations, which turns prompt injection and excessive agency from content risks into direct financial loss. This guide covers how to give an agent on-chain authority safely: which key and account models to use, how to scope permissions with session keys and smart account modules, how to enforce limits and simulate transactions at the point of signing, and how to monitor and recover. It is for engineers and security leads building agentic systems that touch crypto assets. General approval and limit design for agents is covered in the AI Agent Action Approvals and Spending Limits Guide; this page covers what changes when the money is on a blockchain.

Key takeaways

  • Never give an agent the owner key. The agent should hold a narrowly scoped, expiring credential such as a session key or delegated permission on a smart account, while the owner key stays with humans on hardware or threshold signing.
  • Enforce limits on-chain, not in the prompt. SEAL's AI Security framework says controls belong at the point of action, allowing, warning or blocking a tool call or transaction before execution, because monitoring after the fact is too late for irreversible actions.
  • Standards exist for scoped permissions. ERC-4337 (Final) gives smart accounts programmable validation, EIP-7702 (Final) lets an EOA set delegated code, and ERC-7715 (Draft) defines a wallet method for granting permissions with allowance and expiry rules.
  • Delegation is a sharp tool. EIP-7702's security considerations warn that a poorly implemented delegate contract can allow a malicious actor to take near complete control of the account, so agent delegations must sign over nonce, value, gas, target and calldata.
  • Simulate and decode before signing. The agent and its policy layer should check what a transaction will actually do, not what the prompt or a web page says it does, because blind signing defeats every other control.

Why agents with wallets are a different risk

SEAL's AI Security framework describes the core problem: language models follow instructions, instructions and data share the same format, and in Web3 a compromised prompt can initiate token transfers, governance votes or treasury losses that cannot be reversed. OWASP's Top 10 for LLM Applications 2025 names the two risks that combine here: LLM01 Prompt Injection, and LLM06 Excessive Agency, whose root causes OWASP lists as excessive functionality, excessive permissions and excessive autonomy.

ThreatHow it reaches the walletPrimary controlReference
Direct or indirect prompt injectionInstructions hidden in a web page, token metadata, a governance proposal or a chat message tell the agent to send fundsAllowlisted recipients and contracts, on-chain limits, human approval above thresholdOWASP LLM01; MITRE ATLAS AML.T0051 LLM Prompt Injection
Tool misuseAgent invokes a transfer or approval tool with attacker-chosen parametersTyped tools with fixed parameters, policy check before signingATLAS AML.T0053 AI Agent Tool Invocation; OWASP LLM06
Malicious approvalsAgent grants an unlimited token allowance or signs a permit to a drainerBlock unlimited approvals; decode typed-data (EIP-712) signaturesSee the Crypto Scam and Drainer Guide
Memory and context poisoningStored notes or retrieved documents altered to change future decisionsTreat memory as untrusted input; re-validate recipients each timeSEAL AI Security; OWASP LLM04
Key theftPrivate key in environment variables, logs or the agent's context windowKeys in a signer service, HSM or MPC; agent never sees key materialSee the Secrets Management Guide
Runaway spendLoops, gas spikes or repeated small paymentsRate and cumulative limits, gas caps, kill switchSee the Denial-of-Wallet and AI Agent Cost Runaway Guide

SEAL also cautions that blocklists and simple filtering are easy to bypass, because adversarial prompts can be encoded, disguised with Unicode, translated or introduced gradually across turns. That is why this guide puts the weight on limits that hold regardless of what the model decides, rather than on detecting malicious prompts. Detection still helps, but it is the second line, not the first.

Account and key models for agents

ModelHow it worksStrengthWeaknessFit
Plain EOA key held by the agentAgent process signs with a raw private keySimpleAny compromise or injection can spend everything; no on-chain limitsAvoid, except tiny test balances
Custodial or managed signer APIAgent calls a signing service with its own credential and server-side policyKey never in the agent; central policy and auditTrust in the provider; API credential becomes the keyTeams wanting fast setup with policy
MPC or threshold signingAgent holds one share; a policy co-signer holds anotherNo single key; co-signer can refusePolicy logic is off-chain and must be trustedInstitutional and treasury use. See the MPC Wallet and Threshold Signing Security Guide
Smart account with session key (ERC-4337)Owner keeps admin; agent gets a session key validated by account logic with limits and expiryLimits enforced on-chain; revocableModule and validation code must be auditedMost agent use cases
EOA with EIP-7702 delegationOwner EOA sets delegated code that enforces agent permissionsKeeps existing addressDelegate bugs can give near total controlOnly with audited delegate contracts
Multisig with agent as one signerAgent proposes; humans co-sign above a thresholdHuman in the loop for large movesSlower; humans may rubber-stampTreasury and governance actions

ERC-4337, marked Final, introduces the UserOperation, a pseudo-transaction sent to a separate mempool, bundled by bundlers and executed through a singleton EntryPoint contract after the smart account's own validation logic runs. That validation step is where session key checks, spending limits and allowlists can be enforced on-chain. Modular account standards that structure such plug-ins, ERC-7579 and ERC-6900, are still Draft as of 27 October 2026, so check the version a wallet implements.

Scoping agent permissions

ERC-7715 (Draft, checked 27 October 2026) defines the JSON-RPC method wallet_requestExecutionPermissions, which lets an application ask a wallet to grant permissions to a session account so it can execute transactions on the user's behalf, plus wallet_revokeExecutionPermission to revoke them. Its examples include native-token-allowance and erc20-token-allowance permission types with an expiry rule, and its security considerations say applications should request only the permissions they need with a reasonable expiry, that wallets must enforce permissions correctly, and that wallets must clearly display permissions and warn against dangerous ones. Because it is a Draft, method and type names may change.

  • Asset and amount: per-token allowance, per-transaction maximum and cumulative cap per day or session.
  • Counterparties: allowlist of recipient addresses and contract addresses; deny by default.
  • Functions: allowlist of function selectors per contract (for example, swap on one router only, never approve to arbitrary spenders).
  • Time: short expiry, measured in hours or days, and automatic renewal only through a human or policy step.
  • Rate: maximum transactions per period and gas price cap.
  • Chain: restrict chain IDs so a permission granted for one network cannot be replayed on another.

EIP-7702 (Final) adds a transaction type that sets code for an EOA. Its security considerations list what a delegate contract should require the account's authority to sign over: replay protection such as a nonce, value, gas, and target and calldata, without which a malicious actor may call arbitrary functions in arbitrary contracts. It also warns about front-running initialisation, because code is set without running initcode. Any agent permission system built on 7702 should be audited against those points. See the Smart Contract Audit Readiness and Choosing an Auditor Guide.

Enforcing policy at the point of signing

SEAL's execution-path enforcement page defines the principle: intercept and evaluate the model's intended tool calls immediately before execution and return allow, warn or block. For agents that construct transactions or manage keys it calls this critical to prevent irreversible on-chain actions. A practical signing pipeline has these stages.

  1. Intent capture: the agent emits a structured intent (asset, amount, recipient, purpose) through a typed tool, never raw calldata from model text.
  2. Deterministic policy check: a non-LLM policy engine checks the intent against allowlists, limits and time windows.
  3. Build and decode: the transaction is built by trusted code and decoded back into human-readable effects, including any typed-data (EIP-712, Final) message.
  4. Simulate: run the transaction against current chain state and compare balance changes and approvals with the intent; block on mismatch.
  5. Approval: above a threshold, or for a new counterparty, route to a human approver who sees the decoded effects, not the agent's summary.
  6. Sign and submit: the signer service signs with the scoped key; on-chain account logic enforces limits again.
  7. Record: log the prompt context reference, intent, policy decision, simulation result and transaction hash.

Two independent layers, the off-chain policy engine and on-chain account validation, mean an injected instruction has to defeat both. The off-chain layer catches intent mismatches; the on-chain layer holds even if the agent host is fully compromised.

Where identity fits

An agent's wallet credential is a non-human identity with direct spending power. Give each agent its own account or session key, never a shared team key, so actions are attributable and revocable individually. Bind the session key's lifetime to the agent's task, store keys in a signer service rather than environment variables, and rotate the credentials the agent uses to reach that service. Owner keys, module installers and upgrade rights are privileged identities and belong with humans under multisig or threshold control. See the Crypto Wallet Security Guide for custody models and the Crypto Exchange Identity and Key Security Guide.

Choosing a design

  • Small balances, single developer: a smart account with one session key, a low daily cap and a recipient allowlist; keep the owner key on a hardware wallet.
  • Product giving users an agent: request scoped, expiring permissions from the user's wallet (for example via ERC-7715 where supported) instead of custody of user keys, and display exactly what is granted.
  • Organisation treasury: agents propose, humans approve through a multisig or MPC co-signer; agents never hold signing authority over treasury balances alone.
  • High-frequency trading agent: isolate a dedicated hot account funded with a bounded float, refilled by a human-controlled process, with on-chain per-trade and per-day caps.

Detection, response and recovery

  • Monitor on-chain: alert on any transfer to a non-allowlisted address, any approval, any module or delegation change, and cumulative spend nearing caps. See the Blockchain Analytics and On-Chain Monitoring Guide.
  • Monitor the agent: log tool calls with the source of the content that triggered them, and alert on policy blocks, which often indicate injection attempts.
  • Kill switch: one action revokes the session key or delegation and pauses the agent; test it monthly.
  • Revoke approvals: keep a runbook to revoke outstanding token allowances the agent created.
  • Incident plan: SEAL notes that even audited protocols need incident plans; include agent wallets in yours.

Metrics: share of agent transactions passing simulation match; policy blocks per 1,000 intents (and how many were injection); median session key lifetime; time to revoke in drills; percentage of agent value held under on-chain limits; number of agents sharing a key (target zero).

How to implement

  1. Inventory: list every agent that can move value, the account it uses, who holds the owner key and what balance it can reach. Agents with raw keys are the first to fix.
  2. Move keys out of agents: put signing behind a signer service, MPC co-signer or smart account so the agent process holds no reusable key material.
  3. Define policy as code: write the allowlists, per-transaction and daily caps, function selectors and chain IDs as version-controlled policy, reviewed like any other code change.
  4. Testnet first: run the agent on a test network or a mainnet fork with the full pipeline, including red-team prompts that try to redirect funds, and confirm every attempt is blocked by policy or on-chain limits.
  5. Shadow mode on mainnet: let the agent propose transactions that a human executes, and compare proposals with policy decisions for two to four weeks.
  6. Limited autonomy: enable autonomous signing for a small funded float and a short session key expiry, then raise limits only on evidence.
  7. Rollback: the rollback is revocation: revoke the session key or delegation, pause the agent and move remaining float to an owner-controlled account. Rehearse it before go-live.

Framework mapping

ControlNIST SP 800-53 Rev. 5NIST CSF 2.0AI and Web3 reference
Scoped session keys and allowlistsAC-6 Least Privilege, AC-3 Access EnforcementPR.AA-05OWASP LLM06; ERC-7715
Per-agent identities and key storageIA-9, SC-12PR.AA-01ERC-4337 session keys
Intent validation and simulationSI-10 Information Input ValidationPR.PS-06OWASP LLM01; ATLAS AML.T0051
Point-of-action enforcementAC-3PR.AA-05SEAL Execution-Path Enforcement
Logging and monitoringAU-12, SI-4DE.CM-09ATLAS AML.T0053
Kill switch and revocationAC-2(3) Disable Accounts, IR-4RS.MA-01ERC-7715 revoke method

Common failure patterns

  • Private key in the agent's environment: any code execution or prompt that dumps environment variables exposes the full balance.
  • Limits written only in the system prompt: an injected instruction overrides them; limits must live in code and on-chain.
  • Trusting the agent's summary at approval time: the human approves what the agent says, not what the transaction does. The Bybit Hack 2025 showed genuine signatures being given to a transaction whose real effect differed from what signers saw.
  • Unlimited token approvals: agents approve maximum allowances for convenience, leaving a standing drain path.
  • Unaudited delegate or module code: the permission system itself becomes the vulnerability, exactly the EIP-7702 warning.
  • Shared keys across agents: no attribution and no way to revoke one agent without stopping all.

Practitioner checklist

  • Keep owner and admin keys with humans under hardware, multisig or threshold control.
  • Give each agent its own scoped, expiring session key or delegated permission.
  • Enforce per-transaction, cumulative, recipient, function and chain limits on-chain.
  • Run a deterministic policy check and a simulation before every signature.
  • Show human approvers decoded transaction effects, not the agent's description.
  • Block unlimited approvals and decode every EIP-712 signature request.
  • Keep key material in a signer service; never in prompts, logs or environment variables.
  • Audit any account module or 7702 delegate against the EIP-7702 security considerations.
  • Monitor on-chain and agent-side events and test the kill switch monthly.

Standards and references

Related NHI Mgmt Group resources: AI Agent Action Approvals and Spending Limits Guide · Crypto Wallet Security Guide · MPC Wallet and Threshold Signing Security Guide · Crypto Scam and Drainer Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 27 October 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick the PDF box to continue.