@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.
- package/LICENSE +217 -0
- package/README.md +481 -0
- package/bin/agent-guardrails +133 -0
- package/bin/aport-create-passport.sh +444 -0
- package/bin/aport-cursor-hook.sh +90 -0
- package/bin/aport-guardrail-api.sh +108 -0
- package/bin/aport-guardrail-bash.sh +394 -0
- package/bin/aport-guardrail-v2.sh +5 -0
- package/bin/aport-guardrail.sh +5 -0
- package/bin/aport-resolve-paths.sh +71 -0
- package/bin/aport-status.sh +276 -0
- package/bin/frameworks/crewai.sh +49 -0
- package/bin/frameworks/cursor.sh +95 -0
- package/bin/frameworks/langchain.sh +48 -0
- package/bin/frameworks/n8n.sh +36 -0
- package/bin/frameworks/openclaw.sh +19 -0
- package/bin/lib/allowlist.sh +18 -0
- package/bin/lib/common.sh +28 -0
- package/bin/lib/config.sh +46 -0
- package/bin/lib/constants.sh +232 -0
- package/bin/lib/detect.sh +65 -0
- package/bin/lib/error.sh +269 -0
- package/bin/lib/passport.sh +19 -0
- package/bin/lib/templates/.gitkeep +1 -0
- package/bin/lib/templates/config.yaml +6 -0
- package/bin/lib/validation.sh +206 -0
- package/bin/openclaw +660 -0
- package/docs/ADDING_A_FRAMEWORK.md +87 -0
- package/docs/AGENTS.md.example +40 -0
- package/docs/CODE_REVIEW.md +192 -0
- package/docs/DEPLOYMENT_READINESS.md +81 -0
- package/docs/FAQ_SECURITY_SCANNERS.md +373 -0
- package/docs/FRAMEWORK_ROADMAP.md +41 -0
- package/docs/HOSTED_PASSPORT_SETUP.md +362 -0
- package/docs/IMPLEMENTING_YOUR_OWN_EVALUATOR.md +433 -0
- package/docs/OPENCLAW_COMPATIBILITY.md +73 -0
- package/docs/OPENCLAW_LOCAL_INTEGRATION.md +596 -0
- package/docs/OPENCLAW_TOOLS_AND_POLICIES.md +54 -0
- package/docs/QUICKSTART.md +470 -0
- package/docs/QUICKSTART_OPENCLAW_PLUGIN.md +470 -0
- package/docs/README.md +28 -0
- package/docs/RELEASE.md +87 -0
- package/docs/REPO_LAYOUT.md +47 -0
- package/docs/SKILLS_ECOSYSTEM_ANALYSIS_FEB17.md +1260 -0
- package/docs/TOOL_POLICY_MAPPING.md +46 -0
- package/docs/UPGRADE.md +46 -0
- package/docs/VERIFICATION_METHODS.md +97 -0
- package/docs/assets/README.md +8 -0
- package/docs/assets/porter.svg +54 -0
- package/docs/development/ERROR_CODES.md +616 -0
- package/docs/frameworks/GITHUB_ISSUE_PROPOSALS.md +1105 -0
- package/docs/frameworks/crewai.md +114 -0
- package/docs/frameworks/cursor.md +159 -0
- package/docs/frameworks/langchain.md +72 -0
- package/docs/frameworks/n8n.md +40 -0
- package/docs/frameworks/openclaw.md +40 -0
- package/docs/launch/ADD_APORT_AWESOME_LISTS_INSTRUCTIONS.md +146 -0
- package/docs/launch/ANNOUNCEMENT_GUIDE.md +266 -0
- package/docs/launch/AWESOME_REPOS.md +53 -0
- package/docs/launch/CURSOR_VSCODE_HOOKS_RESEARCH.md +77 -0
- package/docs/launch/DEMO_TERMINAL_OUTPUT.txt +48 -0
- package/docs/launch/DRY_AND_PLAN_CHECKLIST.md +47 -0
- package/docs/launch/EVIDENCE_README.md +61 -0
- package/docs/launch/EVIDENCE_TERMINAL_CAPTURE.txt +10 -0
- package/docs/launch/FRAMEWORK_SUPPORT_PLAN.md +1640 -0
- package/docs/launch/LAUNCH_READINESS_CHECKLIST.md +237 -0
- package/docs/launch/LAUNCH_STRATEGY_SUMMARY.md +464 -0
- package/docs/launch/OPENCLAW_FEEDBACK_AND_FIXES.md +85 -0
- package/docs/launch/POST_1_VALENTINE_IMPROVED.md +233 -0
- package/docs/launch/POST_2_GUARDRAIL_IMPROVED.md +369 -0
- package/docs/launch/PRE_LAUNCH_FIXES.md +766 -0
- package/docs/launch/QUICK_LAUNCH_CHECKLIST.md +400 -0
- package/docs/launch/READINESS_SUMMARY.md +262 -0
- package/docs/launch/README.md +68 -0
- package/docs/launch/USER_STORIES.md +327 -0
- package/docs/launch/scripts/add-aport-awesome-pr.sh +69 -0
- package/docs/operations/MONITORING.md +588 -0
- package/docs/reviews/2026-02-18-staff-review.md +268 -0
- package/extensions/openclaw-aport/README.md +415 -0
- package/extensions/openclaw-aport/index.js +625 -0
- package/extensions/openclaw-aport/openclaw-aport.js +7 -0
- package/extensions/openclaw-aport/openclaw.plugin.json +46 -0
- package/extensions/openclaw-aport/package.json +36 -0
- package/extensions/openclaw-aport/test.js +307 -0
- package/external/aport-policies/README.md +363 -0
- package/external/aport-policies/agent.session.create.v1/README.md +345 -0
- package/external/aport-policies/agent.session.create.v1/policy.json +162 -0
- package/external/aport-policies/agent.tool.register.v1/README.md +361 -0
- package/external/aport-policies/agent.tool.register.v1/policy.json +172 -0
- package/external/aport-policies/code.release.publish.v1/README.md +51 -0
- package/external/aport-policies/code.release.publish.v1/policy.json +121 -0
- package/external/aport-policies/code.repository.merge.v1/README.md +287 -0
- package/external/aport-policies/code.repository.merge.v1/express.example.js +332 -0
- package/external/aport-policies/code.repository.merge.v1/fastapi.example.py +370 -0
- package/external/aport-policies/code.repository.merge.v1/policy.json +162 -0
- package/external/aport-policies/data.export.create.v1/README.md +226 -0
- package/external/aport-policies/data.export.create.v1/express.example.js +172 -0
- package/external/aport-policies/data.export.create.v1/fastapi.example.py +165 -0
- package/external/aport-policies/data.export.create.v1/policy.json +133 -0
- package/external/aport-policies/data.report.ingest.v1/README.md +134 -0
- package/external/aport-policies/data.report.ingest.v1/express.example.js +105 -0
- package/external/aport-policies/data.report.ingest.v1/minimal-example.js +68 -0
- package/external/aport-policies/data.report.ingest.v1/policy.json +174 -0
- package/external/aport-policies/finance.crypto.trade.v1/README.md +146 -0
- package/external/aport-policies/finance.crypto.trade.v1/express.example.js +109 -0
- package/external/aport-policies/finance.crypto.trade.v1/minimal-example.js +65 -0
- package/external/aport-policies/finance.crypto.trade.v1/policy.json +176 -0
- package/external/aport-policies/finance.payment.charge.v1/README.md +326 -0
- package/external/aport-policies/finance.payment.charge.v1/express.example.js +250 -0
- package/external/aport-policies/finance.payment.charge.v1/fastapi.example.py +227 -0
- package/external/aport-policies/finance.payment.charge.v1/minimal-example.js +64 -0
- package/external/aport-policies/finance.payment.charge.v1/policy.json +224 -0
- package/external/aport-policies/finance.payment.charge.v1/tests/contexts.jsonl +12 -0
- package/external/aport-policies/finance.payment.charge.v1/tests/expected.jsonl +12 -0
- package/external/aport-policies/finance.payment.charge.v1/tests/passport.instance.json +42 -0
- package/external/aport-policies/finance.payment.charge.v1/tests/passport.template.json +40 -0
- package/external/aport-policies/finance.payment.charge.v1/tests/payments-charge-policy.test.js +817 -0
- package/external/aport-policies/finance.payment.charge.v1/tests/test_payments_charge_policy.py +486 -0
- package/external/aport-policies/finance.payment.payout.v1/README.md +78 -0
- package/external/aport-policies/finance.payment.payout.v1/policy.json +181 -0
- package/external/aport-policies/finance.payment.refund.v1/README.md +275 -0
- package/external/aport-policies/finance.payment.refund.v1/express.example.js +167 -0
- package/external/aport-policies/finance.payment.refund.v1/fastapi.example.py +136 -0
- package/external/aport-policies/finance.payment.refund.v1/minimal-example.js +183 -0
- package/external/aport-policies/finance.payment.refund.v1/policy.json +216 -0
- package/external/aport-policies/finance.payment.refund.v1/tests/refunds-policy.test.js +924 -0
- package/external/aport-policies/finance.payment.refund.v1/tests/test_refunds_policy.py +778 -0
- package/external/aport-policies/finance.transaction.execute.v1/README.md +309 -0
- package/external/aport-policies/finance.transaction.execute.v1/express.example.js +261 -0
- package/external/aport-policies/finance.transaction.execute.v1/fastapi.example.py +231 -0
- package/external/aport-policies/finance.transaction.execute.v1/minimal-example.js +78 -0
- package/external/aport-policies/finance.transaction.execute.v1/policy.json +189 -0
- package/external/aport-policies/finance.transaction.execute.v1/tests/contexts.jsonl +12 -0
- package/external/aport-policies/finance.transaction.execute.v1/tests/expected.jsonl +12 -0
- package/external/aport-policies/finance.transaction.execute.v1/tests/passport.instance.json +42 -0
- package/external/aport-policies/finance.transaction.execute.v1/tests/passport.template.json +42 -0
- package/external/aport-policies/finance.transaction.execute.v1/tests/test_transactions_policy.py +214 -0
- package/external/aport-policies/finance.transaction.execute.v1/tests/transactions-policy.test.js +306 -0
- package/external/aport-policies/governance.data.access.v1/README.md +292 -0
- package/external/aport-policies/governance.data.access.v1/express.example.js +321 -0
- package/external/aport-policies/governance.data.access.v1/fastapi.example.py +279 -0
- package/external/aport-policies/governance.data.access.v1/minimal-example.js +65 -0
- package/external/aport-policies/governance.data.access.v1/policy.json +208 -0
- package/external/aport-policies/governance.data.access.v1/tests/contexts.jsonl +12 -0
- package/external/aport-policies/governance.data.access.v1/tests/data-access-policy.test.js +308 -0
- package/external/aport-policies/governance.data.access.v1/tests/expected.jsonl +12 -0
- package/external/aport-policies/governance.data.access.v1/tests/passport.instance.json +56 -0
- package/external/aport-policies/governance.data.access.v1/tests/passport.template.json +56 -0
- package/external/aport-policies/governance.data.access.v1/tests/test_data_access_policy.py +214 -0
- package/external/aport-policies/legal.contract.review.v1/README.md +109 -0
- package/external/aport-policies/legal.contract.review.v1/policy.json +378 -0
- package/external/aport-policies/legal.contract.review.v1/tests/legal-contract-review-policy.test.js +609 -0
- package/external/aport-policies/legal.contract.review.v1/tests/passport.template.json +49 -0
- package/external/aport-policies/mcp.tool.execute.v1/README.md +301 -0
- package/external/aport-policies/mcp.tool.execute.v1/policy.json +141 -0
- package/external/aport-policies/messaging.message.send.v1/README.md +230 -0
- package/external/aport-policies/messaging.message.send.v1/express.example.js +183 -0
- package/external/aport-policies/messaging.message.send.v1/fastapi.example.py +193 -0
- package/external/aport-policies/messaging.message.send.v1/policy.json +144 -0
- package/external/aport-policies/policy-template.json +107 -0
- package/external/aport-policies/system.command.execute.v1/README.md +275 -0
- package/external/aport-policies/system.command.execute.v1/policy.json +146 -0
- package/external/aport-spec/CONTRIBUTING.md +273 -0
- package/external/aport-spec/LICENSE +21 -0
- package/external/aport-spec/README.md +168 -0
- package/external/aport-spec/conformance/README.md +294 -0
- package/external/aport-spec/conformance/cases/data.export.v1/contexts/allow_users.json +6 -0
- package/external/aport-spec/conformance/cases/data.export.v1/contexts/deny_pii.json +6 -0
- package/external/aport-spec/conformance/cases/data.export.v1/expected/allow_users.decision.json +19 -0
- package/external/aport-spec/conformance/cases/data.export.v1/expected/deny_pii.decision.json +19 -0
- package/external/aport-spec/conformance/cases/data.export.v1/passports/template.json +29 -0
- package/external/aport-spec/conformance/cases/payments.refunds.v1/contexts/allow_50usd.json +9 -0
- package/external/aport-spec/conformance/cases/payments.refunds.v1/contexts/deny_150usd.json +9 -0
- package/external/aport-spec/conformance/cases/payments.refunds.v1/contexts/deny_currency.json +9 -0
- package/external/aport-spec/conformance/cases/payments.refunds.v1/expected/allow_50usd.decision.json +19 -0
- package/external/aport-spec/conformance/cases/payments.refunds.v1/expected/deny_150usd.decision.json +19 -0
- package/external/aport-spec/conformance/cases/payments.refunds.v1/expected/deny_currency.decision.json +19 -0
- package/external/aport-spec/conformance/cases/payments.refunds.v1/passports/template.json +42 -0
- package/external/aport-spec/conformance/package.json +44 -0
- package/external/aport-spec/conformance/pnpm-lock.yaml +642 -0
- package/external/aport-spec/conformance/src/cases.ts +371 -0
- package/external/aport-spec/conformance/src/ed25519.ts +167 -0
- package/external/aport-spec/conformance/src/jcs.ts +85 -0
- package/external/aport-spec/conformance/src/runner.ts +533 -0
- package/external/aport-spec/conformance/src/validators.ts +185 -0
- package/external/aport-spec/conformance/test-runner.js +315 -0
- package/external/aport-spec/conformance/tsconfig.json +21 -0
- package/external/aport-spec/error-schema.json +192 -0
- package/external/aport-spec/index.json +12 -0
- package/external/aport-spec/integrations/clawmoat/README.md +12 -0
- package/external/aport-spec/integrations/shield/README.md +245 -0
- package/external/aport-spec/integrations/shield/adapters/index.js +116 -0
- package/external/aport-spec/integrations/shield/adapters/system-command-execute.js +133 -0
- package/external/aport-spec/integrations/shield/test/README.md +58 -0
- package/external/aport-spec/integrations/shield/test/shield.md +40 -0
- package/external/aport-spec/integrations/shield/test/test-shield-to-verify.js +274 -0
- package/external/aport-spec/metrics-schema.json +504 -0
- package/external/aport-spec/oap/CHANGELOG.md +54 -0
- package/external/aport-spec/oap/VERSION.md +40 -0
- package/external/aport-spec/oap/capability-registry.md +229 -0
- package/external/aport-spec/oap/conformance.md +257 -0
- package/external/aport-spec/oap/decision-schema.json +114 -0
- package/external/aport-spec/oap/examples/context.refund.usd.50.json +9 -0
- package/external/aport-spec/oap/examples/decision.allow.sample.json +20 -0
- package/external/aport-spec/oap/examples/decision.deny.sample.json +23 -0
- package/external/aport-spec/oap/examples/passport.instance.v1.json +50 -0
- package/external/aport-spec/oap/examples/passport.template.v1.json +71 -0
- package/external/aport-spec/oap/oap-spec.md +426 -0
- package/external/aport-spec/oap/passport-schema.json +396 -0
- package/external/aport-spec/oap/security.md +213 -0
- package/external/aport-spec/oap/vc/context-oap-v1.jsonld +137 -0
- package/external/aport-spec/oap/vc/examples/oap-decision-vc.json +37 -0
- package/external/aport-spec/oap/vc/examples/oap-passport-vc.json +68 -0
- package/external/aport-spec/oap/vc/tools/INTEGRATION.md +375 -0
- package/external/aport-spec/oap/vc/tools/README.md +278 -0
- package/external/aport-spec/oap/vc/tools/examples/decision-to-vc.js +66 -0
- package/external/aport-spec/oap/vc/tools/examples/passport-to-vc.js +83 -0
- package/external/aport-spec/oap/vc/tools/examples/vc-to-decision.js +77 -0
- package/external/aport-spec/oap/vc/tools/examples/vc-to-passport.js +94 -0
- package/external/aport-spec/oap/vc/tools/package.json +38 -0
- package/external/aport-spec/oap/vc/tools/pnpm-lock.yaml +472 -0
- package/external/aport-spec/oap/vc/tools/src/cli.ts +226 -0
- package/external/aport-spec/oap/vc/tools/src/crypto-utils.ts +427 -0
- package/external/aport-spec/oap/vc/tools/src/index.ts +653 -0
- package/external/aport-spec/oap/vc/tools/src/test.ts +148 -0
- package/external/aport-spec/oap/vc/tools/src/vp.ts +382 -0
- package/external/aport-spec/oap/vc/tools/test-simple.js +214 -0
- package/external/aport-spec/oap/vc/tools/tsconfig.json +19 -0
- package/external/aport-spec/oap/vc/vc-mapping.md +443 -0
- package/external/aport-spec/passport-schema.json +586 -0
- package/external/aport-spec/rate-limiting.md +136 -0
- package/external/aport-spec/transport-profile.md +325 -0
- package/external/aport-spec/webhook-spec.md +314 -0
- package/package.json +70 -0
- package/skills/aport-agent-guardrail/SKILL.md +314 -0
- package/src/evaluator.js +252 -0
- package/src/server/index.js +72 -0
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$id": "https://github.com/aporthq/aport-spec/oap/passport-schema.json",
|
|
3
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
+
"title": "Open Agent Passport",
|
|
5
|
+
"description": "Schema for Open Agent Passport (OAP) v1.0 passport objects",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": [
|
|
8
|
+
"passport_id",
|
|
9
|
+
"kind",
|
|
10
|
+
"spec_version",
|
|
11
|
+
"owner_id",
|
|
12
|
+
"owner_type",
|
|
13
|
+
"status",
|
|
14
|
+
"assurance_level",
|
|
15
|
+
"capabilities",
|
|
16
|
+
"limits",
|
|
17
|
+
"regions",
|
|
18
|
+
"created_at",
|
|
19
|
+
"updated_at",
|
|
20
|
+
"version"
|
|
21
|
+
],
|
|
22
|
+
"properties": {
|
|
23
|
+
"passport_id": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"format": "uuid",
|
|
26
|
+
"description": "Unique identifier for the passport (UUID v4)",
|
|
27
|
+
"example": "550e8400-e29b-41d4-a716-446655440000"
|
|
28
|
+
},
|
|
29
|
+
"kind": {
|
|
30
|
+
"type": "string",
|
|
31
|
+
"enum": ["template", "instance"],
|
|
32
|
+
"description": "Type of passport - template (canonical identity) or instance (tenant-specific)",
|
|
33
|
+
"example": "template"
|
|
34
|
+
},
|
|
35
|
+
"spec_version": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"const": "oap/1.0",
|
|
38
|
+
"description": "OAP specification version",
|
|
39
|
+
"example": "oap/1.0"
|
|
40
|
+
},
|
|
41
|
+
"template_id": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"format": "uuid",
|
|
44
|
+
"description": "Template passport ID (required for instances)",
|
|
45
|
+
"example": "550e8400-e29b-41d4-a716-446655440001"
|
|
46
|
+
},
|
|
47
|
+
"owner_id": {
|
|
48
|
+
"type": "string",
|
|
49
|
+
"description": "Unique identifier for the owner (organization or user)",
|
|
50
|
+
"example": "org_12345678"
|
|
51
|
+
},
|
|
52
|
+
"owner_type": {
|
|
53
|
+
"type": "string",
|
|
54
|
+
"enum": ["org", "user"],
|
|
55
|
+
"description": "Type of owner (organization or user)",
|
|
56
|
+
"example": "org"
|
|
57
|
+
},
|
|
58
|
+
"assurance_level": {
|
|
59
|
+
"type": "string",
|
|
60
|
+
"enum": ["L0", "L1", "L2", "L3", "L4KYC", "L4FIN"],
|
|
61
|
+
"description": "Assurance level of the passport owner",
|
|
62
|
+
"example": "L2"
|
|
63
|
+
},
|
|
64
|
+
"status": {
|
|
65
|
+
"type": "string",
|
|
66
|
+
"enum": ["draft", "active", "suspended", "revoked"],
|
|
67
|
+
"description": "Current status of the passport",
|
|
68
|
+
"example": "active"
|
|
69
|
+
},
|
|
70
|
+
"capabilities": {
|
|
71
|
+
"type": "array",
|
|
72
|
+
"items": {
|
|
73
|
+
"type": "object",
|
|
74
|
+
"required": ["id"],
|
|
75
|
+
"properties": {
|
|
76
|
+
"id": {
|
|
77
|
+
"type": "string",
|
|
78
|
+
"pattern": "^[a-z0-9]+(\\.[a-z0-9]+)*$",
|
|
79
|
+
"description": "Capability identifier",
|
|
80
|
+
"example": "finance.payment.refund"
|
|
81
|
+
},
|
|
82
|
+
"params": {
|
|
83
|
+
"type": "object",
|
|
84
|
+
"description": "Optional parameters for the capability",
|
|
85
|
+
"additionalProperties": true,
|
|
86
|
+
"example": {
|
|
87
|
+
"max_amount": 5000,
|
|
88
|
+
"currency": "USD"
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
"description": "List of capabilities granted to the agent",
|
|
94
|
+
"example": [
|
|
95
|
+
{
|
|
96
|
+
"id": "finance.payment.refund",
|
|
97
|
+
"params": {
|
|
98
|
+
"max_amount": 5000,
|
|
99
|
+
"currency": "USD"
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"id": "data.export"
|
|
104
|
+
}
|
|
105
|
+
]
|
|
106
|
+
},
|
|
107
|
+
"limits": {
|
|
108
|
+
"type": "object",
|
|
109
|
+
"description": "Operational limits for the agent",
|
|
110
|
+
"properties": {
|
|
111
|
+
"finance.payment.refund": {
|
|
112
|
+
"type": "object",
|
|
113
|
+
"properties": {
|
|
114
|
+
"currency_limits": {
|
|
115
|
+
"type": "object",
|
|
116
|
+
"patternProperties": {
|
|
117
|
+
"^[A-Z]{3}$": {
|
|
118
|
+
"type": "object",
|
|
119
|
+
"properties": {
|
|
120
|
+
"max_per_tx": {
|
|
121
|
+
"type": "integer",
|
|
122
|
+
"minimum": 0,
|
|
123
|
+
"description": "Maximum amount per transaction in minor units"
|
|
124
|
+
},
|
|
125
|
+
"daily_cap": {
|
|
126
|
+
"type": "integer",
|
|
127
|
+
"minimum": 0,
|
|
128
|
+
"description": "Maximum daily total in minor units"
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
"reason_codes": {
|
|
135
|
+
"type": "array",
|
|
136
|
+
"items": {
|
|
137
|
+
"type": "string"
|
|
138
|
+
},
|
|
139
|
+
"description": "Allowed reason codes for refunds"
|
|
140
|
+
},
|
|
141
|
+
"idempotency_required": {
|
|
142
|
+
"type": "boolean",
|
|
143
|
+
"description": "Whether idempotency keys are required"
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
"data.export": {
|
|
148
|
+
"type": "object",
|
|
149
|
+
"properties": {
|
|
150
|
+
"max_rows": {
|
|
151
|
+
"type": "integer",
|
|
152
|
+
"minimum": 1,
|
|
153
|
+
"description": "Maximum number of rows per export"
|
|
154
|
+
},
|
|
155
|
+
"allow_pii": {
|
|
156
|
+
"type": "boolean",
|
|
157
|
+
"description": "Whether PII can be included in exports"
|
|
158
|
+
},
|
|
159
|
+
"allowed_collections": {
|
|
160
|
+
"type": "array",
|
|
161
|
+
"items": {
|
|
162
|
+
"type": "string"
|
|
163
|
+
},
|
|
164
|
+
"description": "Allowed data collections for export"
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
"messaging.send": {
|
|
169
|
+
"type": "object",
|
|
170
|
+
"properties": {
|
|
171
|
+
"msgs_per_min": {
|
|
172
|
+
"type": "integer",
|
|
173
|
+
"minimum": 1,
|
|
174
|
+
"description": "Maximum messages per minute"
|
|
175
|
+
},
|
|
176
|
+
"msgs_per_day": {
|
|
177
|
+
"type": "integer",
|
|
178
|
+
"minimum": 1,
|
|
179
|
+
"description": "Maximum messages per day"
|
|
180
|
+
},
|
|
181
|
+
"allowed_recipients": {
|
|
182
|
+
"oneOf": [
|
|
183
|
+
{
|
|
184
|
+
"type": "array",
|
|
185
|
+
"items": {
|
|
186
|
+
"type": "string"
|
|
187
|
+
},
|
|
188
|
+
"description": "Simple list of allowed recipient IDs"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"type": "array",
|
|
192
|
+
"items": {
|
|
193
|
+
"type": "object",
|
|
194
|
+
"required": ["id"],
|
|
195
|
+
"properties": {
|
|
196
|
+
"id": {
|
|
197
|
+
"type": "string",
|
|
198
|
+
"description": "Recipient identifier (username, email, account ID, etc.)"
|
|
199
|
+
},
|
|
200
|
+
"limits": {
|
|
201
|
+
"type": "object",
|
|
202
|
+
"properties": {
|
|
203
|
+
"currency": {
|
|
204
|
+
"type": "string",
|
|
205
|
+
"pattern": "^[A-Z]{3}$",
|
|
206
|
+
"description": "ISO 4217 currency code"
|
|
207
|
+
},
|
|
208
|
+
"max_amount": {
|
|
209
|
+
"type": "integer",
|
|
210
|
+
"minimum": 0,
|
|
211
|
+
"description": "Maximum amount per transaction in minor units"
|
|
212
|
+
},
|
|
213
|
+
"daily_cap": {
|
|
214
|
+
"type": "integer",
|
|
215
|
+
"minimum": 0,
|
|
216
|
+
"description": "Daily spending cap in minor units"
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
"description": "List of recipients with per-recipient limits"
|
|
223
|
+
}
|
|
224
|
+
]
|
|
225
|
+
},
|
|
226
|
+
"approval_required": {
|
|
227
|
+
"type": "boolean",
|
|
228
|
+
"description": "Whether messages require manual approval before sending"
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
"payments.payout": {
|
|
233
|
+
"type": "object",
|
|
234
|
+
"properties": {
|
|
235
|
+
"supported_currencies": {
|
|
236
|
+
"type": "array",
|
|
237
|
+
"items": {
|
|
238
|
+
"type": "string",
|
|
239
|
+
"pattern": "^[A-Z]{3}$"
|
|
240
|
+
},
|
|
241
|
+
"description": "Supported currencies for payouts"
|
|
242
|
+
},
|
|
243
|
+
"currency_limits": {
|
|
244
|
+
"type": "object",
|
|
245
|
+
"patternProperties": {
|
|
246
|
+
"^[A-Z]{3}$": {
|
|
247
|
+
"type": "object",
|
|
248
|
+
"properties": {
|
|
249
|
+
"max_per_tx": {
|
|
250
|
+
"type": "integer",
|
|
251
|
+
"minimum": 0,
|
|
252
|
+
"description": "Maximum amount per transaction in minor units"
|
|
253
|
+
},
|
|
254
|
+
"max_daily_amount": {
|
|
255
|
+
"type": "integer",
|
|
256
|
+
"minimum": 0,
|
|
257
|
+
"description": "Maximum daily total in minor units"
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
"allowed_destination_types": {
|
|
264
|
+
"type": "array",
|
|
265
|
+
"items": {
|
|
266
|
+
"type": "string"
|
|
267
|
+
},
|
|
268
|
+
"description": "Allowed destination account types"
|
|
269
|
+
},
|
|
270
|
+
"allowed_recipients": {
|
|
271
|
+
"oneOf": [
|
|
272
|
+
{
|
|
273
|
+
"type": "array",
|
|
274
|
+
"items": {
|
|
275
|
+
"type": "string"
|
|
276
|
+
},
|
|
277
|
+
"description": "Simple list of allowed recipient IDs"
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"type": "array",
|
|
281
|
+
"items": {
|
|
282
|
+
"type": "object",
|
|
283
|
+
"required": ["id"],
|
|
284
|
+
"properties": {
|
|
285
|
+
"id": {
|
|
286
|
+
"type": "string",
|
|
287
|
+
"description": "Recipient identifier"
|
|
288
|
+
},
|
|
289
|
+
"limits": {
|
|
290
|
+
"type": "object",
|
|
291
|
+
"properties": {
|
|
292
|
+
"currency": {
|
|
293
|
+
"type": "string",
|
|
294
|
+
"pattern": "^[A-Z]{3}$"
|
|
295
|
+
},
|
|
296
|
+
"max_amount": {
|
|
297
|
+
"type": "integer",
|
|
298
|
+
"minimum": 0
|
|
299
|
+
},
|
|
300
|
+
"daily_cap": {
|
|
301
|
+
"type": "integer",
|
|
302
|
+
"minimum": 0
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
]
|
|
310
|
+
},
|
|
311
|
+
"approval_required": {
|
|
312
|
+
"type": "boolean",
|
|
313
|
+
"description": "Whether payouts require manual approval"
|
|
314
|
+
},
|
|
315
|
+
"max_payouts_per_day": {
|
|
316
|
+
"type": "integer",
|
|
317
|
+
"minimum": 1,
|
|
318
|
+
"description": "Maximum number of payouts per day"
|
|
319
|
+
},
|
|
320
|
+
"compliance_checks_required": {
|
|
321
|
+
"type": "boolean",
|
|
322
|
+
"description": "Whether compliance checks are required"
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
"repo.release.publish": {
|
|
327
|
+
"type": "object",
|
|
328
|
+
"properties": {
|
|
329
|
+
"allowed_branches": {
|
|
330
|
+
"type": "array",
|
|
331
|
+
"items": {
|
|
332
|
+
"type": "string"
|
|
333
|
+
},
|
|
334
|
+
"description": "Allowed branches for releases"
|
|
335
|
+
},
|
|
336
|
+
"max_releases_per_day": {
|
|
337
|
+
"type": "integer",
|
|
338
|
+
"minimum": 1,
|
|
339
|
+
"description": "Maximum releases per day"
|
|
340
|
+
},
|
|
341
|
+
"require_signed_artifacts": {
|
|
342
|
+
"type": "boolean",
|
|
343
|
+
"description": "Whether artifacts must be signed"
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
},
|
|
348
|
+
"additionalProperties": true
|
|
349
|
+
},
|
|
350
|
+
"regions": {
|
|
351
|
+
"type": "array",
|
|
352
|
+
"items": {
|
|
353
|
+
"type": "string",
|
|
354
|
+
"pattern": "^[A-Z]{2}(-[A-Z]{2})?$"
|
|
355
|
+
},
|
|
356
|
+
"description": "Geographic regions where the agent is authorized to operate",
|
|
357
|
+
"example": ["US", "EU", "CA"]
|
|
358
|
+
},
|
|
359
|
+
"metadata": {
|
|
360
|
+
"type": "object",
|
|
361
|
+
"description": "Additional metadata for the passport",
|
|
362
|
+
"additionalProperties": true
|
|
363
|
+
},
|
|
364
|
+
"created_at": {
|
|
365
|
+
"type": "string",
|
|
366
|
+
"format": "date-time",
|
|
367
|
+
"description": "ISO 8601 timestamp of creation",
|
|
368
|
+
"example": "2024-01-01T00:00:00Z"
|
|
369
|
+
},
|
|
370
|
+
"updated_at": {
|
|
371
|
+
"type": "string",
|
|
372
|
+
"format": "date-time",
|
|
373
|
+
"description": "ISO 8601 timestamp of last update",
|
|
374
|
+
"example": "2024-01-15T10:30:00Z"
|
|
375
|
+
},
|
|
376
|
+
"version": {
|
|
377
|
+
"type": "string",
|
|
378
|
+
"pattern": "^\\d+\\.\\d+\\.\\d+$",
|
|
379
|
+
"description": "Version of the passport schema",
|
|
380
|
+
"example": "1.0.0"
|
|
381
|
+
},
|
|
382
|
+
"spec_version": {
|
|
383
|
+
"type": "string",
|
|
384
|
+
"const": "oap/1.0",
|
|
385
|
+
"description": "OAP specification version",
|
|
386
|
+
"example": "oap/1.0"
|
|
387
|
+
},
|
|
388
|
+
"parent_agent_id": {
|
|
389
|
+
"type": "string",
|
|
390
|
+
"format": "uuid",
|
|
391
|
+
"description": "Parent template passport ID (required for instances)",
|
|
392
|
+
"example": "550e8400-e29b-41d4-a716-446655440001"
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
"additionalProperties": false
|
|
396
|
+
}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
# Open Agent Passport Security Model
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
The Open Agent Passport (OAP) security model ensures the integrity, authenticity, and confidentiality of agent credentials and policy decisions through cryptographic verification and secure key management.
|
|
6
|
+
|
|
7
|
+
## Cryptographic Primitives
|
|
8
|
+
|
|
9
|
+
### Ed25519 Signatures
|
|
10
|
+
|
|
11
|
+
All OAP objects use Ed25519 for digital signatures:
|
|
12
|
+
|
|
13
|
+
- **Algorithm**: Edwards Curve Digital Signature Algorithm (EdDSA)
|
|
14
|
+
- **Curve**: Curve25519
|
|
15
|
+
- **Key Size**: 256 bits (32 bytes)
|
|
16
|
+
- **Signature Size**: 512 bits (64 bytes)
|
|
17
|
+
- **Performance**: Fast signing and verification, suitable for edge computing
|
|
18
|
+
|
|
19
|
+
### SHA-256 Hashing
|
|
20
|
+
|
|
21
|
+
Passport digests use SHA-256:
|
|
22
|
+
|
|
23
|
+
- **Algorithm**: SHA-256
|
|
24
|
+
- **Input**: JCS-canonicalized passport view
|
|
25
|
+
- **Output**: 256-bit (32-byte) hash
|
|
26
|
+
- **Format**: `sha256:<base64-encoded-hash>`
|
|
27
|
+
|
|
28
|
+
### JCS Canonicalization
|
|
29
|
+
|
|
30
|
+
All objects are canonicalized using RFC 8785 JCS before signing:
|
|
31
|
+
|
|
32
|
+
- **Standard**: RFC 8785 JSON Canonicalization Scheme
|
|
33
|
+
- **Purpose**: Deterministic JSON representation for consistent hashing
|
|
34
|
+
- **Implementation**: Must follow RFC 8785 exactly
|
|
35
|
+
|
|
36
|
+
## Key Management
|
|
37
|
+
|
|
38
|
+
### Key Types
|
|
39
|
+
|
|
40
|
+
#### Registry Keys
|
|
41
|
+
|
|
42
|
+
Registry keys are used by the OAP registry to sign decisions:
|
|
43
|
+
|
|
44
|
+
- **Format**: `oap:registry:<keyid>`
|
|
45
|
+
- **Location**: `https://api.yourdomain/.well-known/oap/keys.json`
|
|
46
|
+
- **Rotation**: Regular rotation schedule (e.g., quarterly)
|
|
47
|
+
- **Backup**: Multiple keys for high availability
|
|
48
|
+
|
|
49
|
+
#### Owner Keys
|
|
50
|
+
|
|
51
|
+
Owner keys are used by passport owners for additional verification:
|
|
52
|
+
|
|
53
|
+
- **Format**: `oap:owner:<domain>:<keyid>`
|
|
54
|
+
- **Location**: `https://<domain>/.well-known/oap/keys.json`
|
|
55
|
+
- **Optional**: Not required for basic OAP compliance
|
|
56
|
+
- **Use Case**: Additional verification layers
|
|
57
|
+
|
|
58
|
+
### Key Resolution
|
|
59
|
+
|
|
60
|
+
Keys are resolved using the following process:
|
|
61
|
+
|
|
62
|
+
1. **Parse kid**: Extract key type and identifier
|
|
63
|
+
2. **Resolve URL**: Construct key resolution URL
|
|
64
|
+
3. **Fetch key**: Retrieve public key from URL
|
|
65
|
+
4. **Validate**: Verify key format and expiration
|
|
66
|
+
5. **Cache**: Cache key for performance
|
|
67
|
+
|
|
68
|
+
#### Key Resolution URLs
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
Registry keys: https://api.yourdomain/.well-known/oap/keys.json
|
|
72
|
+
Owner keys: https://<domain>/.well-known/oap/keys.json
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
#### Key Format
|
|
76
|
+
|
|
77
|
+
```json
|
|
78
|
+
|
|
79
|
+
{
|
|
80
|
+
"keys": [
|
|
81
|
+
{
|
|
82
|
+
"kid": "oap:registry:key-2025-01",
|
|
83
|
+
"kty": "OKP",
|
|
84
|
+
"crv": "Ed25519",
|
|
85
|
+
"x": "base64url-encoded-public-key",
|
|
86
|
+
"use": "sig",
|
|
87
|
+
"alg": "EdDSA",
|
|
88
|
+
"exp": 1735689600
|
|
89
|
+
}
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Signature Verification
|
|
95
|
+
|
|
96
|
+
### Decision Verification
|
|
97
|
+
|
|
98
|
+
All decisions MUST be verified before acceptance:
|
|
99
|
+
|
|
100
|
+
1. **Parse signature**: Extract Ed25519 signature from `signature` field
|
|
101
|
+
2. **Resolve key**: Use `kid` to fetch public key
|
|
102
|
+
3. **Canonicalize**: Apply JCS canonicalization to decision payload
|
|
103
|
+
4. **Verify signature**: Use Ed25519 to verify signature
|
|
104
|
+
5. **Check expiration**: Ensure `expires_at` is in the future
|
|
105
|
+
6. **Validate digest**: Verify `passport_digest` matches evaluated passport
|
|
106
|
+
|
|
107
|
+
### Passport Verification
|
|
108
|
+
|
|
109
|
+
Passport integrity is verified through digests:
|
|
110
|
+
|
|
111
|
+
1. **Canonicalize passport**: Apply JCS canonicalization
|
|
112
|
+
2. **Compute digest**: SHA-256 of canonicalized passport
|
|
113
|
+
3. **Compare**: Ensure computed digest matches `passport_digest`
|
|
114
|
+
|
|
115
|
+
## Security Properties
|
|
116
|
+
|
|
117
|
+
### Integrity
|
|
118
|
+
|
|
119
|
+
- **Passport integrity**: SHA-256 digest ensures passport hasn't been tampered with
|
|
120
|
+
- **Decision integrity**: Ed25519 signature ensures decision hasn't been modified
|
|
121
|
+
- **Canonicalization**: JCS ensures consistent representation across implementations
|
|
122
|
+
|
|
123
|
+
### Authenticity
|
|
124
|
+
|
|
125
|
+
- **Decision authenticity**: Ed25519 signature proves decision came from registry
|
|
126
|
+
- **Key authenticity**: HTTPS and certificate validation for key resolution
|
|
127
|
+
- **Passport authenticity**: Registry signature on active passports
|
|
128
|
+
|
|
129
|
+
### Non-repudiation
|
|
130
|
+
|
|
131
|
+
- **Decision non-repudiation**: Ed25519 signature provides cryptographic proof
|
|
132
|
+
- **Audit trail**: All decisions are logged with signatures
|
|
133
|
+
- **Key rotation**: Old keys remain valid for historical verification
|
|
134
|
+
|
|
135
|
+
## Threat Model
|
|
136
|
+
|
|
137
|
+
### Threats Addressed
|
|
138
|
+
|
|
139
|
+
1. **Passport tampering**: Prevented by SHA-256 digests
|
|
140
|
+
2. **Decision forgery**: Prevented by Ed25519 signatures
|
|
141
|
+
3. **Replay attacks**: Prevented by expiration times and idempotency keys
|
|
142
|
+
4. **Key compromise**: Mitigated by key rotation and revocation
|
|
143
|
+
5. **Man-in-the-middle**: Prevented by HTTPS and certificate validation
|
|
144
|
+
|
|
145
|
+
### Threats Not Addressed
|
|
146
|
+
|
|
147
|
+
1. **Key theft**: Physical security of private keys
|
|
148
|
+
2. **Insider attacks**: Malicious registry operators
|
|
149
|
+
3. **Side-channel attacks**: Implementation-specific vulnerabilities
|
|
150
|
+
4. **Quantum attacks**: Future quantum computing threats
|
|
151
|
+
|
|
152
|
+
## Security Best Practices
|
|
153
|
+
|
|
154
|
+
### For Implementers
|
|
155
|
+
|
|
156
|
+
1. **Use secure random**: Generate UUIDs and keys with cryptographically secure random
|
|
157
|
+
2. **Validate inputs**: Strictly validate all input data
|
|
158
|
+
3. **Check expiration**: Always verify decision expiration times
|
|
159
|
+
4. **Cache securely**: Store decisions securely with proper access controls
|
|
160
|
+
5. **Rotate keys**: Implement regular key rotation schedule
|
|
161
|
+
6. **Monitor logs**: Monitor for suspicious activity and key usage
|
|
162
|
+
|
|
163
|
+
### For Deployers
|
|
164
|
+
|
|
165
|
+
1. **HTTPS only**: Use HTTPS for all key resolution and API calls
|
|
166
|
+
2. **Certificate validation**: Validate TLS certificates properly
|
|
167
|
+
3. **Key storage**: Store private keys securely (HSM recommended)
|
|
168
|
+
4. **Access controls**: Implement proper access controls for key management
|
|
169
|
+
5. **Monitoring**: Monitor key usage and decision patterns
|
|
170
|
+
6. **Incident response**: Have procedures for key compromise
|
|
171
|
+
|
|
172
|
+
## Suspend Semantics
|
|
173
|
+
|
|
174
|
+
### Global Invalidation
|
|
175
|
+
|
|
176
|
+
When a passport is suspended or revoked:
|
|
177
|
+
|
|
178
|
+
1. **Immediate effect**: Status change takes effect immediately
|
|
179
|
+
2. **Cache invalidation**: All caches MUST be purged within 30 seconds
|
|
180
|
+
3. **Decision invalidation**: All cached decisions become invalid
|
|
181
|
+
4. **Notification**: Relying parties SHOULD be notified via webhooks
|
|
182
|
+
|
|
183
|
+
### Implementation Requirements
|
|
184
|
+
|
|
185
|
+
- **Registry**: Must invalidate all cached decisions within 30 seconds
|
|
186
|
+
- **Relying parties**: Must treat cached decisions as invalid after suspend
|
|
187
|
+
- **Monitoring**: Must detect and alert on suspend/revoke events
|
|
188
|
+
- **Recovery**: Must support passport reactivation with new decisions
|
|
189
|
+
|
|
190
|
+
## Compliance
|
|
191
|
+
|
|
192
|
+
### Security Standards
|
|
193
|
+
|
|
194
|
+
OAP implementations should comply with:
|
|
195
|
+
|
|
196
|
+
- **FIPS 140-2**: For cryptographic modules (if applicable)
|
|
197
|
+
- **Common Criteria**: For high-assurance implementations
|
|
198
|
+
- **SOC 2**: For service providers
|
|
199
|
+
- **ISO 27001**: For information security management
|
|
200
|
+
|
|
201
|
+
### Audit Requirements
|
|
202
|
+
|
|
203
|
+
- **Key usage**: Log all key usage and signature operations
|
|
204
|
+
- **Decision audit**: Log all policy decisions with full context
|
|
205
|
+
- **Access audit**: Log all administrative access to keys and passports
|
|
206
|
+
- **Retention**: Retain audit logs for required period (e.g., 7 years)
|
|
207
|
+
|
|
208
|
+
## References
|
|
209
|
+
|
|
210
|
+
- [RFC 8032: Edwards-Curve Digital Signature Algorithm (EdDSA)](https://tools.ietf.org/html/rfc8032)
|
|
211
|
+
- [RFC 8785: JSON Canonicalization Scheme (JCS)](https://tools.ietf.org/html/rfc8785)
|
|
212
|
+
- [NIST SP 800-57: Key Management Guidelines](https://csrc.nist.gov/publications/detail/sp/800-57-part-1/rev-5/final)
|
|
213
|
+
- [OWASP Cryptographic Storage Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Cryptographic_Storage_Cheat_Sheet.html)
|