Token导航 LogoToken导航TokenDH.com
开发敏感数据clawhub未标认证来源可访问clear审计通过

agent-mandate-protocolAgent 授权协议

Agent Skill

agent-mandate-protocol 用于补充开发相关能力,适合在 OpenClaw 中需要让 Agent 承接开发相关任务时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

5,208

周安装

217

GitHub Stars

1

下载量

1,736
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:agent-mandate-protocol(Agent 授权协议)
来源仓库:https://github.com/jimmyshuyulee/agent-mandate-protocol
安装命令:
openclaw skills install agent-mandate-protocol
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install agent-mandate-protocol

简介

使用 A-MAP 协议验证与签署代理间请求。

  • 支持权限委派与子代理授权管理。
  • 涵盖密码学与身份认证机制。agent-mandate-protocol 属于开发类 Skill,可作为该场景下的辅助能力补充。
  • 涉及密钥管理与安全凭证存储。适用宿主包括 OpenClaw,接入前应确认版本、权限和运行环境要求。
  • 必须严格管控私钥与访问权限。

SKILL.md

name
agent-mandate-protocol
description
>
communication
prove a human authorized an agent, prevent replay attacks,
version
1.0.0
tags
metadata
openclaw
requires
bins
env
homepage
https://github.com/Agent-Mandate-Protocol/a-map/tree/main/sdks/typescript/openclaw

A-MAP Skill

A-MAP (Agent Mandate Protocol) gives AI agents cryptographic proof of what they are authorized to do — and lets services verify that proof before acting.

Install

npm install @agentmandateprotocol/core

Part 1: Verify — Authenticate an Incoming Agent Request

Use this when another agent sends you a request and you need to confirm it was authorized by a human before acting on it.

When to verify

  • A request includes X-AMAP-Mandate, X-AMAP-Signature, X-AMAP-Timestamp,

X-AMAP-Nonce, or X-AMAP-Agent-DID headers

  • You need to detect agent impersonation or replay attacks
  • You need cryptographic proof of who authorized this agent to act

What you need

  • The five A-MAP headers from the incoming request
  • The expected permission the caller claims to have
  • The public keys of all agents in the chain (distribute out-of-band)

How to verify

import { amap, InMemoryNonceStore, LocalKeyResolver } from '@agentmandateprotocol/core'

const keyResolver = new LocalKeyResolver(new Map([
  ['did:amap:sender-agent:1.0:abc', process.env.SENDER_PUBKEY],
]))

// Use Redis or Cloudflare KV in production — see Guardrails
const nonceStore = new InMemoryNonceStore()

try {
  const result = await amap.verifyRequest({
    headers: {
      'X-AMAP-Agent-DID': request.headers['x-amap-agent-did'],
      'X-AMAP-Mandate':   request.headers['x-amap-mandate'],
      'X-AMAP-Signature': request.headers['x-amap-signature'],
      'X-AMAP-Timestamp': request.headers['x-amap-timestamp'],
      'X-AMAP-Nonce':     request.headers['x-amap-nonce'],
    },
    method: request.method,
    path:   request.path,
    body:   request.body,
    expectedPermission: 'book_flight',
    keyResolver,
    nonceStore,
  })

  // Safe to proceed
  console.log('Authorized by:', result.principal)
  console.log('Effective limits:', result.effectiveConstraints)
  console.log('Audit ID:', result.auditId)  // always log this
} catch (err) {
  // A-MAP throws on any failure — never returns { valid: false }
  console.error(`Authorization failed: [${err.code}] ${err.message}`)
  // Reject the request
}

Interpreting the result

On success (no error thrown):

  • result.principal — the human who originally authorized this chain
  • result.effectiveConstraints — merged limits across all hops (e.g. maxSpend: 347)
  • result.chain — array of verified links, one per hop
  • result.auditId — UUID for this verification event — log it for audit trail

On failure (AmapError thrown):

  • err.code — specific error code (see references/error-codes.md)
  • err.hop — which link in the chain failed (0 = root), if applicable

Verify guardrails

  • Never proceed with an action if verifyRequest() throws
  • Always log result.auditId for audit trail
  • The default InMemoryNonceStore does not work behind a load balancer —

