agent-safe-pipeline README

The project's README from github.com/decionis/agent-safe-pipeline. As one markdown file: README.md.

Agent-Safe Pipeline

Continuous integration CodeQL Secret scanning OpenSSF Scorecard OpenSSF Best Practices License: Apache-2.0

Let agents propose. Let policy decide.

Agent-Safe Pipeline is the reference implementation of the Execution Authority architecture: AI-agent actions execute only through an independent authorization boundary, and every authorization decision leaves a verifiable evidence record.

This repository is a library and runnable reference implementation, not a hosted authorization service or a substitute for provider-side identity, least privilege, network isolation, and incident response. Its safety claims apply only when the documented trust boundary is preserved.

Agent -> immutable intent -> Decionis -> ALLOW / ESCALATE / BLOCK -> SafeExecutor -> API
                                      |
                                      +-> Presence -> verified human approval -> Decionis re-evaluation
                                      |
                                      +-> Decision Dossier -> compounding decision record

Agents can reason, plan, and propose actions. They must not determine whether their own actions are authorized, possess downstream privileged credentials, or choose which trusted handler runs.

Five-minute demo

Requirements: Node.js 22.14 or later and pnpm 9.

git clone https://github.com/decionis/agent-safe-pipeline.git
cd agent-safe-pipeline
pnpm install --frozen-lockfile
pnpm --filter @decionis/agent-safe-example-basic demo

The demos use an explicitly non-production fixture authority. A production integration uses DecionisGate and DecionisGrantVerifier with server-side credentials.

const captured = intentCapture.capture(agentProposal, trustedContext);
const decision = await gate.evaluate(captured);
const result = await executor.run(captured, decision);

The executor accepts a captured intent and a decision. It does not accept an arbitrary callback from the agent. A sealed ActionRegistry maps action names to trusted handlers and validates parameters before consuming a single-use grant.

Golden adversarial demo

One legitimate path and eight adversarial attempts against the same boundary, offline, in a few seconds, with every expectation asserted:

pnpm --filter @decionis/agent-safe-example-golden-adversarial demo

A treasury agent proposes a USD 250,000 wire, a remote Chief Risk Officer completes a FIDO2 plus liveness ceremony, and exactly one wire executes. Injected authorization fields, a fabricated ALLOW, an asserted approval, a swapped receipt, a post-approval amount change, a replayed grant, 25 concurrent claims, a shadow observation, and an expired grant all fail to execute. The run exits 0 only when that holds. See examples/golden-adversarial-demo, the bank-audience walkthrough in docs/remote-cro-authorization.md, and the receipt semantics in docs/presence-evidence.md.

From the fixture to Decionis

The package is used in three stages. Each stage uses the same IntentCapture, ActionRegistry, and handler code, so nothing is rewritten between them.

Stage Authority What it proves
Development createFixtureAuthorityPair (refuses NODE_ENV=production) The intent, registry, and executor wiring is correct
Shadow ShadowPipeline over DecionisGate with mode: "SHADOW" What Decionis would have decided about actions that already run; no grant is ever issued
Enforcement DecionisGate plus DecionisGrantVerifier in SafeExecutor Nothing runs without an independent decision and a consumed single-use grant

Decionis credentials belong only in the trusted executor process, never in the agent runtime:

DECIONIS_API_URL=https://api.decionis.com
DECIONIS_API_KEY=server-side-secret

See the package README for the complete enforcement example and docs/shadow-mode.md for the shadow rollout path.

Repository map

Production invariants

  1. Agent input contains only the proposed action, target, and parameters. Tenant, actor, downstream target, and credentials come from trusted runtime configuration.
  2. The exact canonical intent is hashed and expires quickly.
  3. Decionis independently decides. Network errors, malformed responses, missing grants, or binding mismatches fail closed.
  4. Presence proves a human approved that exact intent; Presence never directly authorizes execution. Decionis verifies the receipt and re-evaluates policy.
  5. The grant is bound to the intent, decision, audience, and expiry and is claimed atomically before the handler runs; the attempt outcome is finalized with the authority afterwards as evidence, never as authority.
  6. Downstream credentials exist only behind the trusted executor.
  7. Every decision is evidence-bearing. An ALLOW whose response lacks a dossier identifier or grant is refused as non-executable, and an executed result retains its consumed {decisionId, dossierId, grantId} binding. A dossier identifier is never an execution credential.

Presence supports two explicit integration levels. In DIRECT mode, the trusted executor coordinates Presence and returns the receipt reference to Decionis. In MANAGED mode, the executor asks Decionis to orchestrate Presence and polls Decionis for a terminal status. Both modes require independently signed Presence evidence, exact-intent verification, current-policy re-evaluation, and the same claim-before-handler grant path. Invitation delivery and Presence evidence are never execution authority, and approval cannot revive a five-minute intent after it expires.

See docs/trust-boundary.md before integrating a real downstream API.

Decision record

The Execution Authority architecture has two load-bearing properties. Position on the execution path creates control: nothing runs without an independent decision at the moment of action. The evidence record creates accountability that compounds: every decision adds to an auditable history of what was authorized, under which policy, on whose approval.

Every Decionis evaluation is recorded as a Decision Dossier, and each GateDecision returns the decisionId and dossierId of that record. Escalations attach the verified Presence receiptDossierId, and every executed action returns the consumed grant's {decisionId, dossierId, grantId, intentHash} binding, so execution results correlate to their evidence without extra bookkeeping. In the research vocabulary, dossiers compound into a Decision Chain: tamper-evident lineage linking evaluation, approval, and execution evidence across workflows. Decionis maintains that record; this repository's contribution is that execution cannot bypass it.

Treat dossier identifiers as audit and support references, never as execution credentials — see docs/decision-dossiers.md.

Research and specifications

Decionis Research defines the Execution Authority architecture, this repository demonstrates it as runnable, tested code, and the Decionis platform operates it as a hosted authority. The provenance chain is research paper -> protocol contract -> reference implementation (this repository) -> production service.

Published research:

Companion notes on the Execution Authority model, the authorization protocol, Presence-verified human approval, and Decision Dossiers are in preparation. Following this repository's discovery rules, a publication link is added here only after its canonical article resolves publicly.

Research concept Implementation in this repository
Execution Authority boundary IntentCapture -> DecionisGate -> SafeExecutor
Protocol contract Exactly the Decionis ExecutionAuthorityRequest and ExecutionIntentBinding contract on the wire; DecionisGate and DecionisGrantVerifier claim and finalize against the published OpenAPI
Intent integrity CanonicalIntentHasher plus the conformance/ hash vectors
Human approval evidence DIRECT PresenceApprovalCoordinator or MANAGED DecionisGate polling; both require Presence receipt verification and Decionis re-evaluation
Trusted execution Sealed ActionRegistry and atomic single-use grant consumption in SafeExecutor
Decision evidence decisionId and dossierId on every gate decision; executed results retain the consumed-grant binding
Failure semantics Fail-closed production invariants and THREAT-MODEL.md
Observation without authority ShadowPipeline over a SHADOW-mode gate: failure-isolated, bounded, grant-free, and rejected by SafeExecutor; see docs/shadow-mode.md
MCP governance examples/mcp-tool-gate
Operational patterns examples/shopify-refund-agent, examples/github-deploy-agent, examples/procurement-agent

Open core

Everything in this repository is Apache-2.0: the architecture, the intent contract, the execution boundary, the client adapters, the audit contract, shadow mode, the conformance vectors, and the examples. Decionis operates the policy control plane behind DecionisGate: policy evaluation, grant issuance and atomic consumption, Decision Dossier signing and retention, and Presence. The seam is two exported interfaces, DecisionAuthority and AuthorizationVerifier, plus a published OpenAPI contract; the library checks no plan, key, or entitlement. OPEN-CORE.md states the boundary and the commitments that keep it stable.

Public-repository policy

This is intended to be the public, canonical reference implementation. It should not be mirrored: mirrors create contract and security-fix drift. Public content belongs here—architecture, package source, synthetic policies, and runnable examples. Production policy bundles, customer data, credentials, internal infrastructure, and private incident material do not.

Decionis remains the authoritative decision service, Presence remains the human-verification service, and their server internals can evolve independently behind versioned contracts.

Verify Decision Dossiers

The repository-owned dossiers/ corpus checks the offline verifier against synthetic ALLOW, BLOCK, and ESCALATE proof bundles, including an owned-workspace, execution-bound vector. Its private signing key is intentionally public so anyone can regenerate the corpus; it is not a production credential and cannot establish that a production dossier is authentic.

pnpm exec decionis-verify \
  --file dossiers/vectors/allow.json \
  --jwks dossiers/corpus-jwks.json

To verify the distinct production claim, obtain a live dossier through an authorized route and run the pinned verifier against the live JWKS without committing the dossier:

npx -y @decionis/[email protected] \
  --file /absolute/path/to/live-decision-dossier.json \
  --jwks https://api.decionis.com/v1/.well-known/decision-dossier-jwks.json

See the corpus README for regeneration, provenance, expected failures, and the trust boundary between synthetic conformance and production verification.

Status

The package is published as @decionis/agent-safe-pipeline. Install the latest stable release with npm install @decionis/agent-safe-pipeline; prereleases require an explicit version such as npm install @decionis/[email protected].

Archived releases are citable under Zenodo concept DOI 10.5281/zenodo.22312955. The release-metadata contract explains the preflight checks, version-DOI verification, and human publication boundary.

Development

pnpm install --frozen-lockfile
pnpm verify

pnpm verify enforces formatting, Markdown lint, fixture conventions, canonical licensing, separate production/toolchain audits, deterministic performance tests, types, tests, and coverage thresholds of 90% for lines/functions/statements and 85% for branches. pnpm mutation checks that trust-boundary tests kill deliberate code mutations. pnpm fuzz runs deterministic property tests against canonical intent handling; CI also runs them weekly with a larger bounded sample. Installation activates the repository's simple-git-hooks pre-commit guardrails.

Testing escalations locally

@decionis/agent-safe-pipeline/testing ships LocalPresence and LocalAuthority, loopback doubles that the production clients talk to unchanged. They enforce the structural intent-hash binding, verify receipts the way Decionis does, issue single-use grants, orchestrate managed escalations, and record finalization. The person's ceremony is a method call or a local control route. See docs/local-testing.md and examples/local-escalation.

Fixture provenance and loopback origins

Every fixture-bearing file is listed in fixtures/manifest.json and checked by pnpm fixture:check: the unit tests under packages/pipeline/test, example sources, conformance vectors, the dossier corpus, synthetic polici

agent-safe-pipeline (decionis/agent-safe-pipeline)

Searching Database…

这是什么?Agent-Safe Pipeline 是“执行权威”架构的参考实现,该架构位于 AI 智能体或 API 与会产生实际后果的 HTTP 操作之间:它拦截操作,向 Decionis 询问是否获得授权,只有签发一次性授权凭证时才转发,否则交由人工处理或直接拒绝,每个决定都会留下防篡改的证据。
这是托管服务,还是我自己运行的东西?它是一个开源的 TypeScript 库和可运行的参考实现,本身并不是托管授权服务——实际的策略决策由 Decionis 做出,它是本库所对接的一个独立控制平面。
怎么试用它?安装 Node.js 22.14+ 和 pnpm 9,然后运行五分钟演示或 golden-adversarial-demo 示例,后者使用非生产环境的固定测试权威,而不是真实的 Decionis 账户。
使用它需要 Decionis 账户吗?本地演示和开发只需要 Node.js、pnpm 和一个固定测试权威;真实部署则需要把 DecionisGate 和 DecionisGrantVerifier 通过服务器端凭据接入 Decionis。
如果 Decionis 无法访问或返回异常内容会怎样?系统采取“失败即关闭”策略——网络错误、格式异常的响应、缺失的授权凭证或绑定不匹配,都会导致操作被拒绝,而不是被放行。
这里的所有东西都开源吗,还是有一部分锁在 Decionis 后面?本库、协议契约、执行边界、客户端适配器、审计契约、影子模式和示例全部采用 Apache-2.0;只有托管的策略控制平面(策略评估、授权签发、档案签名、Presence)由 Decionis 单独运营。
黄金对抗演示是什么?它是一个自带校验的测试:一笔 25 万美元、带人工 FIDO2 批准的合法电汇能够成功执行,而八种模拟攻击——伪造批准、重放授权凭证、调换回执、并发申领等——在同一执行边界上全部无法执行。
Presence 是什么?Presence 是一种人工批准机制,用于证明某个具体的人批准了确切的意图(例如通过 FIDO2 加活体检测),但它从不直接授权执行——Decionis 在签发授权凭证之前仍会核验回执并重新评估策略。
commerce-mcp 包是做什么的?它是一个 MCP 服务器(@decionis/commerce),让 AI 智能体在行动前依据商家政策核对改价、退款、订单或促销等操作,之后还能读取签名的决策记录。
为什么 AI 智能体不能自行决定自己的操作已获授权?设计上,智能体可以推理并提出操作,但绝不能由自己掌握授权决定、下游凭据或处理器的选择——这种分离正是该项目的核心安全主张。
What are similar projects?prowler, caprover, docker, apisix, ZizkaDB, kestra, opa, open-connector
Creator
decionis
Size
13 MB
Stars
688
Age
2mo
Commits · 90 Days