Introduction
Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.
I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.
I also build and publish a variety of tools, libraries, and open-source projects.
When delegating small payments to an AI agent, an owner first decides where funds may be sent, how much may be sent, and until when. Giving the agent or its host a private key, however, makes it impossible to prevent unauthorized transfers using that key alone.
ERC-8196 proposes a wallet that checks the owner's authorization policy against the signed action presented by the agent and invokes the target contract only when the conditions are satisfied. It avoids handing the owner's private key to the agent or host and maintains an audit record that can be inspected separately from the execution result.
The ERC-8196 specification is available here.
Overview
Verification and execution layers
Suppose an owner registers a policy stating that an agent may send up to 0.01 ETH to a specified DEX until 18:00 today. The agent submits a signed action containing the hash identifying the policy, the recipient, the value, an expiry, and a single-use nonce. The wallet reads the registered policy and current verification results. If any required condition is not met, it does not call the recipient contract.
Risk scores range from 0 to 20, with lower scores indicating lower risk. Before execution, the wallet rejects requests whose current score exceeds the maximum tolerated by the owner.
The owner's policy and the verification results consulted at execution time are produced separately. The former specifies what is permitted, while the latter indicates whether the agent is still acceptable at the time of execution. The wallet consults both before execution; an agent's request alone is insufficient to invoke the target.

Delegation flow
The wallet first checks whether the AI agent submitting the action has signs of risky fund movements or malicious activity. ERC-8126 provides the basis for obtaining these verification results for individual agents. ERC-8196 compares the current assessment with the owner's maximum permitted score and blocks requests outside the policy before execution. In other words, ERC-8126 supplies the assessment, and ERC-8196 makes the authorization decision immediately before moving assets.
For more on ERC-8126, see the following article.
[ERC8126] AI Agent Trust Through Verification and Risk Scores
Motivation
Delegating without sharing private keys
Delegating asset operations to an AI agent introduces risks: a host could obtain a private key, permissions could be too broad, or an agent with a history of malicious activity could be authorized. A host can also influence which action is executed by withholding an agent's output, delaying requests, or repeatedly sampling probabilistic responses.

ERC-8196 constrains execution through policies and checks the agent's risk assessment, signature, nonce, and expiry at execution time. A policy is an authorization condition registered by the owner, not an input that the host can rewrite at its discretion. Successful actions are linked to audit entries containing the hash of the previous entry. Replacing an intermediate entry therefore breaks the hash chain.
Host manipulation and replay
Even a valid signature does not prevent a host from delaying a request or repeatedly sampling probabilistic outputs. Expiry limits the lifetime of old requests, and nonces prevent replay of the same request. An entropyCommitment is a value used to check whether randomness revealed at execution matches a previously committed value. For high-value operations, multiple independent hosts can help prevent any one host from controlling the output or timing.
Specification
Policies and signatures represent distinct aspects of what an agent may execute, when, and within which limits. Before execution, the wallet checks policy validity and the current assessment. It adds successful actions to the audit record.
The following diagram illustrates the boundary where a signature is matched to a registered policy before execution is forwarded to the target. The full fields of each EIP-712 type are described below.

