Draft ERC: Policy-Enforced Agent Accounts

The fixes from the review above are live.

@Zealynx

  1. Publisher changes wait. Every policy the publisher posts goes through setPending at least the account’s minDelay ahead, and decides from its effectiveAt. Only the account itself can activate at once. On urgent tightenings, we accepted that the registry shows them only after minDelay. The enforcer still applies a tightening off chain at once, since stricter is always safe. Until the registry catches up, its receipts carry the newer version, which a use-time verifier refuses, so the gap fails closed.
  2. Confirming early now reverts (NotDue), and every removal of a pending entry emits PolicyCancelled. While testing, we found a related case: in v1, a pending change that was due but not yet confirmed was lost when a newer one was posted. v2 makes the due change active first.
  3. Use-time rules are in the spec. A verifier acting on an ALLOW must check that the receipt’s policy hash and version are the current ones, that the account is not stopped, and that its decisionId is used once, claimed in one atomic step. verifyReceipt(…, { use: true, seen }) does all three.
  4. The Intent includes uint8 operation: 0 for a call, 1 for a delegatecall, or the call type byte of the ERC-7579 execution mode. The EIP-712 domain version is now “2”, and the vectors include the same call as both.

@Secrypta

  1. Scope of a commitment. Security Considerations has a new section on it. It says a commitment covers only actions that need the policy signer, and lists what to check separately for Safe, ERC-7579 and EIP-7702 accounts: allowances and permits, operator approvals, modules and executors, guards and hooks, fallback handlers, and the delegation target.
  2. Signer changes wait too. After the first declaration, a new signer set applies minDelay later, including a lower minDelay. It is announced with SignersPending, and the account can cancel it. Clearing to all zeros applies at once, since it only withdraws the claim of enforcement. The account can now engage the emergency stop itself, which is the fast answer to a leaked publisher or receipt key while the rotation waits.
  3. signerType is in Signers: 1 co-signer in the signature path, 2 validator module, 3 guard or hook, 4 other.

On #8 and #9, which came in while this was being built:

  • @Secrypta: agreed, the surface snapshot goes in a companion ERC, not this one. When we draft it, every snapshot will carry the block it was observed at, will be labelled point-in-time and advisory, and the spec will list what invalidates it. Thanks for the offer to review.
  • @Zealynx, the account’s way out of a leaked publisher key. In v2 the account itself can call cancelPending, setStopped(true) and activate, so a loosening queued before a rotation can be cancelled by the account while the rotation waits. One gap you point out remains in v2: the publisher can lift a stop the account engaged. The account can still cancel each pending change itself, and anything the publisher posts waits minDelay, but the stop should hold. We’d make a stop engaged by the account liftable only by the account in the next revision. On urgent tightenings, your “stop now, then the tighter version with the normal delay” is the same order an enforcer can follow with v2. The scoped stop (per target or selector, stored in the clear) is a good idea for later.

The first registry, 0x20D6…7e92, is unchanged and readable. Its receipts can still be audited (domain version “1”), but under the updated spec they are never acted on as a gate, because their intent does not bind the operation. Both of our demo accounts moved to v2 through ordinary co-signed transactions:

Thanks again to you both.