@aporthq/aport-agent-guardrails 1.0.8

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 (237) hide show
  1. package/LICENSE +217 -0
  2. package/README.md +481 -0
  3. package/bin/agent-guardrails +133 -0
  4. package/bin/aport-create-passport.sh +444 -0
  5. package/bin/aport-cursor-hook.sh +90 -0
  6. package/bin/aport-guardrail-api.sh +108 -0
  7. package/bin/aport-guardrail-bash.sh +394 -0
  8. package/bin/aport-guardrail-v2.sh +5 -0
  9. package/bin/aport-guardrail.sh +5 -0
  10. package/bin/aport-resolve-paths.sh +71 -0
  11. package/bin/aport-status.sh +276 -0
  12. package/bin/frameworks/crewai.sh +49 -0
  13. package/bin/frameworks/cursor.sh +95 -0
  14. package/bin/frameworks/langchain.sh +48 -0
  15. package/bin/frameworks/n8n.sh +36 -0
  16. package/bin/frameworks/openclaw.sh +19 -0
  17. package/bin/lib/allowlist.sh +18 -0
  18. package/bin/lib/common.sh +28 -0
  19. package/bin/lib/config.sh +46 -0
  20. package/bin/lib/constants.sh +232 -0
  21. package/bin/lib/detect.sh +65 -0
  22. package/bin/lib/error.sh +269 -0
  23. package/bin/lib/passport.sh +19 -0
  24. package/bin/lib/templates/.gitkeep +1 -0
  25. package/bin/lib/templates/config.yaml +6 -0
  26. package/bin/lib/validation.sh +206 -0
  27. package/bin/openclaw +660 -0
  28. package/docs/ADDING_A_FRAMEWORK.md +87 -0
  29. package/docs/AGENTS.md.example +40 -0
  30. package/docs/CODE_REVIEW.md +192 -0
  31. package/docs/DEPLOYMENT_READINESS.md +81 -0
  32. package/docs/FAQ_SECURITY_SCANNERS.md +373 -0
  33. package/docs/FRAMEWORK_ROADMAP.md +41 -0
  34. package/docs/HOSTED_PASSPORT_SETUP.md +362 -0
  35. package/docs/IMPLEMENTING_YOUR_OWN_EVALUATOR.md +433 -0
  36. package/docs/OPENCLAW_COMPATIBILITY.md +73 -0
  37. package/docs/OPENCLAW_LOCAL_INTEGRATION.md +596 -0
  38. package/docs/OPENCLAW_TOOLS_AND_POLICIES.md +54 -0
  39. package/docs/QUICKSTART.md +470 -0
  40. package/docs/QUICKSTART_OPENCLAW_PLUGIN.md +470 -0
  41. package/docs/README.md +28 -0
  42. package/docs/RELEASE.md +87 -0
  43. package/docs/REPO_LAYOUT.md +47 -0
  44. package/docs/SKILLS_ECOSYSTEM_ANALYSIS_FEB17.md +1260 -0
  45. package/docs/TOOL_POLICY_MAPPING.md +46 -0
  46. package/docs/UPGRADE.md +46 -0
  47. package/docs/VERIFICATION_METHODS.md +97 -0
  48. package/docs/assets/README.md +8 -0
  49. package/docs/assets/porter.svg +54 -0
  50. package/docs/development/ERROR_CODES.md +616 -0
  51. package/docs/frameworks/GITHUB_ISSUE_PROPOSALS.md +1105 -0
  52. package/docs/frameworks/crewai.md +114 -0
  53. package/docs/frameworks/cursor.md +159 -0
  54. package/docs/frameworks/langchain.md +72 -0
  55. package/docs/frameworks/n8n.md +40 -0
  56. package/docs/frameworks/openclaw.md +40 -0
  57. package/docs/launch/ADD_APORT_AWESOME_LISTS_INSTRUCTIONS.md +146 -0
  58. package/docs/launch/ANNOUNCEMENT_GUIDE.md +266 -0
  59. package/docs/launch/AWESOME_REPOS.md +53 -0
  60. package/docs/launch/CURSOR_VSCODE_HOOKS_RESEARCH.md +77 -0
  61. package/docs/launch/DEMO_TERMINAL_OUTPUT.txt +48 -0
  62. package/docs/launch/DRY_AND_PLAN_CHECKLIST.md +47 -0
  63. package/docs/launch/EVIDENCE_README.md +61 -0
  64. package/docs/launch/EVIDENCE_TERMINAL_CAPTURE.txt +10 -0
  65. package/docs/launch/FRAMEWORK_SUPPORT_PLAN.md +1640 -0
  66. package/docs/launch/LAUNCH_READINESS_CHECKLIST.md +237 -0
  67. package/docs/launch/LAUNCH_STRATEGY_SUMMARY.md +464 -0
  68. package/docs/launch/OPENCLAW_FEEDBACK_AND_FIXES.md +85 -0
  69. package/docs/launch/POST_1_VALENTINE_IMPROVED.md +233 -0
  70. package/docs/launch/POST_2_GUARDRAIL_IMPROVED.md +369 -0
  71. package/docs/launch/PRE_LAUNCH_FIXES.md +766 -0
  72. package/docs/launch/QUICK_LAUNCH_CHECKLIST.md +400 -0
  73. package/docs/launch/READINESS_SUMMARY.md +262 -0
  74. package/docs/launch/README.md +68 -0
  75. package/docs/launch/USER_STORIES.md +327 -0
  76. package/docs/launch/scripts/add-aport-awesome-pr.sh +69 -0
  77. package/docs/operations/MONITORING.md +588 -0
  78. package/docs/reviews/2026-02-18-staff-review.md +268 -0
  79. package/extensions/openclaw-aport/README.md +415 -0
  80. package/extensions/openclaw-aport/index.js +625 -0
  81. package/extensions/openclaw-aport/openclaw-aport.js +7 -0
  82. package/extensions/openclaw-aport/openclaw.plugin.json +46 -0
  83. package/extensions/openclaw-aport/package.json +36 -0
  84. package/extensions/openclaw-aport/test.js +307 -0
  85. package/external/aport-policies/README.md +363 -0
  86. package/external/aport-policies/agent.session.create.v1/README.md +345 -0
  87. package/external/aport-policies/agent.session.create.v1/policy.json +162 -0
  88. package/external/aport-policies/agent.tool.register.v1/README.md +361 -0
  89. package/external/aport-policies/agent.tool.register.v1/policy.json +172 -0
  90. package/external/aport-policies/code.release.publish.v1/README.md +51 -0
  91. package/external/aport-policies/code.release.publish.v1/policy.json +121 -0
  92. package/external/aport-policies/code.repository.merge.v1/README.md +287 -0
  93. package/external/aport-policies/code.repository.merge.v1/express.example.js +332 -0
  94. package/external/aport-policies/code.repository.merge.v1/fastapi.example.py +370 -0
  95. package/external/aport-policies/code.repository.merge.v1/policy.json +162 -0
  96. package/external/aport-policies/data.export.create.v1/README.md +226 -0
  97. package/external/aport-policies/data.export.create.v1/express.example.js +172 -0
  98. package/external/aport-policies/data.export.create.v1/fastapi.example.py +165 -0
  99. package/external/aport-policies/data.export.create.v1/policy.json +133 -0
  100. package/external/aport-policies/data.report.ingest.v1/README.md +134 -0
  101. package/external/aport-policies/data.report.ingest.v1/express.example.js +105 -0
  102. package/external/aport-policies/data.report.ingest.v1/minimal-example.js +68 -0
  103. package/external/aport-policies/data.report.ingest.v1/policy.json +174 -0
  104. package/external/aport-policies/finance.crypto.trade.v1/README.md +146 -0
  105. package/external/aport-policies/finance.crypto.trade.v1/express.example.js +109 -0
  106. package/external/aport-policies/finance.crypto.trade.v1/minimal-example.js +65 -0
  107. package/external/aport-policies/finance.crypto.trade.v1/policy.json +176 -0
  108. package/external/aport-policies/finance.payment.charge.v1/README.md +326 -0
  109. package/external/aport-policies/finance.payment.charge.v1/express.example.js +250 -0
  110. package/external/aport-policies/finance.payment.charge.v1/fastapi.example.py +227 -0
  111. package/external/aport-policies/finance.payment.charge.v1/minimal-example.js +64 -0
  112. package/external/aport-policies/finance.payment.charge.v1/policy.json +224 -0
  113. package/external/aport-policies/finance.payment.charge.v1/tests/contexts.jsonl +12 -0
  114. package/external/aport-policies/finance.payment.charge.v1/tests/expected.jsonl +12 -0
  115. package/external/aport-policies/finance.payment.charge.v1/tests/passport.instance.json +42 -0
  116. package/external/aport-policies/finance.payment.charge.v1/tests/passport.template.json +40 -0
  117. package/external/aport-policies/finance.payment.charge.v1/tests/payments-charge-policy.test.js +817 -0
  118. package/external/aport-policies/finance.payment.charge.v1/tests/test_payments_charge_policy.py +486 -0
  119. package/external/aport-policies/finance.payment.payout.v1/README.md +78 -0
  120. package/external/aport-policies/finance.payment.payout.v1/policy.json +181 -0
  121. package/external/aport-policies/finance.payment.refund.v1/README.md +275 -0
  122. package/external/aport-policies/finance.payment.refund.v1/express.example.js +167 -0
  123. package/external/aport-policies/finance.payment.refund.v1/fastapi.example.py +136 -0
  124. package/external/aport-policies/finance.payment.refund.v1/minimal-example.js +183 -0
  125. package/external/aport-policies/finance.payment.refund.v1/policy.json +216 -0
  126. package/external/aport-policies/finance.payment.refund.v1/tests/refunds-policy.test.js +924 -0
  127. package/external/aport-policies/finance.payment.refund.v1/tests/test_refunds_policy.py +778 -0
  128. package/external/aport-policies/finance.transaction.execute.v1/README.md +309 -0
  129. package/external/aport-policies/finance.transaction.execute.v1/express.example.js +261 -0
  130. package/external/aport-policies/finance.transaction.execute.v1/fastapi.example.py +231 -0
  131. package/external/aport-policies/finance.transaction.execute.v1/minimal-example.js +78 -0
  132. package/external/aport-policies/finance.transaction.execute.v1/policy.json +189 -0
  133. package/external/aport-policies/finance.transaction.execute.v1/tests/contexts.jsonl +12 -0
  134. package/external/aport-policies/finance.transaction.execute.v1/tests/expected.jsonl +12 -0
  135. package/external/aport-policies/finance.transaction.execute.v1/tests/passport.instance.json +42 -0
  136. package/external/aport-policies/finance.transaction.execute.v1/tests/passport.template.json +42 -0
  137. package/external/aport-policies/finance.transaction.execute.v1/tests/test_transactions_policy.py +214 -0
  138. package/external/aport-policies/finance.transaction.execute.v1/tests/transactions-policy.test.js +306 -0
  139. package/external/aport-policies/governance.data.access.v1/README.md +292 -0
  140. package/external/aport-policies/governance.data.access.v1/express.example.js +321 -0
  141. package/external/aport-policies/governance.data.access.v1/fastapi.example.py +279 -0
  142. package/external/aport-policies/governance.data.access.v1/minimal-example.js +65 -0
  143. package/external/aport-policies/governance.data.access.v1/policy.json +208 -0
  144. package/external/aport-policies/governance.data.access.v1/tests/contexts.jsonl +12 -0
  145. package/external/aport-policies/governance.data.access.v1/tests/data-access-policy.test.js +308 -0
  146. package/external/aport-policies/governance.data.access.v1/tests/expected.jsonl +12 -0
  147. package/external/aport-policies/governance.data.access.v1/tests/passport.instance.json +56 -0
  148. package/external/aport-policies/governance.data.access.v1/tests/passport.template.json +56 -0
  149. package/external/aport-policies/governance.data.access.v1/tests/test_data_access_policy.py +214 -0
  150. package/external/aport-policies/legal.contract.review.v1/README.md +109 -0
  151. package/external/aport-policies/legal.contract.review.v1/policy.json +378 -0
  152. package/external/aport-policies/legal.contract.review.v1/tests/legal-contract-review-policy.test.js +609 -0
  153. package/external/aport-policies/legal.contract.review.v1/tests/passport.template.json +49 -0
  154. package/external/aport-policies/mcp.tool.execute.v1/README.md +301 -0
  155. package/external/aport-policies/mcp.tool.execute.v1/policy.json +141 -0
  156. package/external/aport-policies/messaging.message.send.v1/README.md +230 -0
  157. package/external/aport-policies/messaging.message.send.v1/express.example.js +183 -0
  158. package/external/aport-policies/messaging.message.send.v1/fastapi.example.py +193 -0
  159. package/external/aport-policies/messaging.message.send.v1/policy.json +144 -0
  160. package/external/aport-policies/policy-template.json +107 -0
  161. package/external/aport-policies/system.command.execute.v1/README.md +275 -0
  162. package/external/aport-policies/system.command.execute.v1/policy.json +146 -0
  163. package/external/aport-spec/CONTRIBUTING.md +273 -0
  164. package/external/aport-spec/LICENSE +21 -0
  165. package/external/aport-spec/README.md +168 -0
  166. package/external/aport-spec/conformance/README.md +294 -0
  167. package/external/aport-spec/conformance/cases/data.export.v1/contexts/allow_users.json +6 -0
  168. package/external/aport-spec/conformance/cases/data.export.v1/contexts/deny_pii.json +6 -0
  169. package/external/aport-spec/conformance/cases/data.export.v1/expected/allow_users.decision.json +19 -0
  170. package/external/aport-spec/conformance/cases/data.export.v1/expected/deny_pii.decision.json +19 -0
  171. package/external/aport-spec/conformance/cases/data.export.v1/passports/template.json +29 -0
  172. package/external/aport-spec/conformance/cases/payments.refunds.v1/contexts/allow_50usd.json +9 -0
  173. package/external/aport-spec/conformance/cases/payments.refunds.v1/contexts/deny_150usd.json +9 -0
  174. package/external/aport-spec/conformance/cases/payments.refunds.v1/contexts/deny_currency.json +9 -0
  175. package/external/aport-spec/conformance/cases/payments.refunds.v1/expected/allow_50usd.decision.json +19 -0
  176. package/external/aport-spec/conformance/cases/payments.refunds.v1/expected/deny_150usd.decision.json +19 -0
  177. package/external/aport-spec/conformance/cases/payments.refunds.v1/expected/deny_currency.decision.json +19 -0
  178. package/external/aport-spec/conformance/cases/payments.refunds.v1/passports/template.json +42 -0
  179. package/external/aport-spec/conformance/package.json +44 -0
  180. package/external/aport-spec/conformance/pnpm-lock.yaml +642 -0
  181. package/external/aport-spec/conformance/src/cases.ts +371 -0
  182. package/external/aport-spec/conformance/src/ed25519.ts +167 -0
  183. package/external/aport-spec/conformance/src/jcs.ts +85 -0
  184. package/external/aport-spec/conformance/src/runner.ts +533 -0
  185. package/external/aport-spec/conformance/src/validators.ts +185 -0
  186. package/external/aport-spec/conformance/test-runner.js +315 -0
  187. package/external/aport-spec/conformance/tsconfig.json +21 -0
  188. package/external/aport-spec/error-schema.json +192 -0
  189. package/external/aport-spec/index.json +12 -0
  190. package/external/aport-spec/integrations/clawmoat/README.md +12 -0
  191. package/external/aport-spec/integrations/shield/README.md +245 -0
  192. package/external/aport-spec/integrations/shield/adapters/index.js +116 -0
  193. package/external/aport-spec/integrations/shield/adapters/system-command-execute.js +133 -0
  194. package/external/aport-spec/integrations/shield/test/README.md +58 -0
  195. package/external/aport-spec/integrations/shield/test/shield.md +40 -0
  196. package/external/aport-spec/integrations/shield/test/test-shield-to-verify.js +274 -0
  197. package/external/aport-spec/metrics-schema.json +504 -0
  198. package/external/aport-spec/oap/CHANGELOG.md +54 -0
  199. package/external/aport-spec/oap/VERSION.md +40 -0
  200. package/external/aport-spec/oap/capability-registry.md +229 -0
  201. package/external/aport-spec/oap/conformance.md +257 -0
  202. package/external/aport-spec/oap/decision-schema.json +114 -0
  203. package/external/aport-spec/oap/examples/context.refund.usd.50.json +9 -0
  204. package/external/aport-spec/oap/examples/decision.allow.sample.json +20 -0
  205. package/external/aport-spec/oap/examples/decision.deny.sample.json +23 -0
  206. package/external/aport-spec/oap/examples/passport.instance.v1.json +50 -0
  207. package/external/aport-spec/oap/examples/passport.template.v1.json +71 -0
  208. package/external/aport-spec/oap/oap-spec.md +426 -0
  209. package/external/aport-spec/oap/passport-schema.json +396 -0
  210. package/external/aport-spec/oap/security.md +213 -0
  211. package/external/aport-spec/oap/vc/context-oap-v1.jsonld +137 -0
  212. package/external/aport-spec/oap/vc/examples/oap-decision-vc.json +37 -0
  213. package/external/aport-spec/oap/vc/examples/oap-passport-vc.json +68 -0
  214. package/external/aport-spec/oap/vc/tools/INTEGRATION.md +375 -0
  215. package/external/aport-spec/oap/vc/tools/README.md +278 -0
  216. package/external/aport-spec/oap/vc/tools/examples/decision-to-vc.js +66 -0
  217. package/external/aport-spec/oap/vc/tools/examples/passport-to-vc.js +83 -0
  218. package/external/aport-spec/oap/vc/tools/examples/vc-to-decision.js +77 -0
  219. package/external/aport-spec/oap/vc/tools/examples/vc-to-passport.js +94 -0
  220. package/external/aport-spec/oap/vc/tools/package.json +38 -0
  221. package/external/aport-spec/oap/vc/tools/pnpm-lock.yaml +472 -0
  222. package/external/aport-spec/oap/vc/tools/src/cli.ts +226 -0
  223. package/external/aport-spec/oap/vc/tools/src/crypto-utils.ts +427 -0
  224. package/external/aport-spec/oap/vc/tools/src/index.ts +653 -0
  225. package/external/aport-spec/oap/vc/tools/src/test.ts +148 -0
  226. package/external/aport-spec/oap/vc/tools/src/vp.ts +382 -0
  227. package/external/aport-spec/oap/vc/tools/test-simple.js +214 -0
  228. package/external/aport-spec/oap/vc/tools/tsconfig.json +19 -0
  229. package/external/aport-spec/oap/vc/vc-mapping.md +443 -0
  230. package/external/aport-spec/passport-schema.json +586 -0
  231. package/external/aport-spec/rate-limiting.md +136 -0
  232. package/external/aport-spec/transport-profile.md +325 -0
  233. package/external/aport-spec/webhook-spec.md +314 -0
  234. package/package.json +70 -0
  235. package/skills/aport-agent-guardrail/SKILL.md +314 -0
  236. package/src/evaluator.js +252 -0
  237. package/src/server/index.js +72 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 LiftRails Inc.
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.
@@ -0,0 +1,168 @@
1
+ # Open Agent Passport (OAP) v1.0 (**draft**)
2
+
3
+ > *The runtime trust rail for AI agents*
4
+
5
+ ---
6
+
7
+ ## The Agentic Era Demands New Standards
8
+
9
+ As AI agents become the primary interface for digital commerce, a fundamental question emerges: *How do we trust what we cannot see?*
10
+
11
+ Traditional identity verification answers *who* built an agent. But in a world where agents complete transactions in milliseconds, we need something more: **real-time enforcement of what agents are allowed to do at the point of action.**
12
+
13
+ The Open Agent Passport (OAP) v1.0 is the first specification designed for this new reality—a lightweight, cryptographically verifiable credential that enables **Pre-action authorization** for AI agents across any platform.
14
+
15
+ ---
16
+
17
+ ## Why OAP Matters
18
+
19
+ ### The Problem
20
+ - **Agentic commerce** is accelerating, but trust infrastructure hasn't kept pace
21
+ - Merchants need **instant verification** before money or data moves
22
+ - Platforms require **sub-100ms decisions** at the point of action
23
+ - Current solutions focus on *who* built the agent, not *what* it can do
24
+
25
+ ### The Solution
26
+ OAP provides the **runtime trust layer** that makes agentic commerce safe and scalable:
27
+
28
+ - **Pre-action authorization** before sensitive operations
29
+ - **Cryptographically signed decisions** for audit trails
30
+ - **Global suspend capabilities** for instant risk mitigation
31
+ - **Standardized policy packs** for consistent enforcement
32
+
33
+ ---
34
+
35
+ ## Core Specification
36
+
37
+ ### 📋 The Foundation
38
+ - **[OAP v1.0 Specification](./oap/oap-spec.md)** — Complete normative specification
39
+ - **[Passport Schema](./oap/passport-schema.json)** — Agent identity and capabilities
40
+ - **[Decision Schema](./oap/decision-schema.json)** — Authorization decisions
41
+ - **[Security Model](./oap/security.md)** — Cryptographic verification
42
+
43
+ ### 🎯 Policy Framework
44
+ - **[Capability Registry](./oap/capability-registry.md)** — Standardized capabilities and limits
45
+ - **[Conformance Requirements](./oap/conformance.md)** — Implementation standards
46
+
47
+ ### 📝 Implementation Examples
48
+ - **[Template Passport](./oap/examples/passport.template.v1.json)** — Agent template
49
+ - **[Instance Passport](./oap/examples/passport.instance.v1.json)** — Deployed agent
50
+ - **[Allow Decision](./oap/examples/decision.allow.sample.json)** — Authorization granted
51
+ - **[Deny Decision](./oap/examples/decision.deny.sample.json)** — Authorization denied
52
+
53
+ ---
54
+
55
+ ## Verifiable Credentials Integration
56
+
57
+ OAP objects integrate seamlessly with W3C Verifiable Credentials for maximum interoperability.
58
+
59
+ ### 🔐 VC Specifications
60
+ - **[JSON-LD Context](./oap/vc/context-oap-v1.jsonld)** — OAP VC context definition
61
+ - **[VC Mapping Guide](./oap/vc/vc-mapping.md)** — OAP ↔ VC conversion rules
62
+ - **[VC Examples](./oap/vc/examples/)** — Passport and Decision as VCs
63
+
64
+ ### 🛠️ Developer Tools
65
+ - **[CLI Tools](./oap/vc/tools/)** — Command-line conversion utilities
66
+ - **[SDK Integration](./oap/vc/tools/INTEGRATION.md)** — Integration guide
67
+ - **[JavaScript Examples](./oap/vc/tools/examples/)** — Usage examples
68
+
69
+ ---
70
+
71
+ ## Conformance Testing
72
+
73
+ Verify your implementation meets OAP standards with our comprehensive testing suite.
74
+
75
+ ### 🧪 Test Runner
76
+ - **[Conformance Runner](./conformance/)** — CLI tool for validation
77
+ - **[Test Cases](./conformance/cases/)** — Standard test scenarios
78
+ - **[Documentation](./conformance/README.md)** — Usage and certification
79
+
80
+ ### 📊 Coverage
81
+ - **Schema Validation** — JSON Schema compliance
82
+ - **Policy Evaluation** — Decision logic verification
83
+ - **Signature Verification** — Ed25519 cryptographic validation
84
+ - **Performance Testing** — Response time validation
85
+
86
+ ---
87
+
88
+ ## Quick Start
89
+
90
+ ### For Platform Builders
91
+ 1. **Understand the Problem** — Read [OAP v1.0 Specification](./oap/oap-spec.md)
92
+ 2. **See It in Action** — Review [examples](./oap/examples/) for implementation patterns
93
+ 3. **Validate Your Implementation** — Use [conformance runner](./conformance/) for testing
94
+ 4. **Integrate with VCs** — Follow [VC mapping guide](./oap/vc/vc-mapping.md)
95
+
96
+ ### For Developers
97
+ 1. **API Integration** — Use [OpenAPI spec](./api/openapi-generated.json) for client generation
98
+ 2. **SDK Implementation** — Follow [integration guides](./oap/vc/tools/INTEGRATION.md)
99
+ 3. **Policy Development** — Review [capability registry](./oap/capability-registry.md)
100
+
101
+ ---
102
+
103
+ ## The OAP Ecosystem
104
+
105
+ ### How It Works
106
+ 1. **Agent Registration** — Developers register agents with verified capabilities
107
+ 2. **Policy Evaluation** — Real-time authorization at the point of action
108
+ 3. **Decision Recording** — Cryptographically signed receipts for audit
109
+ 4. **Continuous Monitoring** — Ongoing verification and risk assessment
110
+
111
+ ### Key Benefits
112
+ - **Instant Trust** — Sub-100ms authorization decisions
113
+ - **Audit Trail** — Cryptographically signed decision receipts
114
+ - **Global Control** — Instant suspend capabilities across platforms
115
+ - **Standards Compliance** — Built for regulatory requirements
116
+
117
+ ---
118
+
119
+ ## Industry Adoption
120
+
121
+ OAP is designed to work with existing identity frameworks:
122
+
123
+ - **KYA (Know Your Agent)** — OAP implements KYA at runtime via policy packs
124
+ - **W3C Verifiable Credentials** — Full VC interoperability
125
+ - **Existing KYC/KYB** — Complements rather than replaces traditional verification
126
+
127
+ ---
128
+
129
+ ## Versioning & Updates
130
+
131
+ - **[Version History](./oap/VERSION.md)** — OAP specification versioning
132
+ - **[Changelog](./oap/CHANGELOG.md)** — Detailed change history
133
+
134
+
135
+
136
+ ---
137
+
138
+ ## Contributing
139
+
140
+ We welcome contributions to the OAP specification and tooling.
141
+
142
+ - **[Contributing Guide](./CONTRIBUTING.md)** — Development guidelines
143
+ - **[Main Documentation](https://aport.io/docs/)** — Detailed feature documentation
144
+ - **[Examples](./oap/examples/)** — Code examples and tutorials
145
+ - **[Policy Packs](https://aport.io/policy-packs)** — Available policy implementations
146
+
147
+ ---
148
+
149
+ ## License
150
+
151
+ All specifications are released under the MIT License. See [LICENSE](./LICENSE) for details.
152
+
153
+ ---
154
+
155
+ <div align="center">
156
+
157
+ **Open Agent Passport v1.0**
158
+ *The runtime trust rail for AI agents*
159
+
160
+ [![OAP Version](https://img.shields.io/badge/OAP-v1.0.0-blue.svg)](./oap/VERSION.md)
161
+ [![Specification Status](https://img.shields.io/badge/Status-Stable-green.svg)](./oap/oap-spec.md)
162
+ [![License](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)
163
+
164
+ </div>
165
+
166
+ ---
167
+
168
+ **Last Updated**: 2026-02-15 18:32:09 UTC
@@ -0,0 +1,294 @@
1
+ # OAP Conformance Test Runner
2
+
3
+ A CLI tool for validating **your OAP implementation** against the Open Agent Passport specification.
4
+
5
+ ## What It Does
6
+
7
+ The conformance runner validates **your OAP implementation** by:
8
+ - ✅ **Schema Validation**: Ensures your passports and decisions conform to OAP JSON schemas
9
+ - ✅ **Policy Evaluation**: Tests your policy logic with various contexts and limits
10
+ - ✅ **Signature Verification**: Validates your Ed25519 signatures over JCS-canonicalized payloads
11
+ - ✅ **API Testing**: Tests your OAP endpoints for compliance
12
+ - ✅ **Report Generation**: Produces detailed PASS/FAIL reports for certification
13
+
14
+ ## Quick Start
15
+
16
+ ### 1. Get the OAP Specification
17
+ ```bash
18
+ # Clone the OAP spec repository
19
+ git clone https://github.com/aporthq/oap-spec.git
20
+ cd oap-spec
21
+ ```
22
+
23
+ ### 2. Install Dependencies
24
+ ```bash
25
+ # Navigate to conformance directory
26
+ cd spec/conformance
27
+
28
+ # Install dependencies
29
+ pnpm install
30
+ ```
31
+
32
+ ### 3. Test Your OAP Implementation
33
+ ```bash
34
+ # Test your OAP API endpoint
35
+ pnpm test --endpoint https://your-oap-api.com
36
+
37
+ # Test with your passport file
38
+ pnpm test --passport-file /path/to/your-passport.json
39
+
40
+ # Test with your decision file
41
+ pnpm test --decision-file /path/to/your-decision.json
42
+
43
+ # Test all components
44
+ pnpm test --endpoint https://your-oap-api.com --passport-file passport.json --decision-file decision.json
45
+ ```
46
+
47
+ ### 4. Expected Output
48
+ ```bash
49
+ 🔍 OAP Conformance Test Runner v1.0.0
50
+
51
+ Testing your OAP implementation...
52
+ ✅ Passport validation: PASS
53
+ ✅ Decision validation: PASS
54
+ ✅ Policy evaluation: PASS
55
+ ✅ Signature verification: PASS
56
+ ✅ API compliance: PASS
57
+
58
+ 📊 Conformance Test Results
59
+ ✅ Passed: 5
60
+ ❌ Failed: 0
61
+ 📈 Success Rate: 100.0%
62
+
63
+ 🎯 Your implementation is OAP compliant!
64
+ ```
65
+
66
+ ## CLI Commands
67
+
68
+ ### Testing Your Implementation
69
+ ```bash
70
+ # Test your OAP API endpoint
71
+ pnpm test --endpoint https://your-oap-api.com
72
+
73
+ # Test with your passport file
74
+ pnpm test --passport-file /path/to/your-passport.json
75
+
76
+ # Test with your decision file
77
+ pnpm test --decision-file /path/to/your-decision.json
78
+
79
+ # Test all components together
80
+ pnpm test --endpoint https://your-oap-api.com --passport-file passport.json --decision-file decision.json
81
+ ```
82
+
83
+ ### Policy Pack Testing
84
+ ```bash
85
+ # Test specific policy pack against your implementation
86
+ pnpm test --endpoint https://your-oap-api.com --pack finance.payment.refund.v1
87
+
88
+ # Test with verbose output
89
+ pnpm test --endpoint https://your-oap-api.com --pack data.export.create.v1 --verbose
90
+ ```
91
+
92
+ ### Reporting
93
+ ```bash
94
+ # Generate detailed JSON report
95
+ pnpm test --endpoint https://your-oap-api.com --report
96
+
97
+ # Verbose output for debugging
98
+ pnpm test --endpoint https://your-oap-api.com --verbose
99
+ ```
100
+
101
+ ### Development
102
+ ```bash
103
+ # Watch mode for development
104
+ pnpm dev
105
+
106
+ # Build TypeScript
107
+ pnpm build
108
+
109
+ # Run simple JavaScript version (fallback)
110
+ pnpm run test:simple
111
+ ```
112
+
113
+ ## Understanding Test Results
114
+
115
+ ### What "PASS" Means
116
+ - ✅ **PASS**: Implementation correctly enforces OAP policies
117
+ - ✅ **PASS**: Valid operations are allowed
118
+ - ✅ **PASS**: Invalid operations are properly denied
119
+
120
+ ### What "FAIL" Means
121
+ - ❌ **FAIL**: Implementation incorrectly allows/denies operations
122
+ - ❌ **FAIL**: Schema validation errors
123
+ - ❌ **FAIL**: Policy logic errors
124
+
125
+ ### Example Output
126
+ ```bash
127
+ 🔍 OAP Conformance Test Runner v1.0.0
128
+
129
+ ✅ Loaded 5 test cases
130
+ Running data.export.create.v1:allow_users...
131
+ ✅ PASS
132
+ Running data.export.create.v1:deny_pii...
133
+ ❌ FAIL: Policy evaluation failed: PII export not allowed
134
+ Running finance.payment.refund.v1:allow_50usd...
135
+ ✅ PASS
136
+ Running finance.payment.refund.v1:deny_150usd...
137
+ ❌ FAIL: Policy evaluation failed: Amount 15000 exceeds max per transaction 5000
138
+ Running finance.payment.refund.v1:deny_currency...
139
+ ✅ PASS
140
+
141
+ 📊 Test Results
142
+ ✅ Passed: 3
143
+ ❌ Failed: 2
144
+ 📈 Success Rate: 60.0%
145
+
146
+ ❌ Failed Tests:
147
+ • data.export.create.v1:deny_pii
148
+ - Policy evaluation failed: PII export not allowed
149
+ • finance.payment.refund.v1:deny_150usd
150
+ - Policy evaluation failed: Amount 15000 exceeds max per transaction 5000
151
+
152
+ 🎯 Conformance testing complete!
153
+ ```
154
+
155
+ **Note**: The "failures" above are actually **correct behavior** - the system is properly denying operations that should be denied!
156
+
157
+ ## Certification Process
158
+
159
+ ### For OAP Implementers
160
+
161
+ 1. **Test Your Implementation**: Run `pnpm test --endpoint https://your-oap-api.com`
162
+ 2. **Validate All Components**: Test passports, decisions, and API endpoints
163
+ 3. **Achieve 100% Pass Rate**: All tests must pass for certification
164
+ 4. **Review Detailed Report**: Use `--report` flag for comprehensive results
165
+ 5. **Document Compliance**: Use results for OAP certification claims
166
+
167
+ ### What Gets Tested
168
+
169
+ The conformance runner tests your implementation against:
170
+
171
+ - **Passport Creation**: Does your API create valid OAP passports?
172
+ - **Decision Making**: Does your policy engine make correct allow/deny decisions?
173
+ - **Schema Compliance**: Do your JSON responses match OAP schemas?
174
+ - **Signature Generation**: Do you generate valid Ed25519 signatures?
175
+ - **Error Handling**: Do you return proper OAP error codes?
176
+ - **API Endpoints**: Do your endpoints follow OAP patterns?
177
+
178
+ ### Integration with CI/CD
179
+
180
+ ```yaml
181
+ # Example GitHub Actions workflow
182
+ name: OAP Conformance Tests
183
+ on: [push, pull_request]
184
+ jobs:
185
+ conformance:
186
+ runs-on: ubuntu-latest
187
+ steps:
188
+ - uses: actions/checkout@v3
189
+ - uses: actions/setup-node@v3
190
+ with:
191
+ node-version: '18'
192
+ - name: Install pnpm
193
+ run: npm install -g pnpm
194
+ - name: Run OAP Conformance Tests
195
+ run: |
196
+ cd spec/conformance
197
+ pnpm install
198
+ pnpm test --report
199
+ ```
200
+
201
+ ## Test Structure
202
+
203
+ ```
204
+ spec/conformance/
205
+ ├── README.md # This file
206
+ ├── package.json # Dependencies and scripts
207
+ ├── tsconfig.json # TypeScript configuration
208
+ ├── test-runner.js # Simple JavaScript fallback
209
+ ├── src/ # TypeScript source code
210
+ │ ├── runner.ts # Main test runner
211
+ │ ├── validators.ts # Schema and signature validators
212
+ │ ├── jcs.ts # JCS canonicalization
213
+ │ ├── ed25519.ts # Ed25519 signature verification
214
+ │ └── cases.ts # Test case definitions
215
+ ├── cases/ # Test cases by policy pack
216
+ │ ├── finance.payment.refund.v1/ # Refunds policy pack tests
217
+ │ │ ├── passports/ # Test passport templates
218
+ │ │ ├── contexts/ # Test contexts
219
+ │ │ └── expected/ # Expected decisions
220
+ │ ├── data.export.create.v1/ # Data export policy pack tests
221
+ │ └── repo.release.publish.v1/ # Repository release tests
222
+ └── reports/ # Generated test reports
223
+ ```
224
+
225
+ ## Test Cases
226
+
227
+ Each policy pack includes:
228
+ - `passports/` - Passport examples (template and instance)
229
+ - `contexts/` - Policy evaluation contexts
230
+ - `expected/` - Expected decision outputs
231
+ - `receipts/` - Decision receipts for signature verification
232
+
233
+ ## What Gets Tested
234
+
235
+ ### 1. Passport Validation
236
+ - Required fields present
237
+ - Correct data types
238
+ - Valid UUIDs and timestamps
239
+ - Proper assurance levels (L0-L4FIN)
240
+ - Valid capability structures
241
+
242
+ ### 2. Policy Evaluation
243
+ - **Refunds**: Amount limits, currency support, reason codes
244
+ - **Data Export**: PII restrictions, collection limits, row limits
245
+ - **Repository Release**: Branch restrictions, artifact signing
246
+
247
+ ### 3. Decision Validation
248
+ - Correct allow/deny logic
249
+ - Proper reason codes
250
+ - Valid signatures and digests
251
+ - Correct TTL handling
252
+
253
+ ### 4. Signature Verification
254
+ - Ed25519 signature format validation
255
+ - JCS canonicalization verification
256
+ - Key resolution and validation
257
+
258
+ ## Reports
259
+
260
+ Test results are saved to `reports/` with:
261
+ - `conformance-{timestamp}.json` - Complete test results
262
+ - Summary statistics and detailed per-case results
263
+ - Signature verification results
264
+
265
+ ## Troubleshooting
266
+
267
+ ### Common Issues
268
+
269
+ **"spawn /bin/zsh ENOENT"**
270
+ ```bash
271
+ # Use the simple JavaScript version
272
+ pnpm run test:simple
273
+ ```
274
+
275
+ **TypeScript compilation errors**
276
+ ```bash
277
+ # Install dependencies first
278
+ pnpm install
279
+
280
+ # Then run tests
281
+ pnpm test
282
+ ```
283
+
284
+ **Permission denied**
285
+ ```bash
286
+ # Make sure the test runner is executable
287
+ chmod +x test-runner.js
288
+ ```
289
+
290
+ ### Getting Help
291
+
292
+ - Check the [OAP Specification](../../oap/oap-spec.md) for detailed requirements
293
+ - Review test cases in the `cases/` directory
294
+ - Use `--verbose` flag for detailed debugging output
@@ -0,0 +1,6 @@
1
+ {
2
+ "collection": "users",
3
+ "estimated_rows": 50000,
4
+ "include_pii": false,
5
+ "region": "US"
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "collection": "users",
3
+ "estimated_rows": 1000,
4
+ "include_pii": true,
5
+ "region": "US"
6
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "decision_id": "550e8400-e29b-41d4-a716-446655440005",
3
+ "policy_id": "data.export.create.v1",
4
+ "agent_id": "550e8400-e29b-41d4-a716-446655440001",
5
+ "owner_id": "org_12345678",
6
+ "assurance_level": "L1",
7
+ "allow": true,
8
+ "reasons": [
9
+ {
10
+ "code": "oap.allowed",
11
+ "message": "Export within limits and policy requirements"
12
+ }
13
+ ],
14
+ "created_at": "2024-01-15T10:30:00Z",
15
+ "expires_in": 3600,
16
+ "passport_digest": "sha256:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
17
+ "signature": "ed25519:bcde2345fghi6789jklm0123nopq4567rstu9012vwxy3456zabc7890defg==",
18
+ "kid": "oap:registry:key-2025-01"
19
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "decision_id": "550e8400-e29b-41d4-a716-446655440006",
3
+ "policy_id": "data.export.create.v1",
4
+ "agent_id": "550e8400-e29b-41d4-a716-446655440001",
5
+ "owner_id": "org_12345678",
6
+ "assurance_level": "L1",
7
+ "allow": false,
8
+ "reasons": [
9
+ {
10
+ "code": "oap.pii_blocked",
11
+ "message": "PII export not allowed for this passport"
12
+ }
13
+ ],
14
+ "created_at": "2024-01-15T10:30:00Z",
15
+ "expires_in": 3600,
16
+ "passport_digest": "sha256:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
17
+ "signature": "ed25519:fghi6789jklm0123nopq4567rstu9012vwxy3456zabc7890defgbcde2345==",
18
+ "kid": "oap:registry:key-2025-01"
19
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "passport_id": "550e8400-e29b-41d4-a716-446655440001",
3
+ "kind": "template",
4
+ "spec_version": "oap/1.0",
5
+ "owner_id": "org_12345678",
6
+ "owner_type": "org",
7
+ "assurance_level": "L1",
8
+ "status": "active",
9
+ "capabilities": [
10
+ {
11
+ "id": "data.export"
12
+ }
13
+ ],
14
+ "limits": {
15
+ "data.export": {
16
+ "max_rows": 100000,
17
+ "allow_pii": false,
18
+ "allowed_collections": ["users", "orders", "products", "analytics"]
19
+ }
20
+ },
21
+ "regions": ["US", "CA", "EU"],
22
+ "metadata": {
23
+ "name": "Data Analytics AI",
24
+ "description": "AI agent for data analytics operations"
25
+ },
26
+ "created_at": "2024-01-01T00:00:00Z",
27
+ "updated_at": "2024-01-15T10:30:00Z",
28
+ "version": "1.0.0"
29
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "amount": 5000,
3
+ "currency": "USD",
4
+ "order_id": "order_123456789",
5
+ "customer_id": "cust_987654321",
6
+ "reason_code": "customer_request",
7
+ "region": "US",
8
+ "idempotency_key": "refund_20240115_001"
9
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "amount": 15000,
3
+ "currency": "USD",
4
+ "order_id": "order_123456790",
5
+ "customer_id": "cust_987654322",
6
+ "reason_code": "customer_request",
7
+ "region": "US",
8
+ "idempotency_key": "refund_20240115_002"
9
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "amount": 1000,
3
+ "currency": "JPY",
4
+ "order_id": "order_123456791",
5
+ "customer_id": "cust_987654323",
6
+ "reason_code": "customer_request",
7
+ "region": "US",
8
+ "idempotency_key": "refund_20240115_003"
9
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "decision_id": "550e8400-e29b-41d4-a716-446655440002",
3
+ "policy_id": "finance.payment.refund.v1",
4
+ "agent_id": "550e8400-e29b-41d4-a716-446655440000",
5
+ "owner_id": "org_12345678",
6
+ "assurance_level": "L2",
7
+ "allow": true,
8
+ "reasons": [
9
+ {
10
+ "code": "oap.allowed",
11
+ "message": "Transaction within limits and policy requirements"
12
+ }
13
+ ],
14
+ "created_at": "2024-01-15T10:30:00Z",
15
+ "expires_in": 3600,
16
+ "passport_digest": "sha256:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
17
+ "signature": "ed25519:abcd1234efgh5678ijkl9012mnop3456qrst7890uvwx1234yzab5678cdef==",
18
+ "kid": "oap:registry:key-2025-01"
19
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "decision_id": "550e8400-e29b-41d4-a716-446655440003",
3
+ "policy_id": "finance.payment.refund.v1",
4
+ "agent_id": "550e8400-e29b-41d4-a716-446655440000",
5
+ "owner_id": "org_12345678",
6
+ "assurance_level": "L2",
7
+ "allow": false,
8
+ "reasons": [
9
+ {
10
+ "code": "oap.limit_exceeded",
11
+ "message": "Transaction amount exceeds maximum per transaction limit"
12
+ }
13
+ ],
14
+ "created_at": "2024-01-15T10:30:00Z",
15
+ "expires_in": 3600,
16
+ "passport_digest": "sha256:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
17
+ "signature": "ed25519:efgh5678ijkl9012mnop3456qrst7890uvwx1234yzab5678cdefabcd1234==",
18
+ "kid": "oap:registry:key-2025-01"
19
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "decision_id": "550e8400-e29b-41d4-a716-446655440004",
3
+ "policy_id": "finance.payment.refund.v1",
4
+ "agent_id": "550e8400-e29b-41d4-a716-446655440000",
5
+ "owner_id": "org_12345678",
6
+ "assurance_level": "L2",
7
+ "allow": false,
8
+ "reasons": [
9
+ {
10
+ "code": "oap.currency_unsupported",
11
+ "message": "Currency JPY not supported for this passport"
12
+ }
13
+ ],
14
+ "created_at": "2024-01-15T10:30:00Z",
15
+ "expires_in": 3600,
16
+ "passport_digest": "sha256:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
17
+ "signature": "ed25519:ijkl9012mnop3456qrst7890uvwx1234yzab5678cdefabcd1234efgh5678==",
18
+ "kid": "oap:registry:key-2025-01"
19
+ }