Policies and signatures
A policy is the set of permitted operations registered by the owner in advance. It is distinct from an individual execution request, so it stores the recipient constraints, value limits, validity period, agent, and identifier used to query the current assessment separately.
| Field | Description |
|---|---|
policyId |
A unique policy identifier. The proposal requires it but does not expose it as an input in the interface below, so the implementation defines its generation and storage. |
agentAddress |
The address of the authorized AI agent. |
agentId |
The identifier queried through ERC-8126's getLatestRiskScore. |
ownerAddress |
The owner delegating authority over assets. |
allowedActions |
An array of permitted action names. |
allowedContracts |
An array of permitted target contracts. |
blockedContracts |
An array of prohibited target contracts. |
maxValuePerTx |
The maximum value allowed per transaction, in wei. |
maxValuePerDay |
The daily value limit. Optional. |
validAfter |
The time at which the policy becomes valid. |
validUntil |
The time at which the policy expires. |
minVerificationScore |
The maximum tolerated risk score on a scale of 0 to 20. Reject requests whose current score exceeds this value. |
The AgentAction type represents a single action requested by an agent as structured data to be signed. It binds agent, action, target, value, data, nonce, validUntil, policyHash, and entropyCommitment into one signature. Including policyHash prevents a signature intended for a policy permitting only small transfers from being reused under a different policy.
The Delegation type represents who authorizes whom to use a particular policy. It binds delegator, delegatee, policyHash, validUntil, and nonce into a signature. However, the specification does not prescribe how to pass a Delegation to the execution interface or which function validates it.
Conversely, the executeAction function does not take an action parameter. The interface alone does not specify which stored value should be used to recover the signed action and compare it against allowedActions. An implementation must document this comparison mechanism, how it generates policyId, and where it tracks the daily aggregate value.
For more on EIP-712, see the following article.
[EIP712] Hashing and Signing Typed Structured Data
IAIAgentAuthenticatedWallet
IAIAgentAuthenticatedWallet defines the interface for policy registration, execution, revocation, and queries. Before executing an action, the implementation performs ERC-8126 verification and enforces the policy's risk score limit.

