@agenticprimitives/admission

中文文档
0.0.0-alpha.21发布于 2026/10/26MITTypeScriptES Module零依赖近 30 天下载 3407

Agentic Primitives Edge admission contracts: transport evidence, application authentication, canonical actor resolution, admission grants, and exact MCP invocation authorization. Zero runtime dependencies; admission is never authority.

原始使用文档
文档目录6 节
  1. What it is
  2. Why the invariants are code
  3. Zero runtime dependencies
  4. Install
  5. Credential presentations and HTTP signatures
  6. Reference

@agenticprimitives/admission

Part of Agentic Primitives — the open-source trust substrate for agentic applications: identity that can sign, authority checked at act time, evidence the owner carries. Developer kit · All packages

Admission contracts for the Agentic Primitives Edge — the boundary between external agent intentions and internal agent capabilities.

Architect-of-record: spec 339 · ADR-0057

HTTPS is required.
mTLS is optional.
Application-level identity resolution and Admission are always required.

What it is

Four questions that must stay separate, in four shapes that cannot substitute for one another:

QuestionShape
What did the transport prove?OptionalTransportEvidence — never sufficient alone
What authenticated the caller?OAuthEvidence / RequestProofEvidence
Who is the caller, canonically?CanonicalActorContext — resolved, never claimed
What may they do?AdmissionRequest → AdmissionDecision → AdmissionGrant

Plus ExactMcpInvocationRequest for the private gateway, where a grant is re-checked against exact arguments and live delegation.

Why the invariants are code

The architecture's claims are all "X is not Y" — a certificate is not an owner, a SPIFFE ID is not an agent, a grant is not a tool permission. Those survive review and then die in implementation, because the mistake never looks like one:

if (req.transport.mtls) { /* trusted peer */ }   // a real handshake; a wrong conclusion

A type cannot catch that — mtls: true is a perfectly good boolean. So:

import { checkAdmissionInvariants } from '@agenticprimitives/admission';

const violations = checkAdmissionInvariants(request);
// mTLS-only, no token → OAUTH_TOKEN_REQUIRED
//   "a TLS connection, mutual or not, authenticates no principal"

[] means the request is coherent enough to evaluate. It does not mean admit — relationship, delegation, capability, entitlement and policy are all still ahead of it, and none of them live here.

Zero runtime dependencies

No viem, no provider SDK, no SPIFFE, no transport. Anything needing I/O is a port, not an import. Enforced by pnpm check:optional-package-boundaries.

Install

pnpm add @agenticprimitives/admission

MIT.

Credential presentations and HTTP signatures

credentialPresentationEvaluator (CREDENTIAL_PRESENTATION_CONTRIBUTOR) admits a zero-knowledge credential presentation as evidence at the door: the verdict names the issuer facet, the predicate digest, the nullifier grade and the status sequence, and grants nothing. verifyHttpSignature (HTTP_SIGNATURE_CONTRIBUTOR, RFC 9421) records an HTTP message signature as transport evidence — never authentication, never authority.

Reference

Agent ids are ERC-4337 accounts, not names. principalAgentId, actingAgentId and targetAgentId are CAIP-10 ids that resolve to a 20-byte address (ADR-0010). Spec 339 as authored used urn:ap:agent:…; that is refused here, because a URN is a name a namespace operator can reassign. runtimeId is exempt: a deployment is not an account. agentAddressOf parses; it never resolves a name.

Not edge-runtime. edge-runtime asks the ingress question (route, headers, body size, abuse limit) and is Cloudflare-shaped; its type is EdgeIngressRequest. This package asks the semantic one, and the canonical AdmissionRequest lives here. One word for both is how a route check ends up standing in for an authority decision.

mTLS is optional, with three meanings kept apart. createTransportAssuranceEvaluator is the only place transport can affect a decision: no certificate is normal (no rule means ALLOW); minimumAssurance denies below the bar (MTLS_REQUIRED_FOR_PROFILE — requiring mTLS is policy, never transport deciding for itself); preferredAssurance with constraintsBelowPreferred narrows instead. A certificate can only raise the bar; a test asserts it cannot turn another evaluator's DENY into an ADMIT. Evidence comes from edge-cloudflare.transportEvidenceFromRequest; the level is measured with observedTransportAssurance, never the self-reported label.

Layout. src/types.ts holds the contracts, each commented with the collapse its shape prevents. src/ports.ts holds the injected interfaces and the only two extension points, both pointing inward. src/invariants.ts holds the non-equivalences as code, because types cannot catch if (mtls) { trusted }.

Claims this package makes checkable. Transport evidence is never application authentication (hasApplicationAuthentication). Assurance is what was validated, not what was claimed. A workload identifier is not an agent; a binding must exist and be active. A grant is a door, not a key (checkInvocationAgainstGrant refuses an invocation with no delegation). An empty capability ceiling admits nothing. An RFC 9421 HTTP signature is transport evidence only (verifyHttpSignature → optionalTransportEvidence.httpSignature, spec 442 §6): the key is a resolver port, the invariant set is identical with and without it, and tag: payment grants nothing.

版本与发布记录

@agenticprimitives/admission 共发布 21 个版本,首次发布于 2026/08/03;过去 12 个月发布了 21 个版本。

版本发布日期距今
0.0.0-alpha.21latest2026/10/2612 天前
0.0.0-alpha.202026/10/1722 天前
0.0.0-alpha.192026/10/1622 天前
0.0.0-alpha.182026/10/1622 天前
0.0.0-alpha.172026/10/1622 天前
0.0.0-alpha.162026/10/1622 天前

关于 @agenticprimitives/admission 的常见问题

@agenticprimitives/admission 是什么?

Agentic Primitives Edge admission contracts: transport evidence, application authentication, canonical actor resolution, admission grants, and exact MCP invocation authorization. Zero runtime dependencies; admission is never authority.

如何安装 @agenticprimitives/admission?

在项目目录运行 npm install @agenticprimitives/admission,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@agenticprimitives/types(^1.0.0-alpha.45)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@agenticprimitives/admission 支持 TypeScript 吗?

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

@agenticprimitives/admission 支持 ESM 还是 CommonJS?

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

@agenticprimitives/admission 可以商用吗?

@agenticprimitives/admission 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@agenticprimitives/admission 的下载量有多少?

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

@agenticprimitives/admission 还在维护吗?

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