@atlasauth/pca-agentcard 0.1.0 → 0.2.0
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/LICENSE +21 -0
- package/README.md +69 -0
- package/package.json +27 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Atlas Authorization
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# @atlasauth/pca-agentcard
|
|
2
|
+
|
|
3
|
+
Signed agent cards and AgentFacts for Proof-Carrying Authority (PCA). A self-declared agent card is easy to spoof; this package builds an A2A Agent Card that is signed (an `AgentCardSignature`, a detached JWS via `jose`) and points at the agent's PCA passport and a proof-verification endpoint. It also issues an AgentFacts document that keeps self-asserted claims separate from claims a named third-party attestor vouches for, with verification that is fail-closed on bad signatures, expired windows and subject mismatches. Card signatures are interoperable with `@atlasauth/pca-a2a`.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm i @atlasauth/pca-agentcard
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Depends on `@atlasauth/pca` and `jose` (installed transitively).
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { issuePassport } from '@atlasauth/pca';
|
|
17
|
+
import {
|
|
18
|
+
buildAgentCard, issueSignedAgentCard, verifyAgentCard,
|
|
19
|
+
issueAgentFacts, verifyAgentFacts,
|
|
20
|
+
agentCardHandler, agentFactsHandler, toRegistryEntry,
|
|
21
|
+
} from '@atlasauth/pca-agentcard';
|
|
22
|
+
|
|
23
|
+
const passport = issuePassport({
|
|
24
|
+
model_id: 'my-model', weights_digest: 'wd', system_prompt_digest: 'sp', tool_manifest_digest: 'tm',
|
|
25
|
+
operator: 'acme-corp', hardware_rooted: false, weights_measured: false, issued_at: Date.now(),
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
// Signed card (keys are jose KeyLike, Uint8Array or JWK; default alg EdDSA).
|
|
29
|
+
const card = await issueSignedAgentCard(
|
|
30
|
+
buildAgentCard(passport, {
|
|
31
|
+
name: 'Procurement Agent',
|
|
32
|
+
url: 'https://agents.example.com/procure',
|
|
33
|
+
pcaProofRef: { verificationEndpoint: 'https://rs.example.com/v1/pca/verify', aud: 'my-rs' },
|
|
34
|
+
}),
|
|
35
|
+
agentPrivateKey,
|
|
36
|
+
);
|
|
37
|
+
await verifyAgentCard(card, { key: agentPublicKey }); // { ok: true, passportRef, passport, pcaProof }
|
|
38
|
+
|
|
39
|
+
// AgentFacts: the attestor signs `attests`; `selfAsserted` stays unsigned.
|
|
40
|
+
const facts = await issueAgentFacts(passport, {
|
|
41
|
+
selfAsserted: { tagline: 'buys things' },
|
|
42
|
+
attests: { operator: 'acme-corp' },
|
|
43
|
+
attestorKey: attestorPrivateKey,
|
|
44
|
+
});
|
|
45
|
+
const result = await verifyAgentFacts(facts, { key: attestorPublicKey });
|
|
46
|
+
// result.ok === true; result.claims = { tagline: 'self-asserted', operator: 'attested' }
|
|
47
|
+
|
|
48
|
+
// Serve at /.well-known/agent-card.json and /.well-known/agent-facts.json (framework-agnostic).
|
|
49
|
+
const route = (path: string) => agentCardHandler(card)(path) ?? agentFactsHandler(facts)(path);
|
|
50
|
+
const entry = toRegistryEntry(card, facts); // for an A2A registry / index
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Verification accepts either a single `key` or a `jwks`. A card only proves who signed it: to trust the agent's authority, resolve the passport and have the agent present a PCActn to the `verificationEndpoint`.
|
|
54
|
+
|
|
55
|
+
## API
|
|
56
|
+
|
|
57
|
+
- Card: `buildAgentCard`, `issueSignedAgentCard`, `verifyAgentCard`, `WELL_KNOWN_AGENT_CARD_PATH`.
|
|
58
|
+
- AgentFacts: `issueAgentFacts`, `addAttestation`, `verifyAgentFacts`, `PCA_ATTESTOR_ID`, `AGENT_FACTS_CONTEXT`, `WELL_KNOWN_AGENT_FACTS_PATH`.
|
|
59
|
+
- Hosting and registry: `agentCardHandler`, `agentFactsHandler`, `toRegistryEntry`.
|
|
60
|
+
|
|
61
|
+
## Status
|
|
62
|
+
|
|
63
|
+
Experimental. The AgentFacts JSON-LD context is a placeholder for the canonical NANDA context, and the Agent Card model is structural rather than a full A2A implementation. `toRegistryEntry` does not re-verify; a registry should verify on ingest. The cryptography is unaudited.
|
|
64
|
+
|
|
65
|
+
Source and issues: https://github.com/Atlas-Authorization/pca
|
|
66
|
+
|
|
67
|
+
## License
|
|
68
|
+
|
|
69
|
+
MIT - see LICENSE
|
package/package.json
CHANGED
|
@@ -1,7 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlasauth/pca-agentcard",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Signed agent card + AgentFacts attestor for PCA: issue/host a /.well-known/agent-card.json (A2A AgentCardSignature) and an AgentFacts metadata doc where PCA is the THIRD-PARTY attestor (separating self-asserted from attested), pointing to live verifiable proof-of-authority.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"agent card",
|
|
7
|
+
"a2a",
|
|
8
|
+
"agentfacts",
|
|
9
|
+
"well-known",
|
|
10
|
+
"agent authorization",
|
|
11
|
+
"proof-carrying authority",
|
|
12
|
+
"pca",
|
|
13
|
+
"ai agents"
|
|
14
|
+
],
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"homepage": "https://github.com/Atlas-Authorization/pca#readme",
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": "https://github.com/Atlas-Authorization/pca/issues"
|
|
19
|
+
},
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/Atlas-Authorization/pca.git",
|
|
23
|
+
"directory": "packages/pca-agentcard"
|
|
24
|
+
},
|
|
5
25
|
"main": "./dist/index.js",
|
|
6
26
|
"types": "./dist/index.d.ts",
|
|
7
27
|
"exports": {
|
|
@@ -13,7 +33,7 @@
|
|
|
13
33
|
},
|
|
14
34
|
"dependencies": {
|
|
15
35
|
"jose": "^5.9.6",
|
|
16
|
-
"@atlasauth/pca": "0.
|
|
36
|
+
"@atlasauth/pca": "0.2.0"
|
|
17
37
|
},
|
|
18
38
|
"devDependencies": {
|
|
19
39
|
"typescript": "^5.6.3",
|
|
@@ -21,8 +41,12 @@
|
|
|
21
41
|
},
|
|
22
42
|
"files": [
|
|
23
43
|
"dist",
|
|
24
|
-
"README.md"
|
|
44
|
+
"README.md",
|
|
45
|
+
"LICENSE"
|
|
25
46
|
],
|
|
47
|
+
"engines": {
|
|
48
|
+
"node": ">=20"
|
|
49
|
+
},
|
|
26
50
|
"publishConfig": {
|
|
27
51
|
"access": "public"
|
|
28
52
|
},
|