registerPolicy
function registerPolicy(address agent, uint256 agentId, string[] calldata allowedActions, address[] calldata allowedContracts, address[] calldata blockedContracts, uint256 maxValuePerTx, uint256 maxValuePerDay, uint256 validAfter, uint256 validUntil, uint8 minVerificationScore) external returns (bytes32 policyHash);The owner registers the agent's authorization policy and obtains a policyHash that can be bound to execution signatures. The returned value is used to check that a later action request corresponds to the authorization policy registered here.
-
Validate inputs
The implementation receives the agent, permitted actions, target contracts, value limits, validity period, and risk score limit, and checks their consistency and the registrant's authority.
-
Store the policy
Store the policy and derive a
policyHashthat can be referenced during execution. -
Return the result
Return the
policyHashfor use at execution time.
- Parameters
| Parameter | Details |
|---|---|
agent |
The address of the authorized AI agent. |
agentId |
The identifier used for ERC-8126 risk queries. |
allowedActions |
Permitted action names. The implementation defines the matching procedure. |
allowedContracts |
Permitted target contracts. |
blockedContracts |
Prohibited target contracts. |
maxValuePerTx |
The maximum value permitted per execution. |
maxValuePerDay |
The daily value limit. |
validAfter |
The time at which the policy becomes valid. |
validUntil |
The time at which the policy expires. |
minVerificationScore |
The upper bound that the current ERC-8126 risk score must not exceed. |
- Return value
| Return value | Details |
|---|---|
policyHash |
The hash binding the registered policy to signatures. |
Execution conditions
| Check | Condition and outcome if not satisfied |
|---|---|
| Policy registrant | The proposal treats policies as the owner's policies but leaves caller authorization to the implementation. Prevent third parties from registering policies on behalf of other owners without authorization. |
| Consistency of validity and limits | Check validAfter, validUntil, and the per-execution and daily limits before storing the policy. The standard does not define specific validation formulas or revert errors for registration. |
| Identifier and storage format | The implementation defines how to generate policyId and which stored values can be retrieved from policyHash. Without a clear design, subsequent execution decisions cannot be reproduced. |
executeAction
function executeAction(bytes32 policyHash, address target, uint256 value, bytes calldata data, uint256 nonce, bytes32 entropyCommitment, bytes calldata signature) external returns (bool success, bytes32 auditEntryId);This function verifies the policy, current risk assessment, and signature before executing an agent's action. Blocking the action before calling the target is the key to ensuring that the host or agent cannot exceed the owner's permitted scope.
-
Validate the request
Check policy validity, target, value, nonce, and signature. Reject the action if the current ERC-8126 risk score obtained using
agentIdexceedsminVerificationScore. -
Execute and append the audit record
Execute only actions that satisfy the conditions, and append an audit entry containing
previousHash. -
Return the result
Return the execution outcome and
auditEntryId.
- Parameters
| Parameter | Details |
|---|---|
policyHash |
The registered policy to apply. |
target |
The target contract. |
value |
The value supplied during execution. |
data |
Calldata passed to the target. |
nonce |
A unique value used to prevent replay. |
entropyCommitment |
A commitment intended to limit host influence over probabilistic actions. |
signature |
An EIP-712 signature bound to the policy. |
- Return values
| Return value | Details |
|---|---|
success |
Whether execution succeeded. |
auditEntryId |
The identifier of the entry in the audit hash chain. |
Execution conditions
| Check | Condition and outcome if not satisfied |
|---|---|
| Policy validity | Check that policyHash is registered, the time is at or after validAfter and at or before validUntil, and the policy has not been revoked. Reject expired policies with PolicyExpired. |
| Target and transfer value | Check that target is permitted and not blocked, and value does not exceed maxValuePerTx. Reject excess value with ValueExceedsLimit. The implementation defines how to aggregate daily spending. |
| Current agent assessment | Retrieve the current ERC-8126 risk score using the policy's agentId and ensure it does not exceed minVerificationScore. Reject requests exceeding the limit. Also implement rejection or revocation when verification results indicate malicious activity. |
| Signature and nonce | Compare the signer recovered from signature with the expected signer and confirm that nonce has not been used. An implementation can reject a signer mismatch with InvalidSignature and nonce reuse or other policy violations with PolicyViolation. |
| Action name matching | The standard does not prescribe how to match allowedActions to the signed action. The implementation defines the source from which the action is recovered and the comparison procedure, and rejects requests that cannot be matched. |
revokePolicy
function revokePolicy(bytes32 policyHash, string calldata reason) external;This function accepts the target policyHash and a reason to revoke a registered policy. The implementation stores the revocation state and rejects subsequent executeAction calls using the same policyHash before executing them.
-
Validate the request
Identify the policy using
policyHashand check that the caller is authorized to revoke it. -
Invalidate the policy
Mark the policy inactive and exclude it from subsequent authorization decisions.
-
Complete the operation
Reject the policy in future execution requests.
- Parameters
| Parameter | Details |
|---|---|
policyHash |
The policy to revoke. |
reason |
The reason for revocation. |
Execution conditions
| Check | Condition and outcome if not satisfied |
|---|---|
| Revocation requester | The standard does not prescribe who may revoke a policy. The implementation must at least prevent unauthorized parties from invalidating another owner's policies. |
| Target policy | Identify the active policy from policyHash. The implementation defines how to handle nonexistent or already revoked policies and when to emit PolicyRevoked. |
getPolicy
function getPolicy(bytes32 policyHash) external view returns (address agent, address owner, uint256 maxValuePerTx, uint256 validUntil, bool isActive);This read-only function returns summary values needed for authorization decisions. It returns only the agent, owner, per-execution limit, expiry, and active status; it does not necessarily allow the full list of permitted contracts or the daily limit to be reconstructed.
-
Identify the policy
Identify the registered policy using
policyHash. -
Read the summary values
Read the agent, owner, per-execution limit, expiry, and active status.
-
Return the result
Return the five retrieved values.
- Parameters
| Parameter | Details |
|---|---|
policyHash |
The policy to query. |
- Return values
| Return value | Details |
|---|---|
agent |
The authorized agent. |
owner |
The owner who delegated authority over assets. |
maxValuePerTx |
The maximum value per execution. |
validUntil |
The expiry. |
isActive |
Whether the policy is active. |
Execution conditions
| Check | Condition and outcome if not satisfied |
|---|---|
| Query target | Identify the policy using policyHash. The standard does not prescribe what to return for a nonexistent hash or whether to revert, so callers must consult the implementation. |
PolicyRegistered
event PolicyRegistered(bytes32 indexed policyHash, address indexed owner, address indexed agent, uint256 validUntil);The PolicyRegistered event informs external monitoring services that a policy has been registered. Event logs can be filtered by policyHash, owner, and agent, but this event alone does not expose the complete list of authorized targets or all value limits.
- Fields
| Field | Details |
|---|---|
policyHash |
The indexed hash of the policy. |
owner |
The indexed owner address. |
agent |
The indexed agent address. |
validUntil |
The policy's expiry. |
ActionExecuted
event ActionExecuted(bytes32 indexed policyHash, address indexed agent, address target, uint256 value, bytes32 auditEntryId);The ActionExecuted event is emitted when an authorized action is executed. Monitoring services can use policyHash and agent to trace which target received which value. The fields do not include the contents of calldata or the result returned by the target. If those are needed, inspect transaction input and the relevant stored contract data separately.
- Fields
| Field | Details |
|---|---|
policyHash |
The indexed policy applied to the action. |
agent |
The indexed agent executing the action. |
target |
The target contract. |
value |
The value supplied during execution. |
auditEntryId |
The identifier of the corresponding audit entry. |
PolicyRevoked
event PolicyRevoked(bytes32 indexed policyHash, string reason);The PolicyRevoked event is emitted when a policy is revoked. Event consumers can display the reason for revocation, but what prevents future execution is the active status stored by the wallet, not the event itself.
- Fields
| Field | Details |
|---|---|
policyHash |
The indexed hash of the revoked policy. |
reason |
The reason for revocation. |
AuditEntryLogged
event AuditEntryLogged(bytes32 indexed entryId, uint256 sequence, bytes32 sessionId, string actionType);The AuditEntryLogged event is emitted when an entry is appended to the audit hash chain. With entryId, sequence, and sessionId, consumers can trace the order of events within the same delegation session. However, previousHash, which is needed to detect tampering, is not a field in this event. Verification requires retrieving the audit entries stored by the implementation and checking the hash chain.
- Fields
| Field | Details |
|---|---|
entryId |
The indexed audit entry identifier. |
sequence |
The entry's sequence within the session. |
sessionId |
The identifier of the audited session. |
actionType |
The recorded action type. |
Audit and errors
Audit entries for successful actions contain previousHash, which points to the preceding entry. Implementations can store entries directly onchain or keep them offchain and anchor a Merkle root onchain. In either case, the verifier needs access to the entry contents and adjacent hash links to detect modifications within the chain.
PolicyExpired
error PolicyExpired(bytes32 policyHash, uint256 validUntil);The PolicyExpired error rejects execution under a policy whose validity period has expired.
- Parameters
| Parameter | Details |
|---|---|
policyHash |
The expired policy. |
validUntil |
The expiry of that policy. |
ValueExceedsLimit
error ValueExceedsLimit(uint256 value, uint256 maxValue);The ValueExceedsLimit error rejects an action whose execution value exceeds the policy's limit.
- Parameters
| Parameter | Details |
|---|---|
value |
The requested value. |
maxValue |
The maximum value permitted by the policy. |
InvalidSignature
error InvalidSignature(address recovered, address expected);The InvalidSignature error rejects an action when the recovered signer does not match the expected signer.
- Parameters
| Parameter | Details |
|---|---|
recovered |
The address recovered from the signature. |
expected |
The expected signer's address. |
EntropyVerificationFailed
error EntropyVerificationFailed(bytes32 commitment, bytes32 revealed);The EntropyVerificationFailed error rejects an action when the revealed entropy does not match the commitment.
- Parameters
| Parameter | Details |
|---|---|
commitment |
The previously established commitment. |
revealed |
The revealed value presented during execution. |
PolicyViolation
error PolicyViolation(bytes32 policyHash, string reason);The PolicyViolation error rejects an action that does not satisfy the policy.
- Parameters
| Parameter | Details |
|---|---|
policyHash |
The policy that was violated. |
reason |
The reason for rejection. |
Rationale
Separation of verification responsibilities
ERC-8126 provides the preceding layer for identifying agents and obtaining verification results and risk assessments. The wallet uses the agentId stored in the policy to retrieve those results and determine whether the current assessment exceeds the owner's threshold. ERC-8196 combines that assessment with checks on the recipient, value, expiry, signature, and nonce to decide whether the action may proceed now.
Pre-submission checks
Hosts, wallet UIs, and relayers can perform the same checks before submission. This helps surface rejection reasons to users sooner and avoid submitting invalid transactions. However, hosts and UIs are outside the trust boundary, so the onchain executeAction function must also enforce the relevant conditions immediately before execution.
Compatibility
ERC-4337 wallets
ERC-8196 is designed to be compatible with ERC-4337 wallets and existing standards without breaking their execution models. ERC-4337 provides a framework in which user requests are passed to a bundler as UserOperations, and the account validates and executes those requests. If the account, or a policy module invoked by the account, implements IAIAgentAuthenticatedWallet, delegation checks can be incorporated into its normal execution path.
ERC-8196 adds ERC-8126 verification before execution. Offchain hosts, wallet UIs, and relayers can check the same assessment before submitting a transaction or UserOperation.
For more on ERC-4337, see the following article.
[ERC4337] Account Abstraction Without Protocol Changes
Underlying signature standards
EIP-712 defines how to sign multiple values, such as a recipient, value, expiry, and policy hash, as typed structured data. The wallet can compare the recovered signer with the policy and verify that the signed values have not been substituted. EIP-191 defines signed-data formats, and EIP-155 uses the chain ID to prevent transaction replay across chains.
For more on EIP-191, see the following article.
[ERC191] Using Signed Data Securely
For more on EIP-155, see the following article.
[EIP155] Preventing Replay Attacks Across Ethereum Networks
Security
Replay protection and tamper detection
The implementation records nonces as single-use values scoped to a policy or signer and rejects expired requests before execution. Separating these two controls prevents both replaying an identical signature and submitting a previously valid signature after its expiry.
Audit entries contain previousHash, which references the preceding entry. When the chain is read back from audit storage, changing an intermediate entry without updating its successors causes the hash to differ from the one recorded in the next entry. The specification does not require every audit entry to be stored onchain; it also permits offchain storage with periodic onchain anchoring of Merkle roots.

