ERC-8447 AI agent swarm framework (Swarm AI Framework)
Draft · Other · created 2026-10-18
A registry standard that records on-chain the process by which autonomous agents form, operate, and dissolve a purposeful collective called a 'swarm,' so that anyone can verify its membership, authority, mode of collaboration, and whether its goal was achieved.
Why it is needed
Until now, the process by which agents gather to divide work, verify it, and report on it has been improvised ad hoc on each platform. A single task, a single agent, a single joint action each has an on-chain form, but the organization binding them together is recorded nowhere. As a result, there is no single place for outsiders to check who belongs to a given collective, why it exists, how it operates, who has the authority to change it, or whether the organization has already ended. Existing proposals each address only one piece: consensus on joint action, token-balance-based tiers, a collective's decision-making method, individual agent identity, a single query structure, a single task-to-provider matching. But there has been no standard defining how membership is verified and changed, or how an organization ends. Because of this, building a trustworthy multi-party collaborative organization requires designing everything from scratch each time, and there is a risk of creating zombie organizations whose funds or authority remain locked in place even after the organization loses its purpose or its responsible party disappears.
What to implement
function isEligible(bytes32 swarmId, bytes32 roleId, address account) external view returns (bool);: Determines and returns whether a given account satisfies eligibility for a specific role.Join(bytes32 swarmId,address account,bytes32 roleId,bytes32 charterHash,uint256 seatEpoch,uint32 phase,uint256 deadline): The EIP-712 typed structure that is signed when joining via signature using joinBySig.
In depth
Swarm specification and specHash
A swarm is defined by the SwarmSpec struct. It includes 1 to 32 roles, 1 to 32 phases, an authority assigned to each of the 16 decision points (DecisionPoint), activation rules, contribution mode, minimum/maximum headcount, recruitment window (recruitmentWindow), maximum duration (maxDuration), inactivity timeout, and more. The hash of this entire struct, keccak256(abi.encode(spec)), is specHash, which serves as the swarm's identity. When form and succeed are called, the contract verifies whether role identifiers are duplicated, whether the first phase's admission is RECRUIT, whether the authorities array length is exactly 16, the minimum headcount condition, the existence of a permissionless exit path during the recruitment phase, and the existence of a viability fallback (maxDuration or inactivityTimeout). The specification is fixed at the time of form, and there is no function that changes the roles, phases, activation rules, contribution mode, or duration. Structural changes are only possible through succession, which creates a new swarm with a new specification.
Charter and two-sided acceptance
The charter (Charter/Swarm Pack) is an off-chain bundle of documents, committed on-chain as charterHash (SHA-256, RFC 8785 normalized). The goal description is hashed separately as objectiveHash, and the members' economic terms (distribution rules, costs, liabilities, data access, etc.) are hashed separately as commitmentHash. To become a member, one must accept the current charter hash via acceptCharter(swarmId, charterHash); specifying a stale hash causes join, applyToJoin, and joinBySig calls to all revert. joinBySig allows delegated joining via an EIP-712 signature, and the signature includes charterHash, seatEpoch (the number of seats that account has previously exited), phase, and deadline to prevent replay.
Lifecycle and authority-free escape hatches
There are five states: FORMING, ACTIVE, SUSPENDED, CONCLUDING, and DISSOLVED, and the goal outcome (outcome) of ACHIEVED, PARTIAL, FAILED, ABANDONED, or SUPERSEDED is recorded separately from the state. Every state transition increments a revision counter and emits a Changed event, so the organization's entire change history can be tracked. Once certain conditions are met, there are fallbacks that anyone can call even without an authority. Once the recruitment window has passed, anyone can end a FORMING state as DISSOLVED (ABANDONED); once the maximum duration or inactivity timeout has passed, it can move to CONCLUDING; and once the settlement window has passed, it can move to DISSOLVED. DISSOLVED is a terminal state and no further transitions are allowed.
Membership requiring agreement from both sides
Becoming a member is complete only once two actions have both occurred: the 'authority side,' where an ADMIT authority calls admit, or, under an OPEN boundary, the account itself calls join for a selfJoin role, and the 'member side,' where the account accepts the current charter via join, applyToJoin, acceptCharter, or joinBySig. Once both sides are in place, the state becomes ACTIVE. leave can be called by a member in any state, on their own, at any time, while suspendMember, remove, reinstate, and substitute can each only be called by the REMOVE, REINSTATE, and ADMIT authority respectively. substitute replaces a seat with a new account that has passed eligibility, but does not carry over the existing contribution record.
Eligibility modules and gas-attack prevention
Each role can have an IEligibility module, and joining is completed only if isEligible(swarmId, roleId, account) returns true. challenge can be called by anyone to re-evaluate an active member's eligibility: if judged false, the member becomes SUSPENDED (INELIGIBLE), and if judged true, they are reinstated. If the module reverts or returns an ambiguous response, it is treated as 'indeterminate' and nothing changes. In particular, if a false response is returned with less than one-eighth of the remaining gas, this is likewise treated as 'indeterminate' — a safeguard using EIP-150's 63/64 gas rule to prevent a caller from manipulating the gas amount to force an otherwise fine module to fail. expel can be called by anyone once a SUSPENDED (INELIGIBLE) state has exceeded the ineligibleGrace period, re-evaluating the module: if false, the member is expelled (EXITED); if true, they are reinstated; and if indeterminate, the call reverts with SAI_Unevaluable.
Five-dimensional coordinates representing phase and collaboration
Each phase declares its mode of collaboration through five coordinates: payoff (how rewards are split), topology (how work is divided), coordination (who coordinates), boundary (OPEN/GATED/CLOSED, who can enter), and admission (RECRUIT/INHERIT/SELECT, how the previous phase's roster is carried over). The first three are vocabulary terms registered via registerTerm, declarative values that the registry does not enforce but merely references, while the latter two are directly enforced by the registry. Named modes of collaboration such as cooperation, competition, collusive competition, tender, staged elimination, debate, ensemble, and pipeline are all represented as a point or path within this coordinate space.
Goal types and attainment determination
There are four goal types: TERMINAL (a single deliverable), MILESTONED (sequential milestones), EXPLORATORY (exploration), and STANDING (ongoing operation). The acceptance authority (acceptanceAuthority) records each milestone as ACCEPTED or REJECTED via recordMilestone, and finalizes one of ACHIEVED, PARTIAL, FAILED, or ABANDONED via conclude. For a MILESTONED goal, ACHIEVED can only be recorded once every milestone is ACCEPTED. For an EXPLORATORY goal, running out of resources does not by itself prove the proposition false, so FAILED cannot be recorded unless the acceptance authority demonstrates impossibility; it can only end as PARTIAL or ABANDONED.
Amendment, succession, and a proposal not yet finalized
amend can only be called by the AMEND authority. It becomes a 'material' amendment if it changes the objective hash or commitment hash, or if the authority explicitly declares it material, which raises commitmentVersion and opens an exit window for the duration of amendmentExitWindow. A mere wording fix and the like is a 'minor' amendment that only raises charterVersion. succeed lets the SUCCEED authority create a successor swarm with a new specification in the same transaction, concluding the existing swarm as SUPERSEDED and transferring designated members over as candidates for the new swarm. This ERC is currently in Draft status, a proposal still under discussion and revision that has not yet been finalized.