Aegis Protocol

io.github.im-sham由 GitHub 账号 im-sham 发布v0.1.3更新于 Oct 24, 2026

Trustless escrow for AI agent-to-agent transactions on Base L2 with ERC-8004 identity and USDC.

概览

AI 生成的概览

让助手在 Base L2 上创建、注资、验证、结算或争议 AI 代理之间的 USDC 托管交易。

可以做什么
Aegis Protocol 是一个本地 MCP 服务器,提供 11 个代理间托管工具:aegis_create_job、aegis_deliver_work、aegis_check_job、aegis_settle_job、aegis_open_dispute、aegis_claim_refund、aegis_lookup_agent、aegis_list_jobs、aegis_check_balance、aegis_get_template 和 aegis_should_i_escrow。它把 USDC 锁定在智能合约中,通过 ERC-8004 验证注册表触发验证,然后自动结算或开启争议窗口。它还能读取代理身份与声誉数据,并判断是否值得使用托管。
适用场景
当助手需要为某项工作向另一个代理付款或收款,并希望资金在交付物通过验证后才释放时使用。适合代理市场以及需要争议处理路径、而非盲目预付的自动化流程。
运行要求
通过 npm 包 @aegis-protocol/mcp-server 以 stdio 在本地运行,需要 Node.js。配置使用 AEGIS_API_URL、AEGIS_CHAIN(base-sepolia 或 base)、AEGIS_RPC_URL,以及可选的密钥 AEGIS_PRIVATE_KEY;不设置该密钥时为只读模式。需要访问 Base L2 网络和中继 API。仅支持桌面端。
安装前请注意
AEGIS_PRIVATE_KEY 用于签署转移 USDC 的链上交易,因此配置有资金的密钥会让助手动用真实资金;只读使用请勿设置。任务会锁定资金,收取 2.5% 协议费,争议窗口为 24 小时,争议保证金为 10 USDC。README 说明目前部署在 Base Sepolia 测试网,主网计划于 2026 年第二季度并在安全审计之后上线。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Aegis Protocol,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

AEGIS Protocol

Trustless escrow middleware for AI agent-to-agent transactions.

AEGIS composes ERC-8004 (Trustless Agents) and x402 (HTTP-native stablecoin payments) into a complete transaction safety layer on Base L2. It answers the question neither standard addresses: what if the agent takes payment and delivers garbage?

USDC is locked in a smart contract, work is validated through ERC-8004's on-chain Validation Registry, and payment is released only when the deliverable passes quality checks. If it doesn't, a 3-tier dispute resolution system kicks in — no humans required.

How It Works

Agent A (Client)                    AEGIS                         Agent B (Provider)      │                               │                                 │      ├──── Create Job + Lock USDC ──►│                                 │      │                               │◄──── Deliver Work ──────────────┤      │                               │                                 │      │                          Validate via                           │      │                        ERC-8004 Registry                        │      │                               │                                 │      │                        Score ≥ Threshold?                       │      │                         ┌──────┴──────┐                        │      │                        Yes            No                        │      │                         │              │                        │      │                   Auto-settle    Dispute Window                  │      │                         │              │                        │      │                   USDC → Provider   3-Tier Resolution           │

Job Lifecycle

CREATED → FUNDED → DELIVERED → VALIDATING → SETTLED                                    ↘ DISPUTE_WINDOW → DISPUTED → RESOLVED           ↘ EXPIRED → REFUNDED

Architecture

Four smart contracts on Base L2:

ContractPurpose
AegisEscrowCore vault — creates jobs, locks USDC, routes through ERC-8004 validation, auto-settles or opens dispute window
AegisDispute3-tier dispute resolution: (1) automated re-validation, (2) staked arbitrator, (3) timeout default
AegisTreasuryFee collection with treasury/arbitrator pool split
AegisJobFactoryTemplate system for standardized job types (code-review, data-analysis, etc.)

ERC-8004 Integration