If ERC-8126 Wallet Verification identifies malicious activity, such as sanctioned funding, mixer usage, clustering with malicious addresses, or strong automation indicators, the wallet rejects or revokes delegation even if the overall risk score is within the threshold. Individual warning signals are part of the authorization decision; the aggregate score is not a blanket authorization.
Verification results and the owner's revocation authority
The owner can stop delegation using revokePolicy. Even signed requests received after revocation are rejected based on the active status stored by the wallet. This control is enforced by the execution contract, rather than only through the host's UI.
In addition, if ERC-8126 Wallet Verification flags sanctioned funding, mixer usage, clustering with malicious addresses, or strong automation indicators, the wallet rejects or revokes delegation even when the aggregate risk score is within the permitted limit. To avoid accepting execution merely because an input indicates a low score, the implementation defines how it obtains individual Wallet Verification warnings from stored data and when it rejects requests. However, the ERC-8196 interface does not specify the scope of collected verification data, its update frequency, or the handling of false positives. Owners must establish separate processes for revocation, reverification, and approval with these limitations in mind.
Mitigating host manipulation
The design does not fully trust the host. It checks policies, signatures, verification before execution, and revocation onchain so that the host cannot unilaterally change the recipient. However, onchain verification alone cannot prevent repeated sampling of a probabilistic AI agent's outputs. For high-value operations, use multiple hosts to cross-check the same request or establish independent approval paths for each host.
For example, a single host could discard the initial output and repeatedly sample until it obtains an output that changes the recipient; signature verification alone cannot observe how many attempts were made. entropyCommitment verifies that a value revealed during execution matches a prior commitment, but does not prove which input was used to run the agent. Combining independent host records, additional approval based on transaction value, and audit log reconciliation helps investigators examine potential host manipulation after the fact.
Conclusion
When delegating asset operations to an AI agent, the owner registers the permitted recipients, value limits, expiry, and agent in a policy. The ERC-8196 wallet checks the current ERC-8126 assessment, signature, nonce, and expiry before execution, forwarding only requests that satisfy the conditions. Revocation state and a hash-chained audit trail also allow owners to stop delegation and subsequently verify the history of successful actions.
I also publish articles on other platforms.




