@attested-intelligence/aga-mcp-server 2.0.1 → 2.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.
Files changed (241) hide show
  1. package/README.md +197 -124
  2. package/SECURITY.md +59 -0
  3. package/dist/adapters/openclaw.d.ts +43 -0
  4. package/dist/adapters/openclaw.d.ts.map +1 -0
  5. package/dist/adapters/openclaw.js +86 -0
  6. package/dist/adapters/openclaw.js.map +1 -0
  7. package/dist/core/bundle.d.ts +9 -2
  8. package/dist/core/bundle.d.ts.map +1 -1
  9. package/dist/core/bundle.js +16 -2
  10. package/dist/core/bundle.js.map +1 -1
  11. package/dist/core/identity.d.ts +19 -10
  12. package/dist/core/identity.d.ts.map +1 -1
  13. package/dist/core/identity.js +45 -11
  14. package/dist/core/identity.js.map +1 -1
  15. package/dist/core/portal.d.ts +10 -1
  16. package/dist/core/portal.d.ts.map +1 -1
  17. package/dist/core/portal.js +16 -12
  18. package/dist/core/portal.js.map +1 -1
  19. package/dist/core/types.d.ts +29 -2
  20. package/dist/core/types.d.ts.map +1 -1
  21. package/dist/crypto/index.d.ts +5 -6
  22. package/dist/crypto/index.d.ts.map +1 -1
  23. package/dist/crypto/index.js +5 -6
  24. package/dist/crypto/index.js.map +1 -1
  25. package/dist/crypto/sign.d.ts +2 -0
  26. package/dist/crypto/sign.d.ts.map +1 -1
  27. package/dist/crypto/sign.js +6 -0
  28. package/dist/crypto/sign.js.map +1 -1
  29. package/dist/index.js +1 -1
  30. package/dist/index.js.map +1 -1
  31. package/dist/middleware/governance.d.ts +7 -1
  32. package/dist/middleware/governance.d.ts.map +1 -1
  33. package/dist/middleware/governance.js +18 -11
  34. package/dist/middleware/governance.js.map +1 -1
  35. package/dist/proxy/evaluator.d.ts +14 -0
  36. package/dist/proxy/evaluator.d.ts.map +1 -0
  37. package/dist/proxy/evaluator.js +141 -0
  38. package/dist/proxy/evaluator.js.map +1 -0
  39. package/dist/proxy/index.d.ts +22 -0
  40. package/dist/proxy/index.d.ts.map +1 -0
  41. package/dist/proxy/index.js +230 -0
  42. package/dist/proxy/index.js.map +1 -0
  43. package/dist/proxy/profiles.d.ts +16 -0
  44. package/dist/proxy/profiles.d.ts.map +1 -0
  45. package/dist/proxy/profiles.js +43 -0
  46. package/dist/proxy/profiles.js.map +1 -0
  47. package/dist/proxy/server.d.ts +106 -0
  48. package/dist/proxy/server.d.ts.map +1 -0
  49. package/dist/proxy/server.js +389 -0
  50. package/dist/proxy/server.js.map +1 -0
  51. package/dist/proxy/stdio-bridge.d.ts +42 -0
  52. package/dist/proxy/stdio-bridge.d.ts.map +1 -0
  53. package/dist/proxy/stdio-bridge.js +142 -0
  54. package/dist/proxy/stdio-bridge.js.map +1 -0
  55. package/dist/proxy/types.d.ts +36 -0
  56. package/dist/proxy/types.d.ts.map +1 -0
  57. package/dist/proxy/types.js +11 -0
  58. package/dist/proxy/types.js.map +1 -0
  59. package/dist/proxy/verify.d.ts +29 -0
  60. package/dist/proxy/verify.d.ts.map +1 -0
  61. package/dist/proxy/verify.js +183 -0
  62. package/dist/proxy/verify.js.map +1 -0
  63. package/dist/server.d.ts +7 -3
  64. package/dist/server.d.ts.map +1 -1
  65. package/dist/server.js +342 -214
  66. package/dist/server.js.map +1 -1
  67. package/dist/storage/sqlite.js +6 -6
  68. package/independent-verifier/README.md +31 -0
  69. package/independent-verifier/package.json +18 -0
  70. package/independent-verifier/verify.ts +211 -0
  71. package/package.json +97 -71
  72. package/src/adapters/openclaw.ts +125 -0
  73. package/src/core/artifact.ts +45 -0
  74. package/src/core/attestation.ts +33 -0
  75. package/src/core/behavioral.ts +132 -0
  76. package/src/core/bundle.ts +45 -0
  77. package/src/core/chain.ts +72 -0
  78. package/src/core/checkpoint.ts +22 -0
  79. package/src/core/delegation.ts +146 -0
  80. package/src/core/disclosure.ts +32 -0
  81. package/src/core/identity.ts +62 -0
  82. package/src/core/index.ts +14 -0
  83. package/src/core/portal.ts +117 -0
  84. package/src/core/quarantine.ts +16 -0
  85. package/src/core/receipt.ts +33 -0
  86. package/src/core/subject.ts +11 -0
  87. package/src/core/types.ts +285 -0
  88. package/src/crypto/hash.ts +33 -0
  89. package/src/crypto/index.ts +5 -0
  90. package/src/crypto/merkle.ts +43 -0
  91. package/src/crypto/salt.ts +18 -0
  92. package/src/crypto/sign.ts +42 -0
  93. package/src/crypto/types.ts +19 -0
  94. package/src/index.ts +12 -0
  95. package/src/middleware/governance.ts +95 -0
  96. package/src/middleware/index.ts +1 -0
  97. package/src/proxy/evaluator.ts +176 -0
  98. package/src/proxy/index.ts +259 -0
  99. package/src/proxy/profiles.ts +48 -0
  100. package/src/proxy/server.ts +499 -0
  101. package/src/proxy/stdio-bridge.ts +171 -0
  102. package/src/proxy/types.ts +40 -0
  103. package/src/proxy/verify.ts +202 -0
  104. package/src/server.ts +435 -0
  105. package/src/storage/index.ts +3 -0
  106. package/src/storage/interface.ts +21 -0
  107. package/src/storage/memory.ts +27 -0
  108. package/src/storage/sqlite.ts +45 -0
  109. package/src/tools/README.md +13 -0
  110. package/src/utils/canonical.ts +14 -0
  111. package/src/utils/constants.ts +3 -0
  112. package/src/utils/timestamp.ts +12 -0
  113. package/src/utils/uuid.ts +2 -0
  114. package/dist/context.d.ts +0 -39
  115. package/dist/context.d.ts.map +0 -1
  116. package/dist/context.js +0 -113
  117. package/dist/context.js.map +0 -1
  118. package/dist/core/measurement.d.ts +0 -16
  119. package/dist/core/measurement.d.ts.map +0 -1
  120. package/dist/core/measurement.js +0 -18
  121. package/dist/core/measurement.js.map +0 -1
  122. package/dist/crypto/canonicalize.d.ts +0 -7
  123. package/dist/crypto/canonicalize.d.ts.map +0 -1
  124. package/dist/crypto/canonicalize.js +0 -21
  125. package/dist/crypto/canonicalize.js.map +0 -1
  126. package/dist/crypto/keys.d.ts +0 -10
  127. package/dist/crypto/keys.d.ts.map +0 -1
  128. package/dist/crypto/keys.js +0 -19
  129. package/dist/crypto/keys.js.map +0 -1
  130. package/dist/prompts/drift-analysis.d.ts +0 -13
  131. package/dist/prompts/drift-analysis.d.ts.map +0 -1
  132. package/dist/prompts/drift-analysis.js +0 -43
  133. package/dist/prompts/drift-analysis.js.map +0 -1
  134. package/dist/prompts/governance-report.d.ts +0 -7
  135. package/dist/prompts/governance-report.d.ts.map +0 -1
  136. package/dist/prompts/governance-report.js +0 -26
  137. package/dist/prompts/governance-report.js.map +0 -1
  138. package/dist/prompts/nccoe-demo.d.ts +0 -14
  139. package/dist/prompts/nccoe-demo.d.ts.map +0 -1
  140. package/dist/prompts/nccoe-demo.js +0 -47
  141. package/dist/prompts/nccoe-demo.js.map +0 -1
  142. package/dist/resources/cosai-mapping.d.ts +0 -24
  143. package/dist/resources/cosai-mapping.d.ts.map +0 -1
  144. package/dist/resources/cosai-mapping.js +0 -127
  145. package/dist/resources/cosai-mapping.js.map +0 -1
  146. package/dist/resources/crypto-primitives.d.ts +0 -3
  147. package/dist/resources/crypto-primitives.d.ts.map +0 -1
  148. package/dist/resources/crypto-primitives.js +0 -52
  149. package/dist/resources/crypto-primitives.js.map +0 -1
  150. package/dist/resources/sample-bundle.d.ts +0 -6
  151. package/dist/resources/sample-bundle.d.ts.map +0 -1
  152. package/dist/resources/sample-bundle.js +0 -58
  153. package/dist/resources/sample-bundle.js.map +0 -1
  154. package/dist/resources/specification.d.ts +0 -3
  155. package/dist/resources/specification.d.ts.map +0 -1
  156. package/dist/resources/specification.js +0 -161
  157. package/dist/resources/specification.js.map +0 -1
  158. package/dist/tools/create-artifact.d.ts +0 -25
  159. package/dist/tools/create-artifact.d.ts.map +0 -1
  160. package/dist/tools/create-artifact.js +0 -85
  161. package/dist/tools/create-artifact.js.map +0 -1
  162. package/dist/tools/delegate-subagent.d.ts +0 -18
  163. package/dist/tools/delegate-subagent.d.ts.map +0 -1
  164. package/dist/tools/delegate-subagent.js +0 -50
  165. package/dist/tools/delegate-subagent.js.map +0 -1
  166. package/dist/tools/disclose-claim.d.ts +0 -14
  167. package/dist/tools/disclose-claim.d.ts.map +0 -1
  168. package/dist/tools/disclose-claim.js +0 -23
  169. package/dist/tools/disclose-claim.js.map +0 -1
  170. package/dist/tools/export-bundle.d.ts +0 -8
  171. package/dist/tools/export-bundle.d.ts.map +0 -1
  172. package/dist/tools/export-bundle.js +0 -25
  173. package/dist/tools/export-bundle.js.map +0 -1
  174. package/dist/tools/full-lifecycle.d.ts +0 -16
  175. package/dist/tools/full-lifecycle.d.ts.map +0 -1
  176. package/dist/tools/full-lifecycle.js +0 -121
  177. package/dist/tools/full-lifecycle.js.map +0 -1
  178. package/dist/tools/generate-receipt.d.ts +0 -16
  179. package/dist/tools/generate-receipt.d.ts.map +0 -1
  180. package/dist/tools/generate-receipt.js +0 -31
  181. package/dist/tools/generate-receipt.js.map +0 -1
  182. package/dist/tools/get-chain.d.ts +0 -14
  183. package/dist/tools/get-chain.d.ts.map +0 -1
  184. package/dist/tools/get-chain.js +0 -45
  185. package/dist/tools/get-chain.js.map +0 -1
  186. package/dist/tools/get-portal-state.d.ts +0 -8
  187. package/dist/tools/get-portal-state.d.ts.map +0 -1
  188. package/dist/tools/get-portal-state.js +0 -15
  189. package/dist/tools/get-portal-state.js.map +0 -1
  190. package/dist/tools/init-chain.d.ts +0 -10
  191. package/dist/tools/init-chain.d.ts.map +0 -1
  192. package/dist/tools/init-chain.js +0 -13
  193. package/dist/tools/init-chain.js.map +0 -1
  194. package/dist/tools/measure-behavior.d.ts +0 -12
  195. package/dist/tools/measure-behavior.d.ts.map +0 -1
  196. package/dist/tools/measure-behavior.js +0 -29
  197. package/dist/tools/measure-behavior.js.map +0 -1
  198. package/dist/tools/measure-subject.d.ts +0 -15
  199. package/dist/tools/measure-subject.d.ts.map +0 -1
  200. package/dist/tools/measure-subject.js +0 -106
  201. package/dist/tools/measure-subject.js.map +0 -1
  202. package/dist/tools/quarantine-status.d.ts +0 -8
  203. package/dist/tools/quarantine-status.d.ts.map +0 -1
  204. package/dist/tools/quarantine-status.js +0 -16
  205. package/dist/tools/quarantine-status.js.map +0 -1
  206. package/dist/tools/revoke-artifact.d.ts +0 -13
  207. package/dist/tools/revoke-artifact.d.ts.map +0 -1
  208. package/dist/tools/revoke-artifact.js +0 -24
  209. package/dist/tools/revoke-artifact.js.map +0 -1
  210. package/dist/tools/rotate-keys.d.ts +0 -13
  211. package/dist/tools/rotate-keys.d.ts.map +0 -1
  212. package/dist/tools/rotate-keys.js +0 -39
  213. package/dist/tools/rotate-keys.js.map +0 -1
  214. package/dist/tools/server-info.d.ts +0 -8
  215. package/dist/tools/server-info.d.ts.map +0 -1
  216. package/dist/tools/server-info.js +0 -23
  217. package/dist/tools/server-info.js.map +0 -1
  218. package/dist/tools/set-verification-tier.d.ts +0 -11
  219. package/dist/tools/set-verification-tier.d.ts.map +0 -1
  220. package/dist/tools/set-verification-tier.js +0 -31
  221. package/dist/tools/set-verification-tier.js.map +0 -1
  222. package/dist/tools/start-monitoring.d.ts +0 -12
  223. package/dist/tools/start-monitoring.d.ts.map +0 -1
  224. package/dist/tools/start-monitoring.js +0 -17
  225. package/dist/tools/start-monitoring.js.map +0 -1
  226. package/dist/tools/trigger-measurement.d.ts +0 -15
  227. package/dist/tools/trigger-measurement.d.ts.map +0 -1
  228. package/dist/tools/trigger-measurement.js +0 -86
  229. package/dist/tools/trigger-measurement.js.map +0 -1
  230. package/dist/tools/verify-artifact.d.ts +0 -13
  231. package/dist/tools/verify-artifact.d.ts.map +0 -1
  232. package/dist/tools/verify-artifact.js +0 -6
  233. package/dist/tools/verify-artifact.js.map +0 -1
  234. package/dist/tools/verify-bundle.d.ts +0 -13
  235. package/dist/tools/verify-bundle.d.ts.map +0 -1
  236. package/dist/tools/verify-bundle.js +0 -6
  237. package/dist/tools/verify-bundle.js.map +0 -1
  238. package/dist/types.d.ts +0 -261
  239. package/dist/types.d.ts.map +0 -1
  240. package/dist/types.js +0 -8
  241. package/dist/types.js.map +0 -1