use a shared store (Redis, Cloudflare KV) in multi-instance deployments

  • Always check result.effectiveConstraints before consequential actions

(e.g. check maxSpend before charging a card)

  • An AmapError means the agent was not authorized, the request is a replay,

the chain was forged, or the identity is being spoofed — always reject


Part 2: Sign — Authenticate an Outgoing Request

Use this before calling any A-MAP-protected service to attach cryptographic proof that a human authorized your action.

When to sign

  • You are calling a service that uses A-MAP to verify agents
  • You need to prove a human authorized your action
  • You are forwarding a delegation chain to a downstream service

Prerequisites

  • A mandate chain (from amap.issue() or amap.delegate())
  • Your agent's Ed25519 private key in AMAP_PRIVATE_KEY

How to sign

import { amap } from '@agentmandateprotocol/core'

const headers = amap.signRequest({
  mandateChain: myMandateChain,
  method:       'POST',
  path:         '/api/book-flight',
  body:         JSON.stringify(requestBody),  // omit if no body
  privateKey:   process.env.AMAP_PRIVATE_KEY,
})

await fetch('https://api.example.com/book-flight', {
  method:  'POST',
  headers: { 'Content-Type': 'application/json', ...headers },
  body:    JSON.stringify(requestBody),
})

amap.signRequest() returns five headers ready to spread:

HeaderContent
X-AMAP-Agent-DIDDID of the signing agent
X-AMAP-MandateBase64url-encoded DelegationToken chain
X-AMAP-SignatureEd25519 signature over canonical payload
X-AMAP-TimestampISO8601 UTC timestamp
X-AMAP-Nonce128-bit random hex string (single-use)

See references/signed-request-format.md for the full payload schema.

Sign guardrails

  • Never hardcode AMAP_PRIVATE_KEY — always use an environment variable
  • Never log the private key
  • A fresh nonce is generated on every signRequest() call — never reuse headers
  • Check mandate expiry before signing — an expired mandate produces headers

the receiver will reject with TOKEN_EXPIRED


Part 3: Delegate — Authorize a Sub-Agent

Use this when spawning a sub-agent that needs its own cryptographic proof of authorization to call external services on your behalf.

When to delegate

  • You are spawning a sub-agent to handle part of a task
  • A sub-agent needs to call A-MAP-protected services directly
  • You want to limit what the sub-agent can do to a safe subset of your permissions

How to delegate

import { amap } from '@agentmandateprotocol/core'

// myToken = DelegationToken you received; myChain = full chain including myToken
let childToken
try {
  childToken = await amap.delegate({
    parentToken: myToken,
    parentChain: myChain,
    delegate:    'did:amap:sub-agent:1.0:xyz',
    permissions: ['charge_card'],     // must be subset of myToken.permissions
    constraints: { maxSpend: 347 },   // can only tighten, never relax
    expiresIn:   '15m',               // cannot exceed parent's remaining TTL
    privateKey:  process.env.AMAP_PRIVATE_KEY,
  })
} catch (err) {
  // AmapError thrown BEFORE signing if an invariant is violated:
  //   PERMISSION_INFLATION  — permissions not in parent
  //   CONSTRAINT_RELAXATION — constraint looser than parent
  //   EXPIRY_VIOLATION      — TTL exceeds parent's remaining time
  throw err
}

// Pass the full chain to the sub-agent — not just the child token
const subAgentChain = [...myChain, childToken]

The sub-agent uses amap.signRequest({ mandateChain: subAgentChain, ... }) to attach this chain to its outgoing requests.

Expiry strategy

Task typeRecommended TTL
Single API call15s
One-off task60s
Short workflow5m
Extended sessionMatch parent — SDK enforces the ceiling

The three rules (enforced by SDK — see references/delegation-invariants.md)

  1. Permissions can only narrow — you cannot grant what you do not have
  2. Constraints can only tighten — you cannot relax a limit set above you
  3. Expiry can only shorten — sub-agent tokens expire before yours

Delegate guardrails

  • Always pass subAgentChain (full chain), not just the new token
  • Set the shortest possible expiresIn for sub-agents
  • Log childToken.tokenId for audit trail
  • Never share your AMAP_PRIVATE_KEY — each agent has its own keypair

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

81.84%
按下载量换算1,421

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills