ERC-8273 Attestation-based agent action gate (Attestation-Gated Agentic Actions)

Draft · Signatures & auth · created 2025-05-26

A standard in which, before an AI agent executes an onchain action, an approved attestor issues a one-time authorization valid only within that transaction, so the contract can immediately verify whether 'this agent is entitled to perform this action.'

Why it is needed

Granting an agent only an identity has a fundamental limitation. There is no guarantee that the same identity is always behind the same agent, and an identity alone cannot answer whether 'this agent is entitled to perform this action right now.' Whether a transaction was actually performed by the agent, whether this agent has authority to perform this kind of action, whether the execution environment can be trusted, and whether autonomous execution can be distinguished from human instruction are all separate questions, but each requires an attestation record bound to a specific action and queryable onchain. Until now there has been no such standard mechanism, so an identity NFT could only say 'this address claims to be an agent' and guaranteed nothing about any specific action.

What to implement

In depth

A four-interface structure

This ERC divides functionality into four interfaces. IERC8273 (core) contains the type definitions, the Attested event, and read-only query functions, and every implementation MUST support it. IERC8273AtomicAttestation contains the sole external issuance entry point attestAndCall; it is structurally called an 'extension' but is in practice a MUST. IERC8273ActiveAttestation (subject-based getActiveAttestation) and IERC8273WalletAttestation (wallet-based getActiveAttestationByWallet / isAttestedAddress) are SHOULD, and at least one of the two must be supported to provide a gating query interface. Implementations that claim ERC-8004 integration MUST support IERC8273WalletAttestation.

The two axes of capability and actionDigest

capability is a coarse-grained identifier representing 'which category of permission' is granted (e.g. keccak256("DEFI_ACCESS_V1")). actionDigest represents 'which specific action it is bound to', and a value of 0 means only the capability is specified (capability-only mode). A nonzero actionDigest must be derived to include the target contract, function selector, arguments, and a nonce or attestationId for replay protection. chainId is not included because registries are deployed per chain and are naturally separated, and the execution profile (profileId) is also not included since it is an internal registry concept.

Lifetime based on transient storage

Active attestations are implemented using EIP-1153's TSTORE/TLOAD. The attestationId is recorded in two slots, keccak256(abi.encode("wallet", wallet, capability, actionDigest)) and keccak256(abi.encode("subject", subjectHash, capability, actionDigest)), which the EVM clears automatically when the transaction ends. The permanently stored AttestationRecord always has status Recorded, and is used only as an audit record; it does not imply active authorization.

attestAndCall processing procedure

The implementation must verify wallet != 0, capability != 0, and exec.profileId != 0, and if msg.value is nonzero, actionDigest must also be nonzero. It then writes the permanent record with status=Recorded, emits Attested, and writes the attestationId to the wallet/subject slots via TSTORE. It then selects the execution profile matching exec.profileId and executes the operation, where the msg.sender seen by the target DApp must be the attested wallet. If execution fails or success cannot be confirmed, the entire transaction, including the permanent and transient records, must be reverted.

Two execution profiles

The Direct Wallet Execution Profile (AGENT_EXECUTE_V1) applies to AA/ERC-7702 wallets implementing IAgentExecute, where the registry calls wallet.executeFromRelayer(calls, authData) so the wallet calls the target contract. authData must bind the chainId, wallet, registry, profile, actionDigest, nonce, and validity period. The ERC-4337 UserOperation Profile (ERC4337_USEROP_V1) applies to existing 4337 wallets; the UserOperation's sender must equal the wallet, and success must not be assumed merely from the fact that EntryPoint.handleOps did not revert, but must be confirmed via a receipt or event proof. This profile must reject msg.value (handleOps is not payable).

Distinction between gating-only functions and query views

getActiveAttestation / getActiveAttestationByWallet are 'gating-only' functions that read transient storage and revert if no attestation exists; this is the recommended path for on-chain authorization checks. In contrast, isAttested / isAttestedAddress / latestAttestationId / getAttestation are query view functions that return a bool or historical records, intended for off-chain indexing or UI display, and must not be used as the sole gate for sensitive operations.

Constraints of capability-only mode

In capability-only mode, where actionDigest is 0, the scope of authorization depends solely on the attestor's off-chain evaluation, and the protocol does not enforce validation of the calldata. For this reason, this mode must not be used for simple asset transfers, privileged state changes, or financial operations that could be amplified through reentrancy within a transaction; such cases should use action-bound mode, and the DApp must add its own reentrancy guards. Since the transient slot remains active until the transaction ends, the gate itself does not prevent reentrancy.

Proposal status

This ERC is currently in Draft status, meaning community discussion is still ongoing and the details may change.

Original ERC · ← ERCs