zerion-agent-management
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseZerion — Agent Token & Policy Management
Zerion — Agent令牌与策略管理
Agent tokens authorize the CLI to sign transactions on behalf of a wallet without a passphrase prompt. Policies attached to a token scope what the token can do (chains, allowlist, deny rules, expiry). This is the foundation for safe autonomous trading and off-chain signing.
Agent令牌授权CLI代表钱包签署交易,无需输入密码提示。绑定到令牌的策略会限定该令牌的操作范围(包括可操作链、白名单、拒绝规则、过期时间)。这是安全自主交易与链下签名的基础。
Setup
安装设置
If a command fails with , install once:
zerioncommand not foundbash
npm install -g zerion-cliRequires Node.js ≥ 20. For auth see the umbrella skill. To execute trades after setup → . To sign messages/typed-data → .
zerionzerion-tradingzerion-sign如果执行命令时出现错误,请执行以下安装命令:
zerioncommand not foundbash
npm install -g zerion-cli要求Node.js版本≥20。认证相关内容请查看总览技能。完成设置后执行交易请使用,签署消息/结构化数据请使用。
zerionzerion-tradingzerion-signWhen to use
使用场景
- "Create an agent token"
- "Set up autonomous trading"
- "Restrict the bot to chain X / address Y"
- "Block transfers" / "block approvals" / "expire the token in N days"
- "Switch which agent token is active"
- "Revoke a token"
- "创建Agent令牌"
- "设置自主交易"
- "限制机器人仅在X链/Y地址操作"
- "阻止转账" / "阻止授权" / "设置令牌N天后过期"
- "切换激活的Agent令牌"
- "撤销令牌"
Agent vs manual operations
Agent自主操作 vs 人工操作
| Operation | Type | Notes |
|---|---|---|
| Agent | Read-only or config-only. Safe autonomously. |
| Manual | Require passphrase or confirmation. Humans must run these directly. |
| 操作 | 类型 | 说明 |
|---|---|---|
| Agent自主操作 | 只读或仅配置操作,可安全地自主执行。 |
| 人工操作 | 需要密码或确认,必须由人工直接执行。 |
Read-only — agents may invoke freely
只读操作 — Agent可自由调用
bash
zerion agent list-tokens # Tokens, attached policies, active flag, wallet binding
zerion agent list-policies # All policies with rules summary
zerion agent show-policy <id> # Full policy details
zerion agent use-token --wallet <wallet> # Switch the active token (config edit, no passphrase)bash
zerion agent list-tokens # 令牌、绑定的策略、激活状态、钱包绑定信息
zerion agent list-policies # 所有策略及规则摘要
zerion agent show-policy <id> # 策略完整详情
zerion agent use-token --wallet <wallet> # 切换激活的令牌(仅修改配置,无需密码)Manual — humans only
人工操作 — 仅支持人工执行
Create an agent token
创建Agent令牌
bash
undefinedbash
undefinedInteractive policy picker (recommended)
交互式策略选择器(推荐)
zerion agent create-token --name <bot> --wallet <wallet>
zerion agent create-token --name <bot> --wallet <wallet>
Attach an existing policy by ID
通过ID绑定已有策略
zerion agent create-token --name <bot> --wallet <wallet> --policy <id>
zerion agent create-token --name <bot> --wallet <wallet> --policy <id>
Multiple policies (AND semantics — all must pass)
绑定多个策略(逻辑与——需满足所有策略规则)
zerion agent create-token --name <bot> --wallet <wallet> --policy <id1>,<id2>
The token is auto-saved to `~/.zerion/config.json` under `agentTokens` and (if no token was active before) becomes the default. Trading commands (`zerion-trading`) and signing commands (`zerion-sign`) read it from config.zerion agent create-token --name <bot> --wallet <wallet> --policy <id1>,<id2>
令牌会自动保存到`~/.zerion/config.json`的`agentTokens`字段下,如果之前没有激活的令牌,该令牌会成为默认令牌。交易命令(`zerion-trading`)和签名命令(`zerion-sign`)会从配置文件中读取该令牌。Revoke a token
撤销令牌
bash
zerion agent revoke-token --name <bot>
zerion agent revoke-token --id <id>bash
zerion agent revoke-token --name <bot>
zerion agent revoke-token --id <id>Create a policy
创建策略
A policy is a set of rules a token must pass before signing. At least one rule required.
bash
undefined策略是令牌在签署交易前必须满足的一组规则。至少需要设置一条规则。
bash
undefinedChain lock — restrict to specific chains
链锁定——限定到特定链
zerion agent create-policy --name safe-base --chains base,arbitrum
zerion agent create-policy --name safe-base --chains base,arbitrum
Expiry — token deactivates after duration (e.g. 24h, 7d)
过期设置——令牌在指定时长后失效(例如24h、7d)
zerion agent create-policy --name short-lived --expires 7d
zerion agent create-policy --name short-lived --expires 7d
Block raw native transfers (ETH/SOL send command)
阻止原生资产转账(ETH/SOL发送命令)
zerion agent create-policy --name no-transfers --deny-transfers
zerion agent create-policy --name no-transfers --deny-transfers
Block ERC-20 approvals (prevents allowance grants)
阻止ERC-20授权(禁止设置额度)
zerion agent create-policy --name no-approvals --deny-approvals
zerion agent create-policy --name no-approvals --deny-approvals
Allowlist — only allow interaction with specific contract addresses
白名单——仅允许与指定合约地址交互
zerion agent create-policy --name dex-only --allowlist 0xUniRouter,0xCowSwap
zerion agent create-policy --name dex-only --allowlist 0xUniRouter,0xCowSwap
Combined rules (AND semantics)
组合规则(逻辑与)
zerion agent create-policy --name strict
--chains base
--expires 7d
--deny-transfers
--deny-approvals
--chains base
--expires 7d
--deny-transfers
--deny-approvals
undefinedzerion agent create-policy --name strict
--chains base
--expires 7d
--deny-transfers
--deny-approvals
--chains base
--expires 7d
--deny-transfers
--deny-approvals
undefinedDelete a policy
删除策略
bash
zerion agent delete-policy <id>Tokens that referenced the deleted policy will no longer pass that rule check.
bash
zerion agent delete-policy <id>引用该已删除策略的令牌将不再通过对应的规则校验。
Policy reference
策略参数参考
| Flag | Effect |
|---|---|
| Restrict to listed chains (comma-separated) |
| Token deactivates after duration. Format: |
| Block raw native transfers ( |
| Block ERC-20 |
| Only allow interaction with listed contract addresses (comma-separated) |
Policies execute as locally-spawned scripts ( in the CLI repo). They run on every signing attempt before the transaction is built.
policies/*.mjs| 参数 | 作用 |
|---|---|
| 限定到指定链(逗号分隔) |
| 令牌在指定时长后失效,格式: |
| 阻止原生资产转账( |
| 阻止ERC-20 |
| 仅允许与指定合约地址交互(逗号分隔) |
策略通过本地运行的脚本执行(位于CLI仓库的),每次签署交易前、交易构建完成前都会运行策略校验。
policies/*.mjsRecommended setup pattern
推荐设置流程
bash
undefinedbash
undefined1. Create wallet (manual — see zerion-wallet skill)
1. 创建钱包(人工操作——查看zerion-wallet技能)
zerion wallet create --name agent-bot
zerion wallet create --name agent-bot
2. Create a tight policy
2. 创建严格的策略
zerion agent create-policy --name swap-only
--chains base,arbitrum
--expires 30d
--deny-transfers
--allowlist 0xUniswapRouter,0x1inchRouter
--chains base,arbitrum
--expires 30d
--deny-transfers
--allowlist 0xUniswapRouter,0x1inchRouter
zerion agent create-policy --name swap-only
--chains base,arbitrum
--expires 30d
--deny-transfers
--allowlist 0xUniswapRouter,0x1inchRouter
--chains base,arbitrum
--expires 30d
--deny-transfers
--allowlist 0xUniswapRouter,0x1inchRouter
3. Create the agent token bound to that policy
3. 创建绑定该策略的Agent令牌
zerion agent create-token --name agent-bot
--wallet agent-bot
--policy <swap-only-id>
--wallet agent-bot
--policy <swap-only-id>
zerion agent create-token --name agent-bot
--wallet agent-bot
--policy <swap-only-id>
--wallet agent-bot
--policy <swap-only-id>
Now zerion-trading and zerion-sign work autonomously
至此,zerion-trading和zerion-sign可自主执行操作
undefinedundefinedCommon errors
常见错误
| Code | Cause | Fix |
|---|---|---|
| No active token for wallet | |
| Policy | Create a fresh token |
| Action blocked by policy | |
| Policy ID doesn't exist | |
| | Add at least one rule ( |
| Duplicate | Choose another name or |
| 错误码 | 原因 | 解决方法 |
|---|---|---|
| 钱包没有激活的令牌 | 执行 |
| 策略的 | 创建新的令牌 |
| 操作被策略阻止 | 执行 |
| 策略ID不存在 | 执行 |
| 创建策略时未设置任何参数 | 添加至少一条规则( |
| | 更换名称或先执行 |