ERC-8257 AI Agent Tool Registry (Agent Tool Registry)
Draft · Other · created 2026-04-17
A registry that registers tools used by AI agents onchain, verifies tampering via a metadata hash, and standardizes access control and price comparison through external predicate contracts.
Why it is needed
Tools used by AI agents are currently scattered across separate private catalogs with no common onchain source, so agents have no way to discover tools or verify that their content has not been tampered with. Access control methods also differ by service, so the registry itself has to be modified every time a new model such as NFT ownership, subscriptions, or whitelists needs to be supported. Without standardized pricing information either, an agent cannot compare which of two functionally similar tools is cheaper before calling. Under these conditions, it is difficult for an agent to automatically find trustworthy tools and choose between them by precomputing cost and access conditions.
What to implement
event ToolDeregistered(uint256 indexed toolId);: Emitted when the creator permanently deregisters a tool.function deregisterTool(uint256 toolId) external;: Callable only by the creator; permanently deregisters the tool.function setAccessPredicate(uint256 toolId, address newPredicate) external;: Callable only by the creator; changes the access predicate. address(0) makes access public.function getToolConfig(uint256 toolId) external view returns (ToolConfig memory);: Reads the tool's full configuration: creator, metadataURI, manifestHash, and accessPredicate.function toolCount() external view returns (uint256);: Returns the total number of tools registered so far (the highest toolId).function name() external view returns (string memory);: Returns a human-readable name identifying the registry implementation.function version() external view returns (string memory);: Returns the version string of the registry implementation.function name() external view returns (string memory);: Returns a name identifying the predicate implementation (e.g. ERC721OwnerPredicate).function getRequirements(uint256 toolId) external view returns (AccessRequirement[] memory requirements, RequirementLogic logic);: Returns an array of requirements and an AND/OR combination mode so an agent can know the access conditions in advance.
In depth
ToolConfig and registration/deregistration rules
The ToolConfig struct consists of four fields: creator (immutable after registration), metadataURI, manifestHash, and accessPredicate. registerTool records msg.sender as the creator and returns a sequential toolId. It reverts with InvalidMetadataURI if metadataURI is an empty string or exceeds 2,048 bytes, and with InvalidManifestHash if manifestHash is bytes32(0). deregisterTool can only be called by the creator, is permanent, and after it all subsequent lookups revert with ToolIsDeregistered, distinguishing it from 'never existed'. toolId values are never reused, and toolCount() always equals the highest toolId.
The access predicate pattern and kind namespace
Access control is delegated not to the registry but to an external contract called accessPredicate. This is a 'pluggable external contract' pattern similar to Seaport's zone, Uniswap v4's hook, and ERC-4337's paymaster. If accessPredicate is address(0), access is fully public. IAccessPredicate consists of three functions: hasAccess, name, and getRequirements. getRequirements returns an array of AccessRequirement (kind, data, label) and a combination mode (RequirementLogic, AND/OR) so an agent that receives a 403 can look up what it needs to satisfy. kind is an ERC-165-style 4-byte identifier; the spec defines three, IERC721Holding (0xbdf8c428), IERC1155Holding (0xcb429230), and ISubscription (0x44387cc2), and anyone can extend it by publishing a new marker interface.
The difference between hasAccess and tryHasAccess
hasAccess(toolId, account, data) is a simplified lookup that returns true only if the predicate call succeeds and returns true normally. Any malfunction, such as a revert, out-of-gas, a malformed return value, or a codeless address, is treated as false, indistinguishable from an explicit denial. tryHasAccess returns two values, (ok, granted), separating whether the predicate responded normally (ok) from whether access was granted (granted). The combination (false, true) is prohibited, and for a toolId that is unregistered or deregistered, both functions revert with ToolNotFound or ToolIsDeregistered respectively, rather than treating it as a malfunction.
toolId scope and CAIP identifiers
A tool ID is bound to the tuple (chainId, registryAddress), so different registry deployments can reuse the same toolId. Off-chain consumers such as indexers or wallets must always specify the chain ID and registry address together with it. The recommended canonical notation follows the CAIP-19 asset identifier syntax: eip155:<chainId>/erc8257:<registryAddress>/<toolId>. The erc8257 namespace is not yet registered in the ChainAgnostic CAIP repository, but this ERC proposes that registration.
Manifest normalization (JCS) and hash commitment
manifestHash is the keccak256 hash of the bytes produced by normalizing the raw manifest with the RFC 8785 JSON Canonicalization Scheme (JCS), not of the raw manifest itself. JCS normalizes key order, whitespace, number notation, and string escaping, but does not handle Unicode normalization, hex-digit case, or BOM, so this ERC adds further rules. All strings must be NFC, the manifest must be served as UTF-8 without a BOM, and all hex fields, including creatorAddress, kind, data, enclaveHash, and buildHash, must be lowercase. If any of these three rules is violated, consumers must treat it as a verification failure that surfaces the hash mismatch, rather than silently rewriting it.
Manifest fields and origin binding
The required fields are type, name (1-128 characters, NFC, no control characters), description (1-500 characters), endpoint (must start with https:// after normalization), inputs/outputs (JSON Schema), and creatorAddress (lowercase 0x plus 40 hex digits). creatorAddress must match the onchain creator (the caller of registerTool), which prevents manifest forgery. In addition, there is an origin-binding rule requiring the manifest to also be retrievable unchanged from <origin>/.well-known/ai-tool/<slug>.json on the same origin as the endpoint, meaning the registered metadataURI must exactly match this well-known path.
Pricing and verifiability tiers
The pricing array provides protocol-agnostic price hints; the four fields amount (a minimum-unit integer string), asset (CAIP-19), recipient (CAIP-10), and protocol (e.g. x402) are all required, and asset and recipient must reference the same chain. An amount of 0 means 'free, but still route the flow through the specified protocol.' The verifiability object centers on tier (self-attested/hardware-attested/verifiable) and execution (standard/tee/e2ee), and holds attestation, reproducibleBuild, dataRetention, and sourceVisibility to declare guarantees about the execution environment and data handling. If tier is inconsistent with the structural fields (for example, verifiable without attestation), consumers must treat the actual trust tier as the lower one.
Standard status
This ERC is currently in Draft status, a proposal still undergoing community discussion and revision. The field composition and verification rules may change before finalization.