Shepherd

EIP-8141 agent leash: scoped session keys, VERIFY policy, owner co-sign.

Shepherd

Created At

ETHGlobal Mumbai

Project Description

Shepherd — Give AI agents permission, not ownership.

AI agents are becoming capable of doing real work, including interacting with wallets and executing blockchain transactions. But giving an agent access to a wallet often means giving it far more control than it actually needs.

Shepherd changes that.

Shepherd is an account infrastructure that lets people delegate limited onchain permissions to AI agents without handing over ownership of their wallets.

The owner keeps control of the main account. Each agent operates with its own scoped session key, limited by rules defined by the owner.

Here's how it works:

Scoped permissions: Agents can only interact with approved contracts, functions and transaction values.

Policy enforcement: Every transaction passes through an onchain verification process before execution.

Human approval: High-risk transactions can be escalated to the owner for approval.

Instant revocation: Owners can revoke an agent's permissions when they no longer trust it.

Delegated sessions: Child agents inherit their parent's restrictions and cannot exceed their permissions.

Shepherd uses EIP-8141 Frame Transactions to implement transaction-level verification. Its policy checks rely on external contract state, which introduces a mempool validation constraint. We address this through ERC-8421 staked alternative-mempool admission.

This allows Shepherd to demonstrate something important: the same policy-dependent transaction that fails canonical mempool validation can be admitted through the appropriate staked alternative mempool.

The result: AI agents can execute useful onchain actions independently, while humans retain control over the decisions that matter.

Shepherd isn't about trusting AI with your wallet. It's about deciding exactly how much authority AI should have.

How it's Made

Shepherd is built around account-level transaction verification using Solidity, EIP-8141 Frame Transactions and ERC-8421 alternative-mempool admission.

Smart contracts

Built with Solidity 0.8.28 and Foundry.

ShepherdAccount implements the account and EIP-8141 VERIFY logic.

ShepherdPolicy stores the external permission rules, including denied targets, approved targets and high-risk actions.

ShepherdRules enforces transaction restrictions such as TargetDenied, ValueCap and NeedsCosign.

ShepherdVault provides the demo environment for approved interactions and high-risk payout scenarios.

The account checks the target, function selector and transaction value before allowing execution. High-risk actions require an additional owner signature. Revocation acts as the emergency kill switch.

Alternative mempool integration

Shepherd uses an external policy contract during transaction verification. This creates a StorageReadNonSender restriction in canonical mempool validation.

We use the Ethereum Foundation workshop's ethrex and sidecar environment to demonstrate ERC-8421 staked alternative-mempool admission. The same external-state verification that fails in the canonical and unstaked paths can pass through the staked alternative-mempool path.

Client and agent infrastructure

TypeScript and viem handle frame encoding, transaction packing and submission.

React and Vite power the Shepherd console.

An MCP server allows coding agents to create child sessions, propose transactions and revoke permissions without accessing the owner's key.

A CLI provides an alternative way to run the same agent workflows.

The console includes account preparation, session grants, agent management, approvals and an interactive transaction-security demonstration.

The demo runs on the public alt-mempool workshop network (chain ID 1337).

The key architectural decision is that agents never receive the owner's private key. They operate through constrained sessions, while transaction verification and owner authorization remain separate responsibilities.

background image mobile

Join the mailing list

Get the latest news and updates

Shepherd | ETHGlobal