AI agents in DeFi: design wallet permissions before automation
Design a bounded DeFi agent workflow with explicit spending permissions, transaction review, session limits, revocation, and practical tests before automation.
TOPIC GUIDE / Bounded wallet automation
An agent can interpret a request and prepare an action, while a separate permission system decides whether that action may execute. Design that boundary before enabling wallet access. Specify the allowed contracts, methods, recipients, budgets, and time window, then test how the workflow behaves when a proposal violates those limits.
Read the full Lab guideWrite a narrow task such as preparing a report or proposing a transaction for specified assets. Then list the data and authority that task requires. Reading positions, constructing a proposal, and signing it should be distinct capabilities. A broad instruction to manage assets leaves the consequential boundaries undefined.
Represent proposals with explicit fields for network, target, method, recipients, assets, and amounts. Define missing information as a reason to stop. Require a separate review for policy changes so the agent cannot expand its permitted task while trying to complete an ambiguous request.
ERC-4337 session-key documentation describes constraints enforced through wallet-specific logic. Check the implementation’s actual capabilities rather than assuming account abstraction supplies every desired restriction. Identify where permitted methods, expiration, spending limits, and revocation are validated, and whether another execution route could bypass that validation.
Test both individual and cumulative limits. A hypothetical permitted router may accept arbitrary recipients inside its arguments; approving the router address alone would leave those destinations unspecified. Review nested actions and batches. A rejected disallowed proposal provides evidence of enforcement that a promise in the agent’s explanation cannot provide.
Before signing, decode the action and inspect material changes using the available review and simulation tools. Record proposal identifiers, policy decisions, and transaction outcomes without storing secrets. Distinguish an uncertain submission from a failed action so automatic retries do not repeat a transaction that already succeeded.
Document how to suspend the job, revoke delegated authority, inspect pending actions, and review existing token allowances. These may require separate operations. Rehearse a scenario in which retrieved content produces an unexpected proposal, then verify that the system stops at the authorization boundary and leaves enough evidence for an operator to investigate.
Primary reference: ERC-4337 documentation: Session Keys and Delegation. Read the current documentation for the exact network, asset, or product you are researching.
Keep exploring
Session constraints depend on the wallet’s implementation. Inspect the specific enforcement logic and supported restrictions; account abstraction alone does not prove that the agent has the permissions you intend.
Stopping a process may leave delegated authority or token allowances in place. Identify and complete the separate revocation operations required by the wallet and contracts involved in the workflow.
A sequence of individually permitted actions can exceed the intended overall exposure. Define a shared budget, accounting period, and retry behavior, then verify that enforcement covers their combined effect.
From the DeFi Altcoin Lab
Put the concepts to work with a detailed guide, concrete research steps, and the questions to ask before acting.
Design a bounded DeFi agent workflow with explicit spending permissions, transaction review, session limits, revocation, and practical tests before automation.
Build an evidence-first DeFi research workflow: bound the question, verify sources and contract identities, check calculations, and preserve unresolved claims.
Compare USDC and USDT through reserve disclosures, redemption eligibility, network identity, issuer controls, and the additional risks of using stablecoins in DeFi.