agent-passport-system 4.0.0 → 4.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,8 +1,12 @@
1
- # Agent Passport System
1
+ <p align="center">
2
+ <img src="docs/assets/banner-hero.png" alt="Agent Passport System banner. Governance infrastructure for the agent economy. Cryptographic identity, signed action receipts, beneficiary attribution." width="100%">
3
+ </p>
4
+
5
+ APS lets a person or company give an AI agent limited authority to act on its behalf, and produces verifiable proof of what the agent does with it. Open protocol, Apache 2.0.
2
6
 
3
7
  [![npm version](https://img.shields.io/npm/v/agent-passport-system)](https://www.npmjs.com/package/agent-passport-system)
4
8
  [![license](https://img.shields.io/npm/l/agent-passport-system)](https://github.com/aeoess/agent-passport-system/blob/main/LICENSE)
5
- [![tests](https://img.shields.io/badge/tests-4098%20passing-brightgreen)](https://github.com/aeoess/agent-passport-system)
9
+ [![tests](https://img.shields.io/badge/tests-4326%20passing-brightgreen)](https://github.com/aeoess/agent-passport-system)
6
10
  [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.18749779.svg)](https://doi.org/10.5281/zenodo.18749779)
7
11
  [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/13536/badge)](https://www.bestpractices.dev/projects/13536)
8
12
  [![OpenSSF Baseline](https://www.bestpractices.dev/projects/13536/baseline)](https://www.bestpractices.dev/projects/13536)
@@ -10,24 +14,24 @@
10
14
  [![coverage](https://img.shields.io/badge/coverage-97%25%20lines%20%7C%2089%25%20branches-brightgreen)](https://github.com/aeoess/agent-passport-system/blob/main/CONTRIBUTING.md#running-tests)
11
15
  [![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/aeoess/agent-passport-system/badge)](https://scorecard.dev/viewer/?uri=github.com/aeoess/agent-passport-system)
12
16
  [![APS conformance](https://img.shields.io/endpoint?url=https%3A%2F%2Fgateway.aeoess.com%2Fapi%2Fv1%2Fpublic%2Fconformance%2Fbadge)](https://github.com/aeoess/aps-conformance-suite)
17
+ [![OpenChain ISO/IEC 5230:2020 conformant (self-certified)](https://img.shields.io/badge/OpenChain-5230%20self--certified-2e7d32)](https://openchainproject.org/community-of-conformance)
18
+ [![OpenChain ISO/IEC 18974:2023 conformant (self-certified)](https://img.shields.io/badge/OpenChain-18974%20self--certified-2e7d32)](https://openchainproject.org/community-of-conformance)
13
19
 
14
- Verify any receipt or evidence bundle in the browser: https://agent-passport.org/verify.html (per-axis claim-state report; runs locally, nothing is uploaded).
15
-
16
- > **For AI agents:** visit [agent-passport.org/llms.txt](https://agent-passport.org/llms.txt) for machine-readable docs.
17
-
18
- > **Valid signature. Hijacked intent. Denied by APS.**
20
+ It answers four practical questions about any agent action:
19
21
 
20
- **Enforcement and accountability layer for AI agents. Bring your own identity.**
22
+ - Who is this agent?
23
+ - Who authorized it?
24
+ - What is it allowed to do?
25
+ - What evidence exists after it acts, or after it is denied?
21
26
 
22
- Accepts did:key, did:web, SPIFFE SVIDs, OAuth tokens, and native did:aps. Authority can only decrease at each transfer point. The gateway is both judge and executor. Every action produces a signed receipt. Gateway evaluation under 2ms.
23
-
24
- The narrowing invariant:
27
+ Authority can pass from one agent to the next, but it can only get narrower. Scope, spending limits, expiration, and approved services are checked before an action runs, at a gateway that is both judge and executor: a request outside the granted authority is denied before it executes. Every decision, allowed or denied, produces a signed receipt, so anyone can later verify what was requested, what authority was presented, which policy applied, and what APS decided.
25
28
 
26
29
  ```mermaid
27
30
  flowchart LR
28
- P["Principal<br/>full authority"] -->|"scope: payments<br/>limit: $500, 30 days"| A["Agent A<br/>payments, $500"]
29
- A -->|"scope: refunds only<br/>limit: $100, 7 days"| B["Agent B<br/>refunds, $100"]
30
- B -.->|"$200 request:<br/>exceeds chain authority"| X["denied + signed receipt"]
31
+ P["Person or company"] -->|"payments up to $500"| A["Agent A"]
32
+ A -->|"refunds up to $100"| B["Agent B"]
33
+ B -->|"$200 refund request"| G{"APS gateway"}
34
+ G -->|"outside delegated authority"| X["denied + signed receipt"]
31
35
  ```
32
36
 
33
37
  ```bash
@@ -36,6 +40,8 @@ npm install agent-passport-system
36
40
 
37
41
  Also implemented in [Python](https://pypi.org/project/agent-passport-system/) and [Go](https://pkg.go.dev/github.com/aeoess/agent-passport-go), byte-parity-checked against this TypeScript reference.
38
42
 
43
+ Verify any receipt or evidence bundle in your browser at [agent-passport.org/verify.html](https://agent-passport.org/verify.html) (runs locally, nothing is uploaded). Machine-readable docs for agents are at [agent-passport.org/llms.txt](https://agent-passport.org/llms.txt).
44
+
39
45
  ## Quick Start
40
46
 
41
47
  Lead with the curated essentials. `agent-passport-system/core` exposes the 24 functions that 90% of integrations need: identity, delegation, enforcement, commerce, reputation, key management. The full `agent-passport-system` root import is unchanged and backward compatible: pull from it when Core does not cover your case.
@@ -45,11 +51,24 @@ import {
45
51
  createPassport, createDelegation,
46
52
  evaluateIntent, commercePreflight, generateKeyPair
47
53
  } from 'agent-passport-system/core'
48
-
49
- // Full 925-export API still available. Use when Core does not cover your case.
50
- // import { ... } from 'agent-passport-system'
51
54
  ```
52
55
 
56
+ ## Core Protocol
57
+
58
+ *Status: Canonical.*
59
+
60
+ What ships in every deployment.
61
+
62
+ **Identity** -- Ed25519 passports, passport grades 0-3, key rotation, did:aps identifiers. Bring your own identity too: APS accepts did:key, did:web, SPIFFE SVIDs, and OAuth tokens alongside native did:aps.
63
+
64
+ **Delegation** -- Scoped authority with monotonic narrowing. Sub-delegation can only reduce scope. Cascade revocation propagates through the full chain. `subDelegateAdvisor` implements the bounded-escalation delegation pattern used in multi-model agent workflows where a lower-cost executor escalates to a higher-capability advisor at decision points -- the advisor delegation is count-bounded, cannot execute tools, and cascade-revokes with its parent.
65
+
66
+ **Enforcement** -- 3-signature action chain: agent signs intent, policy engine signs evaluation, agent signs execution receipt. The agent cannot skip the check. Gateway evaluation runs under 2ms.
67
+
68
+ **Commerce** -- 5-gate preflight: valid passport, scope check, spend limit, merchant allowlist, idempotency. Human approval thresholds for high-value transactions.
69
+
70
+ **Reputation** -- Bayesian trust scoring across 5 tiers. Authority is earned per-scope, not global. Passport grades compound with behavioral history.
71
+
53
72
  ## Status labels
54
73
 
55
74
  Every primitive in this README carries one of three labels so you know how much weight it can bear today.
@@ -68,22 +87,6 @@ flowchart LR
68
87
  GW --> RC[("Signed receipt<br/>every outcome, both verdicts")]
69
88
  ```
70
89
 
71
- ## Core Protocol
72
-
73
- *Status: Canonical.*
74
-
75
- What ships in every deployment.
76
-
77
- **Identity** -- Ed25519 passports, passport grades 0-3, key rotation, did:aps identifiers.
78
-
79
- **Delegation** -- Scoped authority with monotonic narrowing. Sub-delegation can only reduce scope. Cascade revocation propagates through the full chain. `subDelegateAdvisor` implements the bounded-escalation delegation pattern used in multi-model agent workflows where a lower-cost executor escalates to a higher-capability advisor at decision points -- the advisor delegation is count-bounded, cannot execute tools, and cascade-revokes with its parent.
80
-
81
- **Enforcement** -- 3-signature action chain: agent signs intent, policy engine signs evaluation, agent signs execution receipt. The agent cannot skip the check.
82
-
83
- **Commerce** -- 5-gate preflight: valid passport, scope check, spend limit, merchant allowlist, idempotency. Human approval thresholds for high-value transactions.
84
-
85
- **Reputation** -- Bayesian trust scoring across 5 tiers. Authority is earned per-scope, not global. Passport grades compound with behavioral history.
86
-
87
90
  ## Receipt graph
88
91
 
89
92
  APS receipts are graph-composable. Each claim links to the authority, policy, action, observation, or evidence it depends on, so a verifier can walk from any receipt back to its supporting facts and stop at the boundary it cares about. This is documentation of existing structure, not a new primitive. The linkage already lives in the existing receipt envelopes (`delegation_chain_root`, `policy_ref`, `action_ref`, `evidence_id`, `bound_to`); the graph view is just how those edges compose.
@@ -246,7 +249,7 @@ The composition contract specifies how a verifier MUST cross-check per-request s
246
249
 
247
250
  ## Numbers
248
251
 
249
- 4,098 tests. 8 protocol layers. Framework adapters for CrewAI, LangChain, ADK, A2A, MCP, OpenShell, IBAC, Gonka. Gateway evaluation under 2ms. Zero heavy dependencies. Apache-2.0.
252
+ 4,326 tests. 8 protocol layers. Framework adapters for CrewAI, LangChain, ADK, A2A, MCP, OpenShell, IBAC, Gonka. Gateway evaluation under 2ms. Zero heavy dependencies. Apache-2.0.
250
253
 
251
254
  The test count is one number derived from the suite, not three guesses. The badge above, this section, and the `package.json` description all carry the same `4,026`, which is the `tests` total reported by `npm test`. When the suite grows, re-run `npm test`, read the `tests` line, and update all three to match.
252
255
 
@@ -1,3 +1,14 @@
1
+ /** Raised when a value cannot be canonicalized under RFC 8785. Subclasses the
2
+ * built-in Error that canonicalizeJCS already throws, so any existing handler
3
+ * that catches Error (or `catch (e)`) still catches it and fails closed. */
4
+ export declare class JcsCanonicalizationError extends Error {
5
+ readonly code: string;
6
+ /** Stable machine-readable category, shared across the APS SDKs. */
7
+ readonly category = "invalid_unicode";
8
+ /** Specific failure within the category, e.g. 'lone_surrogate'. */
9
+ readonly reason: string;
10
+ constructor(code: string, message: string, reason?: string);
11
+ }
1
12
  /** RFC 8785 JSON Canonicalization Scheme.
2
13
  * Differences from legacy canonicalize():
3
14
  * - null values ARE preserved (not filtered)
@@ -1 +1 @@
1
- {"version":3,"file":"canonical-jcs.d.ts","sourceRoot":"","sources":["../../../src/core/canonical-jcs.ts"],"names":[],"mappings":"AAgBA;;;;;qEAKqE;AACrE,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAiCtD;AAED;kFACkF;AAClF,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,OAAO,EACZ,eAAe,EAAE,MAAM,GACtB,KAAK,GAAG,QAAQ,GAAG,WAAW,CAMhC;AAYD,mEAAmE;AACnE,MAAM,WAAW,0BAA0B;IACzC,EAAE,EAAE,MAAM,CAAA;IACV,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,EAAE,OAAO,CAAA;IACd,YAAY,EAAE,MAAM,CAAA;IACpB,eAAe,EAAE,MAAM,CAAA;IACvB,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;CACtB;AAOD;;;yDAGyD;AACzD,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAErE;AAED,4DAA4D;AAC5D,wBAAgB,cAAc,IAAI,0BAA0B,EAAE,CAoF7D"}
1
+ {"version":3,"file":"canonical-jcs.d.ts","sourceRoot":"","sources":["../../../src/core/canonical-jcs.ts"],"names":[],"mappings":"AAgBA;;6EAE6E;AAC7E,qBAAa,wBAAyB,SAAQ,KAAK;IACjD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,oEAAoE;IACpE,QAAQ,CAAC,QAAQ,qBAAoB;IACrC,mEAAmE;IACnE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,YAAY,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAmB,EAKnE;CACF;AAqBD;;;;;qEAKqE;AACrE,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAmCtD;AAED;kFACkF;AAClF,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,OAAO,EACZ,eAAe,EAAE,MAAM,GACtB,KAAK,GAAG,QAAQ,GAAG,WAAW,CAMhC;AAYD,mEAAmE;AACnE,MAAM,WAAW,0BAA0B;IACzC,EAAE,EAAE,MAAM,CAAA;IACV,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,EAAE,OAAO,CAAA;IACd,YAAY,EAAE,MAAM,CAAA;IACpB,eAAe,EAAE,MAAM,CAAA;IACvB,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;CACtB;AAOD;;;yDAGyD;AACzD,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAErE;AAED,4DAA4D;AAC5D,wBAAgB,cAAc,IAAI,0BAA0B,EAAE,CAoF7D"}
@@ -13,6 +13,43 @@
13
13
  // Migration: new signatures should use JCS. Old signatures keep
14
14
  // working with the legacy function. Verification tries both.
15
15
  // ══════════════════════════════════════════════════════════════════
16
+ /** Raised when a value cannot be canonicalized under RFC 8785. Subclasses the
17
+ * built-in Error that canonicalizeJCS already throws, so any existing handler
18
+ * that catches Error (or `catch (e)`) still catches it and fails closed. */
19
+ export class JcsCanonicalizationError extends Error {
20
+ code;
21
+ /** Stable machine-readable category, shared across the APS SDKs. */
22
+ category = 'invalid_unicode';
23
+ /** Specific failure within the category, e.g. 'lone_surrogate'. */
24
+ reason;
25
+ constructor(code, message, reason = 'lone_surrogate') {
26
+ super(message);
27
+ this.name = 'JcsCanonicalizationError';
28
+ this.code = code;
29
+ this.reason = reason;
30
+ }
31
+ }
32
+ /** Reject a string containing an unpaired UTF-16 surrogate: a high surrogate
33
+ * (U+D800..U+DBFF) not immediately followed by a low surrogate (U+DC00..U+DFFF),
34
+ * or a low surrogate not immediately preceded by a high one. A lone surrogate is
35
+ * not a valid Unicode scalar and has no UTF-8 encoding, so RFC 8785 requires
36
+ * rejecting the input rather than escaping it. A valid surrogate PAIR passes. */
37
+ function assertNoLoneSurrogate(s) {
38
+ for (let i = 0; i < s.length; i++) {
39
+ const c = s.charCodeAt(i);
40
+ if (c >= 0xd800 && c <= 0xdbff) {
41
+ const next = i + 1 < s.length ? s.charCodeAt(i + 1) : 0;
42
+ if (next >= 0xdc00 && next <= 0xdfff) {
43
+ i++;
44
+ continue;
45
+ } // valid pair
46
+ throw new JcsCanonicalizationError('ERR_JCS_LONE_SURROGATE', 'canonicalizeJCS: string contains an unpaired UTF-16 high surrogate; a lone surrogate has no valid UTF-8 encoding and RFC 8785 requires rejection');
47
+ }
48
+ if (c >= 0xdc00 && c <= 0xdfff) {
49
+ throw new JcsCanonicalizationError('ERR_JCS_LONE_SURROGATE', 'canonicalizeJCS: string contains an unpaired UTF-16 low surrogate; a lone surrogate has no valid UTF-8 encoding and RFC 8785 requires rejection');
50
+ }
51
+ }
52
+ }
16
53
  /** RFC 8785 JSON Canonicalization Scheme.
17
54
  * Differences from legacy canonicalize():
18
55
  * - null values ARE preserved (not filtered)
@@ -32,6 +69,7 @@ export function canonicalizeJCS(value) {
32
69
  return JSON.stringify(value);
33
70
  }
34
71
  case 'string':
72
+ assertNoLoneSurrogate(value);
35
73
  return JSON.stringify(value);
36
74
  case 'object': {
37
75
  if (value instanceof Date)
@@ -44,6 +82,7 @@ export function canonicalizeJCS(value) {
44
82
  const keys = Object.keys(obj).sort();
45
83
  const pairs = [];
46
84
  for (const key of keys) {
85
+ assertNoLoneSurrogate(key);
47
86
  const v = obj[key];
48
87
  // RFC 8785: undefined becomes null, null is preserved
49
88
  // Only skip if the key was never set (shouldn't happen with Object.keys)
@@ -1 +1 @@
1
- {"version":3,"file":"canonical-jcs.js","sourceRoot":"","sources":["../../../src/core/canonical-jcs.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,sCAAsC;AACtC,qEAAqE;AACrE,kEAAkE;AAClE,qEAAqE;AACrE,qEAAqE;AACrE,wEAAwE;AACxE,EAAE;AACF,wBAAwB;AACxB,mDAAmD;AACnD,uDAAuD;AACvD,EAAE;AACF,gEAAgE;AAChE,6DAA6D;AAC7D,qEAAqE;AAErE;;;;;qEAKqE;AACrE,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,MAAM,CAAA;IAExD,QAAQ,OAAO,KAAK,EAAE,CAAC;QACrB,KAAK,SAAS;YACZ,OAAO,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAA;QACjC,KAAK,QAAQ,EAAE,CAAC;YACd,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;gBAAE,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAA;YAC7E,sEAAsE;YACtE,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;QAC9B,CAAC;QACD,KAAK,QAAQ;YACX,OAAO,IAAI,CAAC,SAAS,C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