Skip to main content
Glama

AESP - Agent Economic Sovereignty Protocol

定义 AI 代理如何在人类主权下进行经济活动。

网站 | npm

什么是 AESP

AESP 是一个 TypeScript SDK 和 MCP 集成层,用于在人类明确控制下进行代理支付。它旨在让代理能够执行经济操作,同时人类保留完整的经济主权。

核心原则:

  • 策略门控执行 -- 每笔支出操作都受可配置策略规则约束(每笔交易限额、每日/每周/每月预算、地址白名单、时间窗口)。

  • 人工干预路径 -- 高风险操作会被升级到审查队列,而不是自动批准。

  • 可验证承诺 -- 执行上下文可绑定到 EIP-712 签名意图,从而提供链上结算保证。

  • 实用集成 -- MCP 工具将保险库操作暴露给 AI 代理框架;子路径导出让你只导入所需内容。

Related MCP server: AgentPay MCP Server

安装

npm install @yault/aesp

需要 Node.js >= 18。

快速开始

添加到 Claude Desktop

将以下内容添加到你的 Claude Desktop 配置(claude_desktop_config.json):

{
  "mcpServers": {
    "yault": {
      "command": "npx",
      "args": ["-y", "@yault/aesp"],
      "env": {
        "YAULT_API_KEY": "sk-yault-..."
      }
    }
  }
}

添加到 Claude Code

claude mcp add yault -- npx -y @yault/aesp

然后在你的 shell 或 .claude/settings.json 中设置环境变量 YAULT_API_KEY

独立运行

export YAULT_API_KEY="sk-yault-..."
yault-mcp                  # if installed globally
npx @yault/aesp            # via npx

获取你的 API 密钥

前往 yault.xyz 创建账户并获取你的 API 密钥(sk-yault-*)。该密钥与你的保险库绑定——每个用户管理自己的密钥。代理开发者无需密钥,除非他们同时也是保险库用户;由最终用户在自己的 MCP 客户端中配置密钥。

使用 SDK 模块

import { PolicyEngine } from '@yault/aesp/policy';
import { getAllMCPTools } from '@yault/aesp/mcp';
import { NegotiationStateMachine } from '@yault/aesp/negotiation';

const engine = new PolicyEngine(storageAdapter);
await engine.load();

const tools = getAllMCPTools(); // 6 MCP tool definitions

模块

AESP 按子路径导出组织,让你只需导入所需内容:

子路径

描述

@yault/aesp

所有模块的统一再导出

@yault/aesp/types

共享类型定义(AgentExecutionRequestTransferPayloadChainId 等)

@yault/aesp/policy

策略引擎,支持 8 项检查评估、预算跟踪和策略变更分类

@yault/aesp/identity

代理身份派生、证书创建和层级管理

@yault/aesp/negotiation

带会话管理的报价/还价状态机

@yault/aesp/commitment

用于双重签名协议的 EIP-712 结构化承诺构建器

@yault/aesp/review

带冻结/解冻控制的人工介入审查队列

@yault/aesp/mcp

MCP 工具定义、参数验证和服务器路由器

@yault/aesp/a2a

用于跨代理发现(A2A 协议)的代理卡片构建器

@yault/aesp/crypto

密码学辅助:签名、加密、哈希、ZK 证明桥

@yault/aesp/privacy

上下文标记、临时地址池和整合调度

MCP 工具

stdio 服务器暴露了 6 个与后端连接的工具:

工具

方法 + 端点

用途

yault_check_balance

GET /api/vault/balance/:address

读取钱包保险库余额

yault_deposit

POST /api/vault/deposit

将底层资产存入保险库

yault_redeem

POST /api/vault/redeem

赎回保险库份额

yault_transfer

POST /api/vault/transfer

转移保险库分配(从父账户到子账户)

yault_check_authorization

GET /api/vault/agent-authorization

读取操作员/授权额度状态

yault_get_balances

GET /api/vault/balances/:address

读取多余额明细

后端要求

MCP 服务器是一个轻量 API 客户端。它期望 Yault 后端提供:

  • GET /api/vault/balance/:address

  • GET /api/vault/balances/:address

  • GET /api/vault/agent-authorization

  • POST /api/vault/deposit -- { address, amount }

  • POST /api/vault/redeem -- { address, shares }

  • POST /api/vault/transfer -- { from_address, to_address, amount, currency? }

身份验证:通过 YAULT_API_KEY 环境变量提供 Authorization: Bearer sk-yault-*

安全模型

AESP 围绕“有限自主权”构建:

  • 代理 API 密钥应在支出执行前绑定策略。

  • 支出控制应包含每笔交易限额和滚动限额(每日/每周/每月)。

  • 适用时,目标地址约束应以白名单驱动。

  • 敏感操作应保持在宽泛的代理密钥范围之外。

  • 人工升级仍是策略违规时的回退方案。

如需报告漏洞,请参阅 SECURITY.md

相关包

描述

@yault/elizaos-plugin-aesp

封装 AESP 供代理框架使用的 ElizaOS 插件

开发

运行测试:

npm test

构建 TypeScript:

npm run build:ts

使用 WASM 构建(需要 acegf-wallet 作为同级仓库,或设置 ACEGF_ROOT):

npm run build:wasm
npm run build:ts

完整开发指南请参阅 CONTRIBUTING.md

许可证

本项目采用 Apache License 2.0 许可证。完整文本请参阅 LICENSE

A
license - permissive license
Not graded
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    Not graded
    quality
    A
    maintenance
    Provides a trust and governance layer for AI agents, enabling secure API access, credential vaulting, paid execution with human approval, and automatic call resume.
    8
    2
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables AI agents to analyze Ethereum wallets, simulate transactions, and draft transfers with deterministic policy and risk scoring, requiring human approval before on-chain execution.
    2
    ISC
  • A
    license
    A
    quality
    C
    maintenance
    Enables AI agents to make payments with strict spending limits enforced by signed mandates, preventing unauthorized fund movement beyond predefined caps and allowlists.
    4
    22
    MIT

View all related MCP servers

Related MCP Connectors

  • USDC treasury vaults, streaming payments, and DeFi yield for AI agents

  • Agent payments, API key vaulting, and governed mandates. Agents spend within user-defined limits.

  • Runtime permission, approval, and audit layer for AI agent tool execution.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/acechain-io/aesp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server