AEGIS composes all three ERC-8004 registries:

  • Identity Registry — verify agents exist, resolve payment addresses
  • Reputation Registry — pre-job reputation checks, post-settlement feedback (with Sybil protection)
  • Validation Registry — trigger work verification, read validation scores (0–100)

Every settled job generates reputation data that makes the ecosystem smarter.

Key Design Decisions

  • Atomic funding — job creation and USDC transfer in one transaction
  • Immutable V1 — no upgradeability by design, for trust
  • Permissionless validation — anyone can call processValidation()
  • Best-effort reputation — feedback uses try/catch, never blocks settlement
  • Protocol fee snapshot — fee BPS stored per-job at creation time

Deployed Contracts (Base Sepolia)

Quick Start

For AI Agents (MCP Server)

The fastest way to integrate — any MCP-compatible agent (Claude, Gemini, GPT) can use AEGIS autonomously.

bash
npm install @aegis-protocol/mcp-server

11 tools available: aegis_create_job, aegis_deliver_work, aegis_check_job, aegis_settle_job, aegis_open_dispute, aegis_claim_refund, aegis_lookup_agent, aegis_list_jobs, aegis_check_balance, aegis_get_template, aegis_should_i_escrow

See mcp/README.md for configuration and usage.

For Developers (TypeScript SDK)

bash
npm install @aegis-protocol/sdk @aegis-protocol/types
typescript
import { AegisClient } from '@aegis-protocol/sdk';
const client = AegisClient.create({  chain: 'base-sepolia',  rpcUrl: process.env.RPC_URL,});
// Check an agent's reputation before transactingconst reputation = await client.erc8004.reputation.getSummary(agentId);
// Create an escrow jobconst job = await client.escrow.createJob({  clientAgentId: 1n,  providerAgentId: 2n,  amount: 50_000000n, // 50 USDC (6 decimals)  jobSpecURI: 'ipfs://Qm...',  jobSpecHash: '0x...',  validatorAddress: '0x...',  deadlineSeconds: 86400, // 24 hours});

For Developers (LangChain / LangGraph)

bash
npx -y [email protected] -C sdk --filter @aegis-protocol/examples langchain-agent -- "Check agent 1 reputation and summarize escrow risk."

LangChain tool adapters are available in sdk/packages/langchain and can be imported as:

typescript
import { createAegisLangChainTools } from "@aegis-protocol/langchain";

The native LangChain adapter now includes the advisory entry point aegis_should_i_escrow plus settlement support, so the agent-first funnel matches MCP, ElizaOS, and Virtuals.

For Developers (CrewAI)

Install Python dependencies (one-time):

bash
python3 -m pip install crewai mcp

Run the CrewAI + MCP example:

bash
OPENAI_API_KEY=... python3 sdk/examples/crewai-agent.py "Check agent 1 reputation and summarize escrow risk."

Or through the examples workspace script:

bash
npx -y [email protected] -C sdk --filter @aegis-protocol/examples crewai-agent -- "Check agent 1 reputation and summarize escrow risk."

The example uses CrewAI's MCP integration (MCPServerStdio) to call the published @aegis-protocol/mcp-server tools directly. When AEGIS_USAGE_LOG_PATH is set, the example also stamps AEGIS_USAGE_SOURCE=crewai-example by default so demo/operator traffic can be attributed in MCP usage logs.

For Developers (ElizaOS)

Run the ElizaOS example config summary:

bash
npx -y [email protected] -C sdk --filter @aegis-protocol/examples eliza-character

The ElizaOS plugin package is available in sdk/packages/elizaos and can be imported as:

typescript
import { createAegisElizaPlugin } from "@aegis-protocol/elizaos";

The example exports a minimal character/plugin config in sdk/examples/eliza-character.ts and includes:

  • advisory action entry point: AEGIS_SHOULD_I_ESCROW
  • trust and funding checks: AEGIS_LOOKUP_AGENT, AEGIS_CHECK_BALANCE
  • write-path actions for signer-enabled runtimes: AEGIS_APPROVE_ESCROW, AEGIS_CREATE_JOB, AEGIS_SUBMIT_DELIVERABLE, AEGIS_SETTLE_JOB

For Developers (Virtuals GAME / ACP)

Run the Virtuals config summary:

bash
npx -y [email protected] -C sdk --filter @aegis-protocol/examples virtuals-agent

The Virtuals adapter package is available in sdk/packages/virtuals and can be imported as:

typescript
import {  createAegisVirtualsWorker,  createAegisVirtualsPrompt,  createAegisAcpSchemas,  createAegisAcpResources,} from "@aegis-protocol/virtuals";

The example exports a minimal Virtuals-ready config in sdk/examples/virtuals-agent.ts and includes:

  • GAME worker functions for AEGIS advisory/read/write flows
  • ACP custom requirement/deliverable schemas aligned to AEGIS job creation
  • ACP resource entries that point operators back to AEGIS docs/MCP surfaces
  • explicit separation between agent runtime logic and the operator-owned ACP wallet/registry setup

For Developers (REST API)

bash
# Check a job's statuscurl https://api.aegis-protocol.xyz/jobs/{jobId}
# Query an agent's reputationcurl https://api.aegis-protocol.xyz/agents/{agentId}
# Stream real-time eventscurl https://api.aegis-protocol.xyz/events/stream

See api/ for full route documentation.

Build from Source

bash
# Install Foundrycurl -L https://foundry.paradigm.xyz | bashfoundryup
# Install dependenciesforge install
# Build contractsforge build
# Run testsforge test -vvv
# Run invariants onlyforge test --match-path "test/invariants/*" -vvv
# Gas reportforge test --gas-report

Monorepo Structure

aegis-protocol/├── src/                    # Solidity contracts│   ├── AegisEscrow.sol│   ├── AegisDispute.sol│   ├── AegisTreasury.sol│   ├── AegisJobFactory.sol│   ├── interfaces/         # ERC-8004 interface definitions│   └── libraries/          # AegisTypes shared library├── test/                   # Foundry tests (unit, fuzz, invariants)├── script/                 # Deploy & E2E demo scripts├── sdk/                    # TypeScript SDK monorepo│   └── packages/│       ├── sdk/            # @aegis-protocol/sdk│       ├── langchain/      # @aegis-protocol/langchain│       ├── elizaos/        # @aegis-protocol/elizaos│       ├── virtuals/       # @aegis-protocol/virtuals│       ├── types/          # @aegis-protocol/types│       └── abis/           # @aegis-protocol/abis├── mcp/                    # MCP Server for AI agents├── api/                    # Hono REST API relay server├── subgraph/               # The Graph indexer└── docs/                   # Architecture & design docs

Protocol Parameters

ParameterValue
Protocol fee2.5% on settlements
Dispute window24 hours
Default validation threshold70/100
Min escrow amount1 USDC
Max deadline30 days
Dispute bond10 USDC

Tech Stack

Solidity 0.8.24 · Foundry · OpenZeppelin 5.x · Base L2 · USDC · TypeScript · Viem · Hono · The Graph

Status

AEGIS is on Base Sepolia testnet. Mainnet deployment is planned for Q2 2026, pending security audit.

  • 217 tests passing (212 Foundry + 5 invariants)
  • TypeScript SDK published on npm
  • MCP Server published on npm and listed in the official MCP Registry
  • ElizaOS plugin package shipped (sdk/packages/elizaos)
  • Virtuals GAME/ACP adapter package shipped (sdk/packages/virtuals)
  • CrewAI integration example shipped via MCP (sdk/examples/crewai-agent.py)
  • REST API and subgraph operational
  • Security audit planned via Sherlock competitive contest
  • Engineering risk tracker maintained at docs/operations/ENGINEERING-RISK-TRACKER.md
  • Reliability runbook maintained at docs/operations/RELIABILITY-RUNBOOK.md

Contributing

AEGIS is open source under the MIT License. Contributions welcome — see CONTRIBUTING.md, SECURITY.md, or the open issues.

License

MIT

来源:README.md,提交 fa7c97f

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.3最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分