@absolutejs/agent-exchange

中文文档
0.5.1发布于 2026/09/25Apache-2.0TypeScriptES Module近 30 天下载 1925

Verified, model-blind sensitive-value exchange for humans and agents using Agency, A2A, and E2EE.

原始使用文档
文档目录7 节
  1. Explicit assurance
  2. Standing mandates
  3. Security invariants
  4. A2A boundary
  5. Interchangeable sources
  6. License
  7. Release compatibility

@absolutejs/agent-exchange

Verified, purpose-bound, model-blind sensitive-value exchange for humans and agents. It composes existing AbsoluteJS primitives instead of creating another permission or transport system:

Auth identity and delegation
        ↓
Agency approval and single-use execution lease
        ↓
deterministic source tool → E2EE envelope → deterministic recipient sink
        ↓
A2A carries an opaque exchange reference and redacted receipt

The default processing mode is tool-confined. Protected bytes are supplied to trusted tools, wiped on every completion path, and excluded from the request, Agency ledger, A2A task history, errors, telemetry, and receipts.

This is an experimental 0.x release and has not been independently audited. Phishing resistance is available only when every declared assurance requirement is actually satisfied; email and SMS codes remain bearer credentials.

Explicit assurance

Every request declares three independent assurances. The phishing-resistant shape is intentionally unrepresentable with a bearer credential or general execution:

assurance: {
  approval: "webauthn-verifier-bound",
  credential: "sender-constrained",
  execution: "purpose-bound",
}

For this mode, beginApproval() derives a domain-separated SHA-256 challenge from the complete immutable exchange. approve() accepts only a configured approval provider's verified WebAuthn result for the requester's exact subject and authority origin. The resulting Agency approval stores a hash of the credential identifier, never the assertion or raw identifier. Both lease issuance and execution re-check that evidence against the current request.

This follows WebAuthn's requirements to validate the challenge, origin, RP ID hash, user-presence flag, and—when requested—the user-verification flag. The provider must request user verification and perform the cryptographic assertion validation.

When an upstream provider issues bearer access tokens but Absolute PaaS confines them to a deterministic broker, the request uses a separate, deliberately weaker shape:

assurance: {
  approval: "webauthn-verifier-bound",
  credential: "token-confined-broker",
  execution: "purpose-bound",
}

This means the token is inaccessible to both agents and restricted to one approved tool operation, but the upstream resource itself does not cryptographically bind the access token to the broker. It must never be described as equivalent to a sender-constrained DPoP or mTLS token.

Standing mandates

Long-running agent-to-agent automation uses a separate assurance value:

assurance: {
  approval: "standing-mandate",
  credential: "token-confined-broker",
  execution: "purpose-bound",
}

createAgentExchangeStandingMandateAuthority() issues and verifies a compact JWS whose canonical payload binds the owner, requesting agent, executing agent, exact OAuth agent delegation, account, provider, origin, operation, purpose, risk class, secret kind, activation window, expiry, and total use limit. Issuance requires fresh, user-verified WebAuthn evidence. Authorization additionally requires the request's delegationId to be present as its independently authenticated agent delegation, requires the request's separate mandateId to equal the signed mandate ID, and atomically consumes the exchange ID in a revocation store. The JWS is not placed in A2A task history.

The core accepts interchangeable JWS signer, verifier, and durable store implementations. Production verifiers must authenticate the trusted issuer and key ID, enforce the explicit JWS type and allowed algorithm, and reject unknown or revoked registrations. The memory store is for tests and local development only.

This design uses the signed-payload format from RFC 7515, canonical JSON rules from RFC 8785, the narrow actions and locations model from RFC 9396, and the separate subject/actor semantics described by RFC 8693. It does not make the wire contract depend on an unfinished transaction-token or chain-delegation draft.

Security invariants

  • Every request binds requester, recipient, purpose, service origin, account reference, operation, assurance, expiry, nonce, processing mode, and maximumUses: 1.
  • Agency authorizes the metadata-only action and consumes the execution lease before a source is read.
  • Recipient consent is checked against the same request.
  • The receiver authenticates the envelope, then atomically consumes the nonce before sink execution. Invalid ciphertext cannot burn a legitimate exchange.
  • Source, envelope, transport, and sink failures become allowlisted error codes; dependency error messages never cross the boundary.
  • Receipts and sink references are scanned for direct, UTF-8, hexadecimal, base64, and base64url representations of the protected value.
  • High-risk recovery, administrative, security-setting, money movement, and export flows are denied unless the host explicitly opts them in.
  • Standing mandates are exact-match allowlists, never wildcard scopes. Revocation, replay prevention, expiry, and total use limits are enforced by one atomic store.

A2A boundary

@absolutejs/agent-exchange/a2a adds the Agent Exchange extension to an Agent Card and creates request messages containing only an opaque exchange reference and safe metadata. Envelopes are delivered through the configured exchange transport, not persisted in ordinary A2A task history.

See SECURITY.md before using real protected data.

Interchangeable sources

Source integrations live in the public absolutejs/agent-exchange-sources monorepo so this core never depends on mailbox, SMS, vault, or device-provider SDKs.

The first adapter is @absolutejs/agent-exchange-email. It binds deterministic Gmail, Microsoft Graph, or IMAP retrieval from @absolutejs/email to the same SensitiveValueSource API:

bun add @absolutejs/agent-exchange @absolutejs/agent-exchange-email @absolutejs/email

Verification-code retrieval remains absent from model-facing manifests. The adapter hands mutable bytes directly to this package for encryption, and this package wipes them after delivery.

License

Apache-2.0

Release compatibility

The 0.5.x line uses the version-bound @absolutejs/[email protected] certification contract and the separately certified provider runtimes. Provider admission remains the host's responsibility; a compatible type does not replace release-specific security evidence.

版本与发布记录

@absolutejs/agent-exchange 共发布 11 个版本,首次发布于 2026/08/26;过去 12 个月发布了 11 个版本。

版本发布日期距今
0.5.1latest2026/09/251 个月前
0.5.02026/08/272 个月前
0.4.42026/08/262 个月前
0.4.32026/08/262 个月前
0.4.22026/08/262 个月前
0.4.12026/08/262 个月前

关于 @absolutejs/agent-exchange 的常见问题

@absolutejs/agent-exchange 是什么?

Verified, model-blind sensitive-value exchange for humans and agents using Agency, A2A, and E2EE.

如何安装 @absolutejs/agent-exchange?

在项目目录运行 npm install @absolutejs/agent-exchange,或使用 pnpm add / yarn add / bun add。

@absolutejs/agent-exchange 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@absolutejs/agent-exchange 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@absolutejs/agent-exchange 可以商用吗?

@absolutejs/agent-exchange 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@absolutejs/agent-exchange 的下载量有多少?

根据 npm 官方下载统计,@absolutejs/agent-exchange 在 2026/10/05 – 2026/11/03 这 30 天内被下载 1,925 次,日均约 64 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@absolutejs/agent-exchange 还在维护吗?

最新版本 0.5.1 发布于 2026/09/25(1 个月前);至今共发布 11 个版本,其中过去 12 个月发布了 11 个;首次发布于 2026/08/26。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。