@ailu-ai/verify

中文文档
2.8.5发布于 2026/11/06Apache-2.0ES Module近 30 天下载 1785

Offline, independent verifier for an Ailu Certificate of Execution — re-checks the Ed25519 signature, walks the attestation chain, AND re-derives the run from the capsule alone. npx @ailu-ai/verify capsule.json.

原始使用文档

@ailu-ai/verify

Offline, independent verifier for an Ailu Certificate of Execution — the signed audit-export bundle (GET /runs/:id/audit-export). It checks integrity and replay from the capsule alone, without a control plane. Authenticity requires an issuer key obtained independently.

npx @ailu-ai/verify capsule.json
# The command above checks integrity only: at best INTACT (origin not proven), exit 3.
# Pin the signing key you obtained out-of-band to verify the issuer:
npx @ailu-ai/verify capsule.json --key <base64-spki-public-key>

Three independent checks:

  1. signature — Ed25519 over sha256(bundle − signature) against the embedded key.
  2. chain — the approval attestation chain is hash-linked and every signature is valid. If records are absent or empty, the CLI shows — not applicable (no records).
  3. replay — the run is re-derived on the OSS engine from the embedded { graph, entryState, journal } and must reach the same attested decisions, in order: the tool calls its agents ask for, then the human gate where it stops (replayedDecisions from @ailu-ai/graph-sdk). Don't trust us — re-run it yourself.

Verdicts and exit codes (verdict in the library):

VerdictExitMeaning
VERIFIED (verified)0the key is pinned, the signature holds, every record is signed by that key, and the replay reproduces the attested decisions
NOT VERIFIED (not-verified)1a check failed: signature, pinned key, chain, replay — or the capsule attests signed decisions but carries no reproduction (no reproduction, or one without graphDefinition or entryState): replay missing
usage error2no capsule, an unreadable capsule, or --key without a value
INTACT (intact)3every check that could run passed, but something is not proven: the origin (no --key: the issuer is UNTRUSTED) or the run (no decision and no reproduction: nothing re-derived)

ok is verdict === "verified"; issuerTrusted says the signature holds under the pinned key.

Trust anchor. Without --key, the signature is verified against the key inside the capsule — a forger could re-sign a doctored capsule with their own key. Pass --key with a key you trust (obtained from the issuer through a trusted channel) to pin it. Copying the embedded key from an untrusted capsule does not establish trust.

Trust model. Every attestation record must be signed by the anchoring key — the pinned key, else the capsule's own (G2). A record signed by any other key (a retired issuer key, a third party) fails the chain: chainValid is false and the capsule is NOT VERIFIED. chainValid does not independently authenticate the people named in resolvedBy.

Runs without governed approvals may have an empty chain: no decisions were checked, and chainValid remains vacuously true. A capsule without reproduction data has not been replayed (reproducible and replayValid are false): with signed decisions it is NOT VERIFIED (replay missing), without any it is at best INTACT. When reproduction data is present, replay must succeed.

Library use:

import { verifyCapsule } from "@ailu-ai/verify";
const result = await verifyCapsule(capsule, { expectedPublicKey });
// → { signatureValid, keyPinned, issuerTrusted, chainValid, replayValid, reproducible, verdict, ok, notes }

The replay leg needs the native engine (@ailu-ai/napi, pulled transitively) for your platform.

What VERIFIED does and does not say

VERIFIED means: the capsule is signed by the key you pinned, its attestation chain is intact, and re-running the run from the capsule reaches the same decisions the signed links name, in order — for a human gate, « the replay stops at gate X and a signed link names gate X ». It does not mean « gate X was approved according to its quorum ». In particular:

  • The pinned key anchors the capsule and every record. A record signed by another key than the pinned one is refused, even inside a capsule the pinned key signed. chain does not authenticate the approvers.

  • The replay starts at the graph's entry node. A capsule whose entry state starts elsewhere is NOT VERIFIED: the replay would skip part of the run.

  • The replay calls no LLM provider and needs no key — but it may reach the services your environment configures. With AILU_PII_REDACTOR_URL, AILU_SECRETS_REDACTOR_URL, AILU_LLMLINGUA_URL or AILU_RERANK_ENDPOINT set, a replay of a graph that uses that service sends it the capsule's content; the capsule does not pin the service, and it shapes what the replay reproduces. The verifier warns on stderr and adds replay may reach: <VARIABLE> to notes (printed by the CLI): a VERIFIED that carries such a note may depend on that service. Verify offline with env -i.

  • No replay while AILU_FS_BACKEND_URL is set. An fs-enabled agent's file tools are native — the journal does not serve them — so a replay would write the capsule's content to that backend. With it set (any value but the empty string, as the engine reads it — whitespace only counts as set) and a replay planned (the capsule carries its reproduction and starts at the graph's entry node), the verifier does not replay: it warns on stderr, notes refused: AILU_FS_BACKEND_URL is set — unset it (env -i) for an offline verification, and the capsule reads NOT VERIFIED (exit 1), its signature, key and chain still reported. With no replay planned the variable is ignored: the verdict is the one the capsule earns without it.

  • The decision's status is not compared. A replay cannot reproduce a human's choice, so the replay check ignores approved / rejected: a chain with a rejected link then an approved link for the same request verifies. Read the signed links themselves for who decided what.

  • A partial signature counts as a decision. Links carry no kind and no required signature count, so the verifier cannot tell a quorum's intermediate signature from a resolution, nor check that a quorum was reached. Several links of the same request (same run, request id, subject and call) count as one decision; a link that signs another subject or call under the same request id is a decision of its own and must be reproduced.

版本与发布记录

@ailu-ai/verify 共发布 18 个版本,首次发布于 2026/09/29;过去 12 个月发布了 18 个版本。

版本发布日期距今
2.8.5latest2026/11/062 天前
2.8.42026/11/053 天前
2.8.32026/11/053 天前
2.8.22026/10/309 天前
2.8.12026/10/299 天前
2.8.02026/10/2910 天前

关于 @ailu-ai/verify 的常见问题

@ailu-ai/verify 是什么?

Offline, independent verifier for an Ailu Certificate of Execution — re-checks the Ed25519 signature, walks the attestation chain, AND re-derives the run from the capsule alone. npx @ailu-ai/verify capsule.json.

如何安装 @ailu-ai/verify?

在项目目录运行 npm install @ailu-ai/verify,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 ailu-verify,可以用 npx ailu-verify 直接运行。

@ailu-ai/verify 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/ailu-ai__verify 是否存在。

@ailu-ai/verify 支持 ESM 还是 CommonJS?

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

@ailu-ai/verify 可以商用吗?

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

@ailu-ai/verify 的下载量有多少?

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

@ailu-ai/verify 还在维护吗?

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