@@ -1,24 +0,0 @@
1
- export declare const COSAI_MCP_SECURITY_MAPPING: {
2
- title: string;
3
- source: string;
4
- whitepaper: string;
5
- published: string;
6
- url: string;
7
- categories: {
8
- id: string;
9
- name: string;
10
- domain: string;
11
- cosai_description: string;
12
- aga_tools: string[];
13
- aga_mechanism: string;
14
- nist_ref: string;
15
- }[];
16
- };
17
- export declare const COSAI_COVERAGE_SUMMARY: {
18
- total_threat_categories: number;
19
- categories_with_aga_coverage: number;
20
- total_tools_referenced: number;
21
- unique_cosai_categories_covered: number;
22
- nist_submission_sections_referenced: number;
23
- };
24
- //# sourceMappingURL=cosai-mapping.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cosai-mapping.d.ts","sourceRoot":"","sources":["../../src/resources/cosai-mapping.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;CAsHtC,CAAC;AAGF,eAAO,MAAM,sBAAsB;;;;;;CAMlC,CAAC"}
@@ -1,127 +0,0 @@
1
- // src/resources/cosai-mapping.ts
2
- export const COSAI_MCP_SECURITY_MAPPING = {
3
- title: 'AGA Coverage of CoSAI MCP Security Threat Taxonomy',
4
- source: 'Coalition for Secure AI (CoSAI), OASIS Open Project',
5
- whitepaper: 'Securing the AI Agent Revolution: A Practical Guide to Model Context Protocol Security',
6
- published: 'January 20, 2026',
7
- url: 'https://github.com/cosai-oasis/ws4-secure-design-agentic-systems/blob/main/model-context-protocol-security.md',
8
- categories: [
9
- {
10
- id: 'T1',
11
- name: 'Improper Authentication',
12
- domain: 'Foundational Identity & Access',
13
- cosai_description: 'Weak identity verification and credential management across agent chains',
14
- aga_tools: ['aga_create_artifact', 'aga_verify_artifact', 'aga_rotate_keys'],
15
- aga_mechanism: 'Ed25519 artifact signatures verified against pinned issuer public key. Portal rejects artifacts with invalid signatures. Key rotation recorded as chain events with both old and new keys for transition period. TTL-based re-attestation enforces continuous authentication.',
16
- nist_ref: 'NCCoE Section 3: Authentication',
17
- },
18
- {
19
- id: 'T2',
20
- name: 'Missing Access Control',
21
- domain: 'Foundational Identity & Access',
22
- cosai_description: 'Insufficient authorization checks and privilege separation',
23
- aga_tools: ['aga_start_monitoring', 'aga_trigger_measurement', 'aga_delegate_to_subagent'],
24
- aga_mechanism: 'Portal enforces sealed policy constraints as a mandatory interception layer. Agent holds no credentials and cannot bypass the portal. Delegation enforces scope diminishment: child scope must be a strict subset of parent. TTL inheritance prevents privilege extension through delegation.',
25
- nist_ref: 'NCCoE Section 4: Authorization, CAISI Section 4a',
26
- },
27
- {
28
- id: 'T3',
29
- name: 'Input Validation Failures',
30
- domain: 'Input Handling',
31
- cosai_description: 'Traditional injection flaws amplified by AI mediation',
32
- aga_tools: ['aga_trigger_measurement', 'aga_measure_behavior'],
33
- aga_mechanism: 'Portal validates every operation against sealed artifact parameters before authorizing execution. Behavioral drift detection monitors tool invocation patterns against a sealed baseline, catching injection-driven anomalies independent of binary integrity.',
34
- nist_ref: 'CAISI Section 1a: Semantic Drift Without Binary Modification',
35
- },
36
- {
37
- id: 'T4',
38
- name: 'Data/Control Boundary Failures',
39
- domain: 'Input Handling',
40
- cosai_description: 'Prompt injection and tool poisoning exploiting the LLM as intermediary',
41
- aga_tools: ['aga_measure_behavior', 'aga_quarantine_status'],
42
- aga_mechanism: 'Behavioral baseline sealed in artifact defines permitted tools, forbidden sequences, and rate limits. Prompt injection that causes unauthorized tool invocations or forbidden sequences triggers enforcement. Phantom execution quarantines the compromised agent while capturing the full attack sequence as signed forensic evidence.',
43
- nist_ref: 'NCCoE Section 6: Prompt Injection Prevention and Mitigation',
44
- },
45
- {
46
- id: 'T5',
47
- name: 'Inadequate Data Protection',
48
- domain: 'Data & Code Protection',
49
- cosai_description: 'Insufficient encryption and secrets management',
50
- aga_tools: ['aga_create_artifact', 'aga_disclose_claim'],
51
- aga_mechanism: 'Attestation evidence stored as salted commitments: Hash(Content || Salt). Original content never stored in the artifact. Privacy-preserving disclosure with automatic substitution prevents sensitive data exposure. Inference risk checking blocks combinations of disclosures that would reveal denied claims.',
52
- nist_ref: 'CAISI Section 5a: Privacy-Preserving Governance Disclosure',
53
- },
54
- {
55
- id: 'T6',
56
- name: 'Missing Integrity Controls',
57
- domain: 'Data & Code Protection',
58
- cosai_description: 'Lack of verification for MCP servers and tool definitions',
59
- aga_tools: ['aga_create_artifact', 'aga_trigger_measurement', 'aga_verify_artifact'],
60
- aga_mechanism: 'Sealed hash computed over subject bytes, metadata, policy reference, and salt. Portal computes runtime hash on every request and compares to sealed reference. Any modification to any component (server binary, tool definitions, configuration) produces a hash mismatch and triggers enforcement. 10 measurement embodiments cover executable images, loaded modules, container images, configuration manifests, SBOMs, and more.',
61
- nist_ref: 'CAISI Section 2a: Sealed Policy Artifacts',
62
- },
63
- {
64
- id: 'T7',
65
- name: 'Session/Transport Security',
66
- domain: 'Network & Transport',
67
- cosai_description: 'Insecure protocols and session management',
68
- aga_tools: ['aga_create_artifact', 'aga_revoke_artifact'],
69
- aga_mechanism: 'Artifact TTL enforces session expiration. Expired artifacts require re-attestation (fail-closed). Mid-session revocation immediately terminates agent authority. All artifacts and receipts cryptographically signed with Ed25519, preventing session hijacking or replay.',
70
- nist_ref: 'NCCoE Section 3: TTL-Based Re-Attestation',
71
- },
72
- {
73
- id: 'T8',
74
- name: 'Network Isolation Failures',
75
- domain: 'Network & Transport',
76
- cosai_description: 'Improper network binding and segmentation',
77
- aga_tools: ['aga_start_monitoring', 'aga_trigger_measurement'],
78
- aga_mechanism: 'Two-process architecture: portal and agent are separate OS processes. Agent has no direct network access, no credentials, no keys. Portal is the only path to external resources. NETWORK_ISOLATE enforcement action severs network connections while allowing continued local execution for forensic capture.',
79
- nist_ref: 'CAISI Section 2a: The Portal as Mandatory Runtime Enforcement Boundary',
80
- },
81
- {
82
- id: 'T9',
83
- name: 'Trust Boundary Failures',
84
- domain: 'Trust & Design',
85
- cosai_description: 'Overreliance on LLM judgment for security decisions',
86
- aga_tools: ['aga_create_artifact', 'aga_trigger_measurement', 'aga_measure_behavior'],
87
- aga_mechanism: 'Security decisions are pre-committed in the sealed artifact by human authorities before deployment, not delegated to the LLM at runtime. The portal enforces constraints mechanically through hash comparison and behavioral pattern matching. The LLM cannot override, modify, or bypass the sealed enforcement parameters.',
88
- nist_ref: 'CAISI Section 4a: Fail-Closed Semantics',
89
- },
90
- {
91
- id: 'T10',
92
- name: 'Resource Management',
93
- domain: 'Trust & Design',
94
- cosai_description: 'Absence of rate limiting and quota controls',
95
- aga_tools: ['aga_measure_behavior', 'aga_create_artifact'],
96
- aga_mechanism: 'Behavioral baseline includes per-tool rate limits sealed in the artifact. Portal tracks invocation rates within a configurable time window. Rate limit violations trigger enforcement. Measurement cadence is configurable from 10ms (SCADA) to 3,600,000ms, preventing resource exhaustion from excessive measurement overhead.',
97
- nist_ref: 'CAISI Section 2a: Configurable Measurement Cadences',
98
- },
99
- {
100
- id: 'T11',
101
- name: 'Supply Chain Failures',
102
- domain: 'Operational Security',
103
- cosai_description: 'Insecure MCP server lifecycle and distribution',
104
- aga_tools: ['aga_create_artifact', 'aga_verify_artifact', 'aga_trigger_measurement'],
105
- aga_mechanism: 'Content-addressable hash binding at attestation time. Every component (server binary, skill files, dependencies, configuration) is hashed and sealed into the artifact. Runtime measurement detects any modification to any component. Artifact signature binds all fields cryptographically. Modified or substituted components produce hash mismatches and are blocked before execution.',
106
- nist_ref: 'CAISI Section 1a: Supply Chain Injection',
107
- },
108
- {
109
- id: 'T12',
110
- name: 'Insufficient Observability',
111
- domain: 'Operational Security',
112
- cosai_description: 'Lack of logging, monitoring, and audit trails',
113
- aga_tools: ['aga_generate_receipt', 'aga_get_chain', 'aga_export_bundle', 'aga_verify_bundle'],
114
- aga_mechanism: 'Signed receipt generated for every measurement (match or mismatch). Receipts appended to tamper-evident continuity chain linked by structural metadata hashes. Payload excluded from leaf hash computation, enabling third-party verification without payload disclosure. Merkle checkpoint anchoring prevents history rewriting. Evidence bundles enable portable offline verification through a 4-step process: artifact signature, receipt signatures, Merkle proofs, and anchor validation.',
115
- nist_ref: 'CAISI Section 2a: Tamper-Evident Accountability',
116
- },
117
- ],
118
- };
119
- // Summary statistics
120
- export const COSAI_COVERAGE_SUMMARY = {
121
- total_threat_categories: 12,
122
- categories_with_aga_coverage: 12,
123
- total_tools_referenced: 20, // all 20 tools participate in at least one category
124
- unique_cosai_categories_covered: 12,
125
- nist_submission_sections_referenced: 10,
126
- };
127
- //# sourceMappingURL=cosai-mapping.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cosai-mapping.js","sourceRoot":"","sources":["../../src/resources/cosai-mapping.ts"],"names":[],"mappings":"AAAA,iCAAiC;AAEjC,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,KAAK,EAAE,oDAAoD;IAC3D,MAAM,EAAE,qDAAqD;IAC7D,UAAU,EAAE,wFAAwF;IACpG,SAAS,EAAE,kBAAkB;IAC7B,GAAG,EAAE,+GAA+G;IAEpH,UAAU,EAAE;QACV;YACE,EAAE,EAAE,IAAI;YACR,IAAI,EAAE,yBAAyB;YAC/B,MAAM,EAAE,gCAAgC;YACxC,iBAAiB,EAAE,0EAA0E;YAC7F,SAAS,EAAE,CAAC,qBAAqB,EAAE,qBAAqB,EAAE,iBAAiB,CAAC;YAC5E,aAAa,EAAE,+QAA+Q;YAE9R,QAAQ,EAAE,iCAAiC;SAC5C;QACD;YACE,EAAE,EAAE,IAAI;YACR,IAAI,EAAE,wBAAwB;YAC9B,MAAM,EAAE,gCAAgC;YACxC,iBAAiB,EAAE,4DAA4D;YAC/E,SAAS,EAAE,CAAC,sBAAsB,EAAE,yBAAyB,EAAE,0BAA0B,CAAC;YAC1F,aAAa,EAAE,+RAA+R;YAC9S,QAAQ,EAAE,kDAAkD;SAC7D;QACD;YACE,EAAE,EAAE,IAAI;YACR,IAAI,EAAE,2BAA2B;YACjC,MAAM,EAAE,gBAAgB;YACxB,iBAAiB,EAAE,uDAAuD;YAC1E,SAAS,EAAE,CAAC,yBAAyB,EAAE,sBAAsB,CAAC;YAC9D,aAAa,EAAE,gQAAgQ;YAC/Q,QAAQ,EAAE,8DAA8D;SACzE;QACD;YAC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qD;YACxE,SAAS,EAAE,CAAC,qBAAqB,EAAE,yBAAyB,EAAE,sBAAsB,CAAC;YACrF,aAAa,EAAE,8TAA8T;YAC7U,QAAQ,EAAE,yCAAyC;SACpD;QACD;YACE,EAAE,EAAE,KAAK;YACT,IAAI,EAAE,qBAAqB;YAC3B,MAAM,EAAE,gBAAgB;YACxB,iBAAiB,EAAE,6CAA6C;YAChE,SAAS,EAAE,CAAC,sBAAsB,EAAE,qBAAqB,CAAC;YAC1D,aAAa,EAAE,kUAAkU;YACjV,QAAQ,EAAE,qDAAqD;SAChE;QACD;YACE,EAAE,EAAE,KAAK;YACT,IAAI,EAAE,uBAAuB;YAC7B,MAAM,EAAE,sBAAsB;YAC9B,iBAAiB,EAAE,gDAAgD;YACnE,SAAS,EAAE,CAAC,qBAAqB,EAAE,qBAAqB,EAAE,yBAAyB,CAAC;YACpF,aAAa,EAAE,4XAA4X;YAC3Y,QAAQ,EAAE,0CAA0C;SACrD;QACD;YACE,EAAE,EAAE,KAAK;YACT,IAAI,EAAE,4BAA4B;YAClC,MAAM,EAAE,sBAAsB;YAC9B,iBAAiB,EAAE,+CAA+C;YAClE,SAAS,EAAE,CAAC,sBAAsB,EAAE,eAAe,EAAE,mBAAmB,EAAE,mBAAmB,CAAC;YAC9F,aAAa,EAAE,ieAAie;YAChf,QAAQ,EAAE,iDAAiD;SAC5D;KACF;CACF,CAAC;AAEF,qBAAqB;AACrB,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,uBAAuB,EAAE,EAAE;IAC3B,4BAA4B,EAAE,EAAE;IAChC,sBAAsB,EAAE,EAAE,EAAG,oDAAoD;IACjF,+BAA+B,EAAE,EAAE;IACnC,mCAAmC,EAAE,EAAE;CACxC,CAAC"}
@@ -1,3 +0,0 @@
1
- export declare const CRYPTO_PRIMITIVES_DOC = "# AGA Cryptographic Primitives\n\n## Ed25519 Digital Signatures\n- Library: @noble/ed25519 v2.1.0\n- Key size: 256-bit (32 bytes)\n- Signature size: 512-bit (64 bytes)\n- Used for: Artifact signing, receipt signing, chain event signing\n\n## SHA-256 Hashing\n- Library: @noble/hashes v1.7.0\n- Output: 256-bit (64 hex characters)\n- Used for: Sealed hash, leaf hash, payload hash, subject identity\n\n## Sealed Hash Construction\n```\nsealed_hash = SHA-256(bytes_hash || metadata_hash || policy_reference || seal_salt)\n```\n- No delimiters between fields (raw hex concatenation)\n- No delimiters per protocol spec\n\n## Leaf Hash Construction\n```\nleaf_hash = SHA-256(\n schema_version || \"||\" || protocol_version || \"||\" ||\n event_type || \"||\" || event_id || \"||\" ||\n sequence_number || \"||\" || timestamp || \"||\" ||\n previous_leaf_hash\n)\n```\n- **Payload EXCLUDED** - privacy innovation\n- Chain integrity verifiable without revealing event contents\n\n## Salted Commitments\n```\ncommitment = SHA-256(content_bytes || salt_bytes)\n```\n- Salt: 128-bit (16 bytes, 32 hex chars) CSPRNG\n- Enables selective disclosure\n\n## Merkle Trees\n- Binary tree over leaf hashes\n- Internal nodes: SHA-256(left || right)\n- Odd leaf count: last leaf duplicated\n- Inclusion proofs: array of {hash, direction} pairs\n\n## Canonical Serialization\n- RFC 8785 aligned\n- Sorted keys, no whitespace\n- Used before signing any object\n";
2
- export declare const CRYPTO_PRIMITIVES_URI = "aga://crypto-primitives";
3
- //# sourceMappingURL=crypto-primitives.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"crypto-primitives.d.ts","sourceRoot":"","sources":["../../src/resources/crypto-primitives.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,w6CAiDjC,CAAC;AAEF,eAAO,MAAM,qBAAqB,4BAA4B,CAAC"}
@@ -1,52 +0,0 @@
1
- export const CRYPTO_PRIMITIVES_DOC = `# AGA Cryptographic Primitives
2
-
3
- ## Ed25519 Digital Signatures
4
- - Library: @noble/ed25519 v2.1.0
5
- - Key size: 256-bit (32 bytes)
6
- - Signature size: 512-bit (64 bytes)
7
- - Used for: Artifact signing, receipt signing, chain event signing
8
-
9
- ## SHA-256 Hashing
10
- - Library: @noble/hashes v1.7.0
11
- - Output: 256-bit (64 hex characters)
12
- - Used for: Sealed hash, leaf hash, payload hash, subject identity
13
-
14
- ## Sealed Hash Construction
15
- \`\`\`
16
- sealed_hash = SHA-256(bytes_hash || metadata_hash || policy_reference || seal_salt)
17
- \`\`\`
18
- - No delimiters between fields (raw hex concatenation)
19
- - No delimiters per protocol spec
20
-
21
- ## Leaf Hash Construction
22
- \`\`\`
23
- leaf_hash = SHA-256(
24
- schema_version || "||" || protocol_version || "||" ||
25
- event_type || "||" || event_id || "||" ||
26
- sequence_number || "||" || timestamp || "||" ||
27
- previous_leaf_hash
28
- )
29
- \`\`\`
30
- - **Payload EXCLUDED** - privacy innovation
31
- - Chain integrity verifiable without revealing event contents
32
-
33
- ## Salted Commitments
34
- \`\`\`
35
- commitment = SHA-256(content_bytes || salt_bytes)
36
- \`\`\`
37
- - Salt: 128-bit (16 bytes, 32 hex chars) CSPRNG
38
- - Enables selective disclosure
39
-
40
- ## Merkle Trees
41
- - Binary tree over leaf hashes
42
- - Internal nodes: SHA-256(left || right)
43
- - Odd leaf count: last leaf duplicated
44
- - Inclusion proofs: array of {hash, direction} pairs
45
-
46
- ## Canonical Serialization
47
- - RFC 8785 aligned
48
- - Sorted keys, no whitespace
49
- - Used before signing any object
50
- `;
51
- export const CRYPTO_PRIMITIVES_URI = 'aga://crypto-primitives';
52
- //# sourceMappingURL=crypto-primitives.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"crypto-primitives.js","sourceRoot":"","sources":["../../src/resources/crypto-primitives.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiDpC,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,yBAAyB,CAAC"}
@@ -1,6 +0,0 @@
1
- export declare function generateSampleBundle(): {
2
- bundle: string;
3
- issuerPkHex: string;
4
- };
5
- export declare const SAMPLE_BUNDLE_URI = "aga://sample-bundle";
6
- //# sourceMappingURL=sample-bundle.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sample-bundle.d.ts","sourceRoot":"","sources":["../../src/resources/sample-bundle.ts"],"names":[],"mappings":"AAgBA,wBAAgB,oBAAoB,IAAI;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CA8C9E;AAED,eAAO,MAAM,iBAAiB,wBAAwB,CAAC"}
@@ -1,58 +0,0 @@
1
- /**
2
- * Sample Evidence Bundle: generates a real, cryptographically signed bundle.
3
- * Can be verified with aga_verify_bundle.
4
- */
5
- import { generateKeyPair, pkToHex } from '../crypto/sign.js';
6
- import { sha256Str } from '../crypto/hash.js';
7
- import { computeSubjectIdFromString } from '../core/subject.js';
8
- import { performAttestation } from '../core/attestation.js';
9
- import { generateArtifact, hashArtifact } from '../core/artifact.js';
10
- import { generateReceipt } from '../core/receipt.js';
11
- import { createGenesisEvent, appendEvent } from '../core/chain.js';
12
- import { createCheckpoint, eventInclusionProof } from '../core/checkpoint.js';
13
- import { generateBundle } from '../core/bundle.js';
14
- let cachedBundle = null;
15
- export function generateSampleBundle() {
16
- if (cachedBundle)
17
- return cachedBundle;
18
- const issuerKP = generateKeyPair();
19
- const portalKP = generateKeyPair();
20
- const chainKP = generateKeyPair();
21
- const content = 'def sample_agent(): return task.execute()';
22
- const meta = { filename: 'sample_agent.py', version: '1.0.0' };
23
- const subId = computeSubjectIdFromString(content, meta);
24
- const policyRef = sha256Str('sample-policy');
25
- const att = performAttestation({ subject_identifier: subId, policy_reference: policyRef, evidence_items: [] });
26
- const artifact = generateArtifact({
27
- subject_identifier: subId, policy_reference: policyRef, policy_version: 1,
28
- sealed_hash: att.sealed_hash, seal_salt: att.seal_salt,
29
- enforcement_parameters: {
30
- measurement_cadence_ms: 1000, ttl_seconds: 3600,
31
- enforcement_triggers: ['QUARANTINE', 'TERMINATE'],
32
- re_attestation_required: true, measurement_types: ['EXECUTABLE_IMAGE'],
33
- },
34
- disclosure_policy: { claims_taxonomy: [], substitution_rules: [] },
35
- evidence_commitments: att.evidence_commitments, issuer_keypair: issuerKP,
36
- });
37
- const artRef = hashArtifact(artifact);
38
- const receipt = generateReceipt({
39
- subjectId: subId, artifactRef: artRef,
40
- currentHash: subId.bytes_hash, sealedHash: subId.bytes_hash,
41
- driftDetected: false, driftDescription: null, action: null,
42
- measurementType: 'EXECUTABLE_IMAGE', seq: 1, prevLeaf: null, portalKP,
43
- });
44
- const genesis = createGenesisEvent(chainKP, sha256Str('AGA-Spec'));
45
- const e1 = appendEvent('POLICY_ISSUANCE', { artifact_hash: artRef }, genesis, chainKP);
46
- const e2 = appendEvent('INTERACTION_RECEIPT', { receipt_id: receipt.receipt_id }, e1, chainKP);
47
- const chain = [genesis, e1, e2];
48
- const { checkpoint } = createCheckpoint(chain);
49
- const proof = eventInclusionProof(chain, e1.sequence_number);
50
- const bundle = generateBundle(artifact, [receipt], [proof], checkpoint, portalKP);
51
- cachedBundle = {
52
- bundle: JSON.stringify(bundle, null, 2),
53
- issuerPkHex: pkToHex(issuerKP.publicKey),
54
- };
55
- return cachedBundle;
56
- }
57
- export const SAMPLE_BUNDLE_URI = 'aga://sample-bundle';
58
- //# sourceMappingURL=sample-bundle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sample-bundle.js","sourceRoot":"","sources":["../../src/resources/sample-bundle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,eAA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;IAElF,YAAY,GAAG;QACb,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;QACvC,WAAW,EAAE,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC;KACzC,CAAC;IACF,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG,qBAAqB,CAAC"}
@@ -1,3 +0,0 @@
1
- export declare const PROTOCOL_SPECIFICATION = "# Attested Governance Artifact (AGA) Protocol Specification v2.0.0\n\n## NIST References\n- NIST-2025-0035: AI Agent Transparency and Accountability\n- NCCoE AI Agent Identity and Authorization\n\n## Protocol Overview\nThe AGA protocol provides cryptographic governance for autonomous AI systems through:\n1. **Sealed Hash Attestation** - SHA-256(bytes_hash || metadata_hash || policy_ref || seal_salt)\n2. **Continuity Chain** - Tamper-evident append-only event log with privacy-preserving leaf hashes\n3. **Portal State Machine** - Zero-trust Policy Enforcement Point (7 states, fail-closed)\n4. **Signed Receipts** - Ed25519-signed measurement receipt for EVERY measurement\n5. **Evidence Bundles** - Offline-verifiable packages with Merkle inclusion proofs\n\n## 10 Measurement Embodiments\n1. EXECUTABLE_IMAGE - Runtime binary or script content\n2. LOADED_MODULES - Dynamic libraries and plugins\n3. CONTAINER_IMAGE - Container image manifest hash\n4. CONFIG_MANIFEST - Configuration file integrity\n5. SBOM - Software Bill of Materials verification\n6. TEE_QUOTE - Trusted Execution Environment attestation\n7. MEMORY_REGIONS - Runtime memory layout verification\n8. CONTROL_FLOW - Execution path integrity\n9. FILE_SYSTEM_STATE - Filesystem integrity monitoring\n10. NETWORK_CONFIG - Network configuration baseline\n\n## 6 Portal States\n1. INITIALIZATION - Server started, no artifact loaded\n2. ARTIFACT_VERIFICATION - Verifying artifact signature and validity\n3. ACTIVE_MONITORING - Operational, measurements occurring\n4. DRIFT_DETECTED - Hash mismatch detected, enforcement pending\n5. PHANTOM_QUARANTINE - Forensic capture mode, outputs severed\n6. TERMINATED - Fail-closed, no recovery without re-attestation\n\nPlus SAFE_STATE for graceful degradation on revocation.\n\n## 7 Enforcement Actions\n1. QUARANTINE - Phantom execution with forensic capture\n2. TERMINATE - Immediate kill, fail-closed\n3. SAFE_STATE - Return-to-home / controlled shutdown\n4. NETWORK_ISOLATE - Sever network, continue local\n5. KEY_REVOKE - Invalidate cryptographic keys\n6. TOKEN_INVALIDATE - Revoke access tokens\n7. ALERT_ONLY - Log without enforcement (gradual deployment)\n\n## 3 Verification Tiers\n| Tier | Description | Trust Assumption |\n|------|-------------|-----------------|\n| Bronze | Cryptographic signatures only | Trust signing keys |\n| Silver | Signatures + continuity chain | Trust chain operator + keys |\n| Gold | Full verification with blockchain-anchored Merkle proofs | Minimal trust - external anchor |\n\n## 3 Disclosure Modes\n1. PROOF_ONLY - Returns boolean attestation without revealing the value\n2. REVEAL_MIN - Returns minimal representation (e.g., range instead of exact value)\n3. REVEAL_FULL - Returns the complete claim value\n\n## Leaf Hash Formula (Privacy Innovation)\n```\nleaf_hash = SHA-256(\n schema_version || \"||\" || protocol_version || \"||\" ||\n event_type || \"||\" || event_id || \"||\" ||\n sequence_number || \"||\" || timestamp || \"||\" ||\n previous_leaf_hash\n)\n```\n**PAYLOAD IS EXCLUDED from the leaf hash.** This is a key privacy innovation - chain integrity can be verified without revealing the contents of any event. Only the structural metadata participates in the hash. The payload is separately integrity-protected via event_signature.\n\n## SPIFFE/SPIRE Integration Point\nSPIRE handles node-to-workload identity (SVID); AGA handles workload-to-intent governance. SPIFFE provides transport-layer identity binding via SVIDs (SPIFFE Verifiable Identity Documents). AGA binds governance policy to the workload's operational intent, creating a complementary layer:\n- SPIFFE: \"This workload IS who it claims to be\" (identity)\n- AGA: \"This workload IS DOING what it was attested to do\" (governance)\n\n## Framework Alignment\n| Framework | AGA Alignment |\n|-----------|--------------|\n| NIST SP 800-53 | SI-7 (Software Integrity), AU-10 (Non-repudiation), SI-4 (Monitoring) |\n| NIST AI RMF | Govern \u2192 Policy Artifacts; Map \u2192 Subject ID; Measure \u2192 Portal + Receipts; Manage \u2192 Enforcement |\n| NIST SP 800-57 | Key management for Ed25519 signing keys |\n| NIST SSDF (SP 800-218) | Software supply chain integrity via sealed hash attestation |\n| NIST SP 800-207 (ZTA) | Zero Trust Architecture - portal as Policy Enforcement Point, never trust, always verify |\n| ISO 42001 | AI management system - governance artifacts as compliance evidence |\n| EU AI Act | High-risk AI system transparency via evidence bundles |\n\n## Cryptographic Primitives\n- **Hashing:** SHA-256 (primary), BLAKE2b-256 (secondary)\n- **Signing:** Ed25519 via @noble/ed25519\n- **Salts:** 128-bit CSPRNG via @noble/hashes/utils\n- **Merkle Trees:** SHA-256 binary tree with inclusion proofs\n- **Serialization:** RFC 8785 deterministic JSON (sorted keys)\n\n## Event Types (12)\nGENESIS, POLICY_ISSUANCE, INTERACTION_RECEIPT, REVOCATION, ATTESTATION,\nANCHOR_BATCH, DISCLOSURE, SUBSTITUTION, KEY_ROTATION, BEHAVIORAL_DRIFT,\nDELEGATION, RE_ATTESTATION\n\n## 4 Sensitivity Levels\n- S1_LOW - Can be revealed fully\n- S2_MODERATE - Can be revealed minimally or proved\n- S3_HIGH - Proof only, auto-substitutes to lower sensitivity\n- S4_CRITICAL - Maximum protection, proof only, cascading substitution\n\n## CoSAI MCP Security Threat Coverage\n\nThe Coalition for Secure AI (CoSAI) published a comprehensive MCP security taxonomy\nidentifying 12 core threat categories and nearly 40 distinct threats specific to Model\nContext Protocol deployments (January 2026). The AGA MCP Server addresses all 12 categories.\n\n| CoSAI Category | Threat Domain | AGA Governance Mechanism |\n|---|---|---|\n| T1: Improper Authentication | Identity & Access | Ed25519 artifact signatures, pinned issuer keys, TTL re-attestation, key rotation chain events |\n| T2: Missing Access Control | Identity & Access | Portal as mandatory enforcement boundary, sealed constraints, delegation with scope diminishment |\n| T3: Input Validation Failures | Input Handling | Runtime measurement against sealed reference, behavioral drift detection |\n| T4: Data/Control Boundary Failures | Input Handling | Behavioral baseline (permitted tools, forbidden sequences, rate limits), phantom execution forensics |\n| T5: Inadequate Data Protection | Data & Code | Salted commitments, privacy-preserving disclosure with substitution, inference risk prevention |\n| T6: Missing Integrity Controls | Data & Code | Content-addressable hash binding, 10 measurement embodiments, continuous runtime verification |\n| T7: Session/Transport Security | Network & Transport | TTL-based artifact expiration, fail-closed on expiry, mid-session revocation, Ed25519 signed receipts |\n| T8: Network Isolation Failures | Network & Transport | Two-process architecture, agent holds no credentials, NETWORK_ISOLATE enforcement action |\n| T9: Trust Boundary Failures | Trust & Design | Enforcement pre-committed by human authorities in sealed artifact, not delegated to LLM |\n| T10: Resource Management | Trust & Design | Per-tool rate limits in behavioral baseline, configurable measurement cadence (10ms to 3600s) |\n| T11: Supply Chain Failures | Operational | Content-addressable hashing at attestation, runtime hash comparison blocks modified components |\n| T12: Insufficient Observability | Operational | Signed receipts, tamper-evident continuity chain, Merkle anchoring, offline evidence bundles |\n\nCoverage: 12 of 12 threat categories addressed.\nSource: CoSAI/OASIS, \"Securing the AI Agent Revolution\" (January 2026)\n\n### CoSAI Recommended Controls and AGA Implementation\n\n1. Strong Identity Throughout the Chain\n AGA: Ed25519 keypairs for issuer, portal, and chain. Every artifact and receipt\n cryptographically signed. Key rotation recorded in chain. Delegation produces\n derived artifacts with independent signatures traceable to the issuing authority.\n\n2. Zero Trust Applied to AI Agents\n AGA: Portal treats all agent operations as untrusted. Every request measured\n against sealed reference before authorization. Fail-closed: default state is denial.\n Agent cannot execute without a valid, signature-verified artifact.\n\n3. Sandbox Everything\n AGA: Two-process architecture. Agent and portal are separate OS processes.\n Agent has no credentials, no keys, no direct resource access. Phantom execution\n provides runtime sandboxing when drift is detected.\n\n4. Defensive Tool Design\n AGA: Permitted tools sealed in artifact. Forbidden sequences explicitly defined.\n Rate limits per tool. Portal enforces all constraints mechanically, independent\n of LLM judgment. Behavioral drift detection catches tool misuse patterns.\n\n5. Supply Chain Lockdown\n AGA: Content-addressable hash binding at attestation. Runtime measurement\n detects any component modification. Sealed hash covers all subject bytes,\n metadata, and policy reference. 10 measurement embodiments for comprehensive\n coverage.\n\n6. Observability from Day One\n AGA: Signed receipt for every measurement. Tamper-evident continuity chain.\n Structural metadata linking enables third-party verification without payload\n disclosure. Merkle checkpoint anchoring. Portable offline evidence bundles.\n";
2
- export declare const SPECIFICATION_URI = "aga://specification";
3
- //# sourceMappingURL=specification.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"specification.d.ts","sourceRoot":"","sources":["../../src/resources/specification.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,siSA8JlC,CAAC;AAEF,eAAO,MAAM,iBAAiB,wBAAwB,CAAC"}
@@ -1,161 +0,0 @@
1
- export const PROTOCOL_SPECIFICATION = `# Attested Governance Artifact (AGA) Protocol Specification v2.0.0
2
-
3
- ## NIST References
4
- - NIST-2025-0035: AI Agent Transparency and Accountability
5
- - NCCoE AI Agent Identity and Authorization
6
-
7
- ## Protocol Overview
8
- The AGA protocol provides cryptographic governance for autonomous AI systems through:
9
- 1. **Sealed Hash Attestation** - SHA-256(bytes_hash || metadata_hash || policy_ref || seal_salt)
10
- 2. **Continuity Chain** - Tamper-evident append-only event log with privacy-preserving leaf hashes
11
- 3. **Portal State Machine** - Zero-trust Policy Enforcement Point (7 states, fail-closed)
12
- 4. **Signed Receipts** - Ed25519-signed measurement receipt for EVERY measurement
13
- 5. **Evidence Bundles** - Offline-verifiable packages with Merkle inclusion proofs
14
-
15
- ## 10 Measurement Embodiments
16
- 1. EXECUTABLE_IMAGE - Runtime binary or script content
17
- 2. LOADED_MODULES - Dynamic libraries and plugins
18
- 3. CONTAINER_IMAGE - Container image manifest hash
19
- 4. CONFIG_MANIFEST - Configuration file integrity
20
- 5. SBOM - Software Bill of Materials verification
21
- 6. TEE_QUOTE - Trusted Execution Environment attestation
22
- 7. MEMORY_REGIONS - Runtime memory layout verification
23
- 8. CONTROL_FLOW - Execution path integrity
24
- 9. FILE_SYSTEM_STATE - Filesystem integrity monitoring
25
- 10. NETWORK_CONFIG - Network configuration baseline
26
-
27
- ## 6 Portal States
28
- 1. INITIALIZATION - Server started, no artifact loaded
29
- 2. ARTIFACT_VERIFICATION - Verifying artifact signature and validity
30
- 3. ACTIVE_MONITORING - Operational, measurements occurring
31
- 4. DRIFT_DETECTED - Hash mismatch detected, enforcement pending
32
- 5. PHANTOM_QUARANTINE - Forensic capture mode, outputs severed
33
- 6. TERMINATED - Fail-closed, no recovery without re-attestation
34
-
35
- Plus SAFE_STATE for graceful degradation on revocation.
36
-
37
- ## 7 Enforcement Actions
38
- 1. QUARANTINE - Phantom execution with forensic capture
39
- 2. TERMINATE - Immediate kill, fail-closed
40
- 3. SAFE_STATE - Return-to-home / controlled shutdown
41
- 4. NETWORK_ISOLATE - Sever network, continue local
42
- 5. KEY_REVOKE - Invalidate cryptographic keys
43
- 6. TOKEN_INVALIDATE - Revoke access tokens
44
- 7. ALERT_ONLY - Log without enforcement (gradual deployment)
45
-
46
- ## 3 Verification Tiers
47
- | Tier | Description | Trust Assumption |
48
- |------|-------------|-----------------|
49
- | Bronze | Cryptographic signatures only | Trust signing keys |
50
- | Silver | Signatures + continuity chain | Trust chain operator + keys |
51
- | Gold | Full verification with blockchain-anchored Merkle proofs | Minimal trust - external anchor |
52
-
53
- ## 3 Disclosure Modes
54
- 1. PROOF_ONLY - Returns boolean attestation without revealing the value
55
- 2. REVEAL_MIN - Returns minimal representation (e.g., range instead of exact value)
56
- 3. REVEAL_FULL - Returns the complete claim value
57
-
58
- ## Leaf Hash Formula (Privacy Innovation)
59
- \`\`\`
60
- leaf_hash = SHA-256(
61
- schema_version || "||" || protocol_version || "||" ||
62
- event_type || "||" || event_id || "||" ||
63
- sequence_number || "||" || timestamp || "||" ||
64
- previous_leaf_hash
65
- )
66
- \`\`\`
67
- **PAYLOAD IS EXCLUDED from the leaf hash.** This is a key privacy innovation - chain integrity can be verified without revealing the contents of any event. Only the structural metadata participates in the hash. The payload is separately integrity-protected via event_signature.
68
-
69
- ## SPIFFE/SPIRE Integration Point
70
- SPIRE handles node-to-workload identity (SVID); AGA handles workload-to-intent governance. SPIFFE provides transport-layer identity binding via SVIDs (SPIFFE Verifiable Identity Documents). AGA binds governance policy to the workload's operational intent, creating a complementary layer:
71
- - SPIFFE: "This workload IS who it claims to be" (identity)
72
- - AGA: "This workload IS DOING what it was attested to do" (governance)
73
-
74
- ## Framework Alignment
75
- | Framework | AGA Alignment |
76
- |-----------|--------------|
77
- | NIST SP 800-53 | SI-7 (Software Integrity), AU-10 (Non-repudiation), SI-4 (Monitoring) |
78
- | NIST AI RMF | Govern → Policy Artifacts; Map → Subject ID; Measure → Portal + Receipts; Manage → Enforcement |
79
- | NIST SP 800-57 | Key management for Ed25519 signing keys |
80
- | NIST SSDF (SP 800-218) | Software supply chain integrity via sealed hash attestation |
81
- | NIST SP 800-207 (ZTA) | Zero Trust Architecture - portal as Policy Enforcement Point, never trust, always verify |
82
- | ISO 42001 | AI management system - governance artifacts as compliance evidence |
83
- | EU AI Act | High-risk AI system transparency via evidence bundles |
84
-
85
- ## Cryptographic Primitives
86
- - **Hashing:** SHA-256 (primary), BLAKE2b-256 (secondary)
87
- - **Signing:** Ed25519 via @noble/ed25519
88
- - **Salts:** 128-bit CSPRNG via @noble/hashes/utils
89
- - **Merkle Trees:** SHA-256 binary tree with inclusion proofs
90
- - **Serialization:** RFC 8785 deterministic JSON (sorted keys)
91
-
92
- ## Event Types (12)
93
- GENESIS, POLICY_ISSUANCE, INTERACTION_RECEIPT, REVOCATION, ATTESTATION,
94
- ANCHOR_BATCH, DISCLOSURE, SUBSTITUTION, KEY_ROTATION, BEHAVIORAL_DRIFT,
95
- DELEGATION, RE_ATTESTATION
96
-
97
- ## 4 Sensitivity Levels
98
- - S1_LOW - Can be revealed fully
99
- - S2_MODERATE - Can be revealed minimally or proved
100
- - S3_HIGH - Proof only, auto-substitutes to lower sensitivity
101
- - S4_CRITICAL - Maximum protection, proof only, cascading substitution
102
-
103
- ## CoSAI MCP Security Threat Coverage
104
-
105
- The Coalition for Secure AI (CoSAI) published a comprehensive MCP security taxonomy
106
- identifying 12 core threat categories and nearly 40 distinct threats specific to Model
107
- Context Protocol deployments (January 2026). The AGA MCP Server addresses all 12 categories.
108
-
109
- | CoSAI Category | Threat Domain | AGA Governance Mechanism |
110
- |---|---|---|
111
- | T1: Improper Authentication | Identity & Access | Ed25519 artifact signatures, pinned issuer keys, TTL re-attestation, key rotation chain events |
112
- | T2: Missing Access Control | Identity & Access | Portal as mandatory enforcement boundary, sealed constraints, delegation with scope diminishment |
113
- | T3: Input Validation Failures | Input Handling | Runtime measurement against sealed reference, behavioral drift detection |
114
- | T4: Data/Control Boundary Failures | Input Handling | Behavioral baseline (permitted tools, forbidden sequences, rate limits), phantom execution forensics |
115
- | T5: Inadequate Data Protection | Data & Code | Salted commitments, privacy-preserving disclosure with substitution, inference risk prevention |
116
- | T6: Missing Integrity Controls | Data & Code | Content-addressable hash binding, 10 measurement embodiments, continuous runtime verification |
117
- | T7: Session/Transport Security | Network & Transport | TTL-based artifact expiration, fail-closed on expiry, mid-session revocation, Ed25519 signed receipts |
118
- | T8: Network Isolation Failures | Network & Transport | Two-process architecture, agent holds no credentials, NETWORK_ISOLATE enforcement action |
119
- | T9: Trust Boundary Failures | Trust & Design | Enforcement pre-committed by human authorities in sealed artifact, not delegated to LLM |
120
- | T10: Resource Management | Trust & Design | Per-tool rate limits in behavioral baseline, configurable measurement cadence (10ms to 3600s) |
121
- | T11: Supply Chain Failures | Operational | Content-addressable hashing at attestation, runtime hash comparison blocks modified components |
122
- | T12: Insufficient Observability | Operational | Signed receipts, tamper-evident continuity chain, Merkle anchoring, offline evidence bundles |
123
-
124
- Coverage: 12 of 12 threat categories addressed.
125
- Source: CoSAI/OASIS, "Securing the AI Agent Revolution" (January 2026)
126
-
127
- ### CoSAI Recommended Controls and AGA Implementation
128
-
129
- 1. Strong Identity Throughout the Chain
130
- AGA: Ed25519 keypairs for issuer, portal, and chain. Every artifact and receipt
131
- cryptographically signed. Key rotation recorded in chain. Delegation produces
132
- derived artifacts with independent signatures traceable to the issuing authority.
133
-
134
- 2. Zero Trust Applied to AI Agents
135
- AGA: Portal treats all agent operations as untrusted. Every request measured
136
- against sealed reference before authorization. Fail-closed: default state is denial.
137
- Agent cannot execute without a valid, signature-verified artifact.
138
-
139
- 3. Sandbox Everything
140
- AGA: Two-process architecture. Agent and portal are separate OS processes.
141
- Agent has no credentials, no keys, no direct resource access. Phantom execution
142
- provides runtime sandboxing when drift is detected.
143
-
144
- 4. Defensive Tool Design
145
- AGA: Permitted tools sealed in artifact. Forbidden sequences explicitly defined.
146
- Rate limits per tool. Portal enforces all constraints mechanically, independent
147
- of LLM judgment. Behavioral drift detection catches tool misuse patterns.
148
-
149
- 5. Supply Chain Lockdown
150
- AGA: Content-addressable hash binding at attestation. Runtime measurement
151
- detects any component modification. Sealed hash covers all subject bytes,
152
- metadata, and policy reference. 10 measurement embodiments for comprehensive
153
- coverage.
154
-
155
- 6. Observability from Day One
156
- AGA: Signed receipt for every measurement. Tamper-evident continuity chain.
157
- Structural metadata linking enables third-party verification without payload
158
- disclosure. Merkle checkpoint anchoring. Portable offline evidence bundles.
159
- `;
160
- export const SPECIFICATION_URI = 'aga://specification';
161
- //# sourceMappingURL=specification.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"specification.js","sourceRoot":"","sources":["../../src/resources/specification.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,sBAAsB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8JrC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,qBAAqB,CAAC"}
@@ -1,25 +0,0 @@
1
- import type { ServerContext } from '../context.js';
2
- import type { SubjectMetadata } from '../core/types.js';
3
- import type { BehavioralBaseline } from '../types.js';
4
- export interface CreateArtifactArgs {
5
- subject_content?: string;
6
- subject_metadata?: SubjectMetadata;
7
- subject_bytes_hash?: string;
8
- subject_metadata_hash?: string;
9
- measurement_cadence_ms?: number;
10
- enforcement_action?: string;
11
- ttl_seconds?: number;
12
- measurement_types?: string[];
13
- evidence_items?: Array<{
14
- label: string;
15
- content: string;
16
- }>;
17
- behavioral_baseline?: BehavioralBaseline;
18
- }
19
- export declare function handleCreateArtifact(args: CreateArtifactArgs, ctx: ServerContext): Promise<{
20
- content: Array<{
21
- type: "text";
22
- text: string;
23
- }>;
24
- }>;
25
- //# sourceMappingURL=create-artifact.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-artifact.d.ts","sourceRoot":"","sources":["../../src/tools/create-artifact.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,eAAe,EAAsC,MAAM,kBAAkB,CAAC;AAC5F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEtD,MAAM,WAAW,kBAAkB;IAEjC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,eAAe,CAAC;IAEnC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAE/B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAE7B,cAAc,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC3D,mBAAmB,CAAC,EAAE,kBAAkB,CAAC;CAC1C;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,kBAAkB,EAAE,GAAG,EAAE,aAAa;;;;;GAoFtF"}
@@ -1,85 +0,0 @@
1
- import { sha256Str } from '../crypto/hash.js';
2
- import { pkToHex } from '../crypto/sign.js';
3
- import { computeSubjectIdFromString } from '../core/subject.js';
4
- import { performAttestation } from '../core/attestation.js';
5
- import { generateArtifact, hashArtifact } from '../core/artifact.js';
6
- export async function handleCreateArtifact(args, ctx) {
7
- // Determine subject identifier - support both content and hash inputs
8
- let subId;
9
- if (args.subject_bytes_hash && args.subject_metadata_hash) {
10
- subId = { bytes_hash: args.subject_bytes_hash, metadata_hash: args.subject_metadata_hash };
11
- }
12
- else if (args.subject_content) {
13
- subId = computeSubjectIdFromString(args.subject_content, args.subject_metadata ?? {});
14
- }
15
- else {
16
- return ctx.error('Provide either subject_content or subject_bytes_hash + subject_metadata_hash');
17
- }
18
- // Build enforcement parameters - merge custom with defaults
19
- const enforcement = {
20
- measurement_cadence_ms: args.measurement_cadence_ms ?? ctx.defaultEnforcement.measurement_cadence_ms,
21
- ttl_seconds: args.ttl_seconds ?? ctx.defaultEnforcement.ttl_seconds,
22
- enforcement_triggers: args.enforcement_action
23
- ? [args.enforcement_action]
24
- : ctx.defaultEnforcement.enforcement_triggers,
25
- re_attestation_required: ctx.defaultEnforcement.re_attestation_required,
26
- measurement_types: (args.measurement_types ?? ctx.defaultEnforcement.measurement_types.map(String)),
27
- };
28
- const policyRef = sha256Str(JSON.stringify(enforcement));
29
- const att = performAttestation({
30
- subject_identifier: subId,
31
- policy_reference: policyRef,
32
- evidence_items: args.evidence_items ?? [],
33
- });
34
- if (!att.success || !att.sealed_hash || !att.seal_salt) {
35
- return ctx.error(att.rejection_reason ?? 'Attestation failed');
36
- }
37
- // Track whether this is a re-attestation (after revocation)
38
- const previousArtifact = ctx.activeArtifact;
39
- const isReAttestation = previousArtifact !== null && (ctx.portal.state === 'TERMINATED' || ctx.portal.state === 'SAFE_STATE' ||
40
- ctx.portal.isRevoked(previousArtifact.sealed_hash));
41
- const artifact = generateArtifact({
42
- subject_identifier: subId,
43
- policy_reference: policyRef,
44
- policy_version: isReAttestation ? (previousArtifact.policy_version + 1) : 1,
45
- sealed_hash: att.sealed_hash,
46
- seal_salt: att.seal_salt,
47
- enforcement_parameters: enforcement,
48
- disclosure_policy: ctx.defaultClaims,
49
- evidence_commitments: att.evidence_commitments,
50
- issuer_keypair: ctx.issuerKP,
51
- });
52
- await ctx.storage.storeArtifact(artifact);
53
- ctx.portal.reset();
54
- ctx.portal.loadArtifact(artifact, pkToHex(ctx.issuerKP.publicKey));
55
- ctx.activeArtifact = artifact;
56
- ctx.quarantine = null;
57
- ctx.measurementCount = 0;
58
- ctx.behavioralMonitor.reset();
59
- if (args.behavioral_baseline)
60
- ctx.behavioralMonitor.setBaseline(args.behavioral_baseline);
61
- const eventType = isReAttestation ? 'RE_ATTESTATION' : 'POLICY_ISSUANCE';
62
- const eventPayload = {
63
- artifact_hash: hashArtifact(artifact),
64
- sealed_hash: artifact.sealed_hash,
65
- };
66
- if (isReAttestation && previousArtifact) {
67
- eventPayload.predecessor_sealed_hash = previousArtifact.sealed_hash;
68
- eventPayload.predecessor_artifact_hash = hashArtifact(previousArtifact);
69
- }
70
- await ctx.appendToChain(eventType, eventPayload);
71
- return ctx.json({
72
- success: true,
73
- artifact_hash: hashArtifact(artifact),
74
- sealed_hash: artifact.sealed_hash,
75
- subject_identifier: subId,
76
- portal_state: ctx.portal.state,
77
- issuer_public_key: pkToHex(ctx.issuerKP.publicKey),
78
- verification_tier: ctx.verificationTier,
79
- event_type: eventType,
80
- enforcement_parameters: enforcement,
81
- evidence_commitments: att.evidence_commitments,
82
- is_re_attestation: isReAttestation,
83
- });
84
- }
85
- //# sourceMappingURL=create-artifact.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-artifact.js","sourceRoot":"","sources":["../../src/tools/create-artifact.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,OAA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