ca2a-runtime 0.1.0a1__tar.gz

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 (140) hide show
  1. ca2a_runtime-0.1.0a1/.github/CODEOWNERS +14 -0
  2. ca2a_runtime-0.1.0a1/.github/ISSUE_TEMPLATE/bug_report.md +32 -0
  3. ca2a_runtime-0.1.0a1/.github/ISSUE_TEMPLATE/config.yml +11 -0
  4. ca2a_runtime-0.1.0a1/.github/ISSUE_TEMPLATE/feature_request.md +25 -0
  5. ca2a_runtime-0.1.0a1/.github/PULL_REQUEST_TEMPLATE.md +26 -0
  6. ca2a_runtime-0.1.0a1/.github/dependabot.yml +19 -0
  7. ca2a_runtime-0.1.0a1/.github/workflows/ci.yml +108 -0
  8. ca2a_runtime-0.1.0a1/.github/workflows/codeql.yml +43 -0
  9. ca2a_runtime-0.1.0a1/.github/workflows/contributor-check.yml +42 -0
  10. ca2a_runtime-0.1.0a1/.github/workflows/docker.yml +58 -0
  11. ca2a_runtime-0.1.0a1/.github/workflows/docs.yml +70 -0
  12. ca2a_runtime-0.1.0a1/.github/workflows/release-drafter.yml +25 -0
  13. ca2a_runtime-0.1.0a1/.github/workflows/release.yml +75 -0
  14. ca2a_runtime-0.1.0a1/.github/workflows/require-maintainer-approval.yml +84 -0
  15. ca2a_runtime-0.1.0a1/.github/workflows/sbom.yml +30 -0
  16. ca2a_runtime-0.1.0a1/.github/workflows/scorecard.yml +43 -0
  17. ca2a_runtime-0.1.0a1/.gitignore +33 -0
  18. ca2a_runtime-0.1.0a1/ADOPTERS.md +7 -0
  19. ca2a_runtime-0.1.0a1/CHANGELOG.md +47 -0
  20. ca2a_runtime-0.1.0a1/CHARTER.md +76 -0
  21. ca2a_runtime-0.1.0a1/CNAME +1 -0
  22. ca2a_runtime-0.1.0a1/CODE_OF_CONDUCT.md +17 -0
  23. ca2a_runtime-0.1.0a1/CONTRIBUTING.md +86 -0
  24. ca2a_runtime-0.1.0a1/GOVERNANCE.md +78 -0
  25. ca2a_runtime-0.1.0a1/LICENSE +21 -0
  26. ca2a_runtime-0.1.0a1/LIMITATIONS.md +25 -0
  27. ca2a_runtime-0.1.0a1/MAINTAINERS.md +38 -0
  28. ca2a_runtime-0.1.0a1/NOTICE +24 -0
  29. ca2a_runtime-0.1.0a1/PKG-INFO +178 -0
  30. ca2a_runtime-0.1.0a1/README.md +142 -0
  31. ca2a_runtime-0.1.0a1/ROADMAP.md +44 -0
  32. ca2a_runtime-0.1.0a1/SECURITY.md +39 -0
  33. ca2a_runtime-0.1.0a1/benchmarks/.gitkeep +0 -0
  34. ca2a_runtime-0.1.0a1/docs/SPEC.md +34 -0
  35. ca2a_runtime-0.1.0a1/docs/assets/icon.svg +29 -0
  36. ca2a_runtime-0.1.0a1/docs/concepts.md +40 -0
  37. ca2a_runtime-0.1.0a1/docs/configuration.md +35 -0
  38. ca2a_runtime-0.1.0a1/docs/quickstart.md +62 -0
  39. ca2a_runtime-0.1.0a1/docs/spec/attestation.md +54 -0
  40. ca2a_runtime-0.1.0a1/docs/spec/call-graph.md +109 -0
  41. ca2a_runtime-0.1.0a1/docs/spec/cedar-policy.md +98 -0
  42. ca2a_runtime-0.1.0a1/docs/spec/component-model.md +62 -0
  43. ca2a_runtime-0.1.0a1/docs/spec/conformance.md +34 -0
  44. ca2a_runtime-0.1.0a1/docs/spec/delegation-chain.md +43 -0
  45. ca2a_runtime-0.1.0a1/docs/spec/error-codes.md +55 -0
  46. ca2a_runtime-0.1.0a1/docs/spec/failure-modes.md +149 -0
  47. ca2a_runtime-0.1.0a1/docs/spec/profile.md +24 -0
  48. ca2a_runtime-0.1.0a1/docs/spec/provenance-dag.md +112 -0
  49. ca2a_runtime-0.1.0a1/docs/spec/sealed-channel.md +31 -0
  50. ca2a_runtime-0.1.0a1/docs/spec/threat-model.md +37 -0
  51. ca2a_runtime-0.1.0a1/docs/spec/trace-a2a-profile.md +28 -0
  52. ca2a_runtime-0.1.0a1/docs/spec/transport.md +71 -0
  53. ca2a_runtime-0.1.0a1/docs/spec/verification-library.md +27 -0
  54. ca2a_runtime-0.1.0a1/docs/stylesheets/extra.css +24 -0
  55. ca2a_runtime-0.1.0a1/docs/tutorials/authoring-a-delegation-credential.md +143 -0
  56. ca2a_runtime-0.1.0a1/docs/tutorials/emit-and-verify-provenance.md +203 -0
  57. ca2a_runtime-0.1.0a1/docs/tutorials/integrating-with-a2a.md +171 -0
  58. ca2a_runtime-0.1.0a1/docs/tutorials/reproducing-the-claims.md +188 -0
  59. ca2a_runtime-0.1.0a1/docs/tutorials/verify-a-delegation-chain.md +61 -0
  60. ca2a_runtime-0.1.0a1/examples/cross-operator-delegation/README.md +115 -0
  61. ca2a_runtime-0.1.0a1/examples/cross-operator-delegation/ca2a-config.yaml +13 -0
  62. ca2a_runtime-0.1.0a1/examples/cross-operator-delegation/chain.json +29 -0
  63. ca2a_runtime-0.1.0a1/examples/cross-operator-delegation/dag.json +25 -0
  64. ca2a_runtime-0.1.0a1/examples/cross-operator-delegation/demo.py +296 -0
  65. ca2a_runtime-0.1.0a1/examples/cross-operator-delegation/policy.cedar +15 -0
  66. ca2a_runtime-0.1.0a1/examples/minimal/README.md +17 -0
  67. ca2a_runtime-0.1.0a1/examples/minimal/ca2a-config.yaml +6 -0
  68. ca2a_runtime-0.1.0a1/examples/minimal/chain.json +40 -0
  69. ca2a_runtime-0.1.0a1/experiments/README.md +34 -0
  70. ca2a_runtime-0.1.0a1/experiments/claim1-attenuation-soundness/README.md +41 -0
  71. ca2a_runtime-0.1.0a1/experiments/claim1-attenuation-soundness/run.py +156 -0
  72. ca2a_runtime-0.1.0a1/experiments/claim2-cross-chain-replay/README.md +44 -0
  73. ca2a_runtime-0.1.0a1/experiments/claim2-cross-chain-replay/run.py +179 -0
  74. ca2a_runtime-0.1.0a1/experiments/claim3-scope-policy-intersection/README.md +38 -0
  75. ca2a_runtime-0.1.0a1/experiments/claim3-scope-policy-intersection/run.py +81 -0
  76. ca2a_runtime-0.1.0a1/experiments/claim4-sealed-payload-confidentiality/README.md +33 -0
  77. ca2a_runtime-0.1.0a1/experiments/claim4-sealed-payload-confidentiality/run.py +80 -0
  78. ca2a_runtime-0.1.0a1/experiments/claim5-provenance-dag-integrity/README.md +52 -0
  79. ca2a_runtime-0.1.0a1/experiments/claim5-provenance-dag-integrity/run.py +232 -0
  80. ca2a_runtime-0.1.0a1/experiments/claim6-cross-operator-attestation/README.md +34 -0
  81. ca2a_runtime-0.1.0a1/experiments/claim6-cross-operator-attestation/run.py +131 -0
  82. ca2a_runtime-0.1.0a1/governance/ca2a-enforcement.yaml +36 -0
  83. ca2a_runtime-0.1.0a1/mkdocs.yml +178 -0
  84. ca2a_runtime-0.1.0a1/pyproject.toml +96 -0
  85. ca2a_runtime-0.1.0a1/requirements-docs.txt +7 -0
  86. ca2a_runtime-0.1.0a1/scripts/gen_agt_evidence.py +102 -0
  87. ca2a_runtime-0.1.0a1/scripts/gen_example_chain.py +54 -0
  88. ca2a_runtime-0.1.0a1/src/ca2a_runtime/__init__.py +3 -0
  89. ca2a_runtime-0.1.0a1/src/ca2a_runtime/benchmarks.py +69 -0
  90. ca2a_runtime-0.1.0a1/src/ca2a_runtime/canonical.py +69 -0
  91. ca2a_runtime-0.1.0a1/src/ca2a_runtime/cedar.py +46 -0
  92. ca2a_runtime-0.1.0a1/src/ca2a_runtime/channel/__init__.py +14 -0
  93. ca2a_runtime-0.1.0a1/src/ca2a_runtime/channel/sealed.py +97 -0
  94. ca2a_runtime-0.1.0a1/src/ca2a_runtime/cli.py +144 -0
  95. ca2a_runtime-0.1.0a1/src/ca2a_runtime/config.py +73 -0
  96. ca2a_runtime-0.1.0a1/src/ca2a_runtime/delegation/__init__.py +20 -0
  97. ca2a_runtime-0.1.0a1/src/ca2a_runtime/delegation/credential.py +176 -0
  98. ca2a_runtime-0.1.0a1/src/ca2a_runtime/errors.py +83 -0
  99. ca2a_runtime-0.1.0a1/src/ca2a_runtime/peer.py +142 -0
  100. ca2a_runtime-0.1.0a1/src/ca2a_runtime/policy.py +48 -0
  101. ca2a_runtime-0.1.0a1/src/ca2a_runtime/provenance.py +115 -0
  102. ca2a_runtime-0.1.0a1/src/ca2a_runtime/tee/__init__.py +22 -0
  103. ca2a_runtime-0.1.0a1/src/ca2a_runtime/tee/base.py +36 -0
  104. ca2a_runtime-0.1.0a1/src/ca2a_runtime/tee/sev_snp.py +105 -0
  105. ca2a_runtime-0.1.0a1/src/ca2a_runtime/tee/tdx.py +133 -0
  106. ca2a_runtime-0.1.0a1/src/ca2a_runtime/tee/tpm.py +98 -0
  107. ca2a_runtime-0.1.0a1/src/ca2a_verify/__init__.py +20 -0
  108. ca2a_runtime-0.1.0a1/src/ca2a_verify/sev_snp.py +103 -0
  109. ca2a_runtime-0.1.0a1/src/ca2a_verify/tdx.py +96 -0
  110. ca2a_runtime-0.1.0a1/src/ca2a_verify/tpm.py +72 -0
  111. ca2a_runtime-0.1.0a1/src/ca2a_verify/verify.py +64 -0
  112. ca2a_runtime-0.1.0a1/tests/__init__.py +0 -0
  113. ca2a_runtime-0.1.0a1/tests/conformance/README.md +103 -0
  114. ca2a_runtime-0.1.0a1/tests/conformance/__init__.py +0 -0
  115. ca2a_runtime-0.1.0a1/tests/conformance/conftest.py +10 -0
  116. ca2a_runtime-0.1.0a1/tests/conformance/test_profile_conformance.py +406 -0
  117. ca2a_runtime-0.1.0a1/tests/fixtures/sev_snp/amd_milan_cert_chain.pem +74 -0
  118. ca2a_runtime-0.1.0a1/tests/fixtures/tdx/intel_sgx_root_ca.pem +16 -0
  119. ca2a_runtime-0.1.0a1/tests/unit/__init__.py +0 -0
  120. ca2a_runtime-0.1.0a1/tests/unit/conftest.py +94 -0
  121. ca2a_runtime-0.1.0a1/tests/unit/test_canonical.py +47 -0
  122. ca2a_runtime-0.1.0a1/tests/unit/test_cedar.py +57 -0
  123. ca2a_runtime-0.1.0a1/tests/unit/test_channel_and_tee.py +19 -0
  124. ca2a_runtime-0.1.0a1/tests/unit/test_claim1_attenuation.py +81 -0
  125. ca2a_runtime-0.1.0a1/tests/unit/test_claim2_replay.py +50 -0
  126. ca2a_runtime-0.1.0a1/tests/unit/test_claim3_scope_policy.py +52 -0
  127. ca2a_runtime-0.1.0a1/tests/unit/test_claim4_sealed.py +41 -0
  128. ca2a_runtime-0.1.0a1/tests/unit/test_claim5_provenance.py +92 -0
  129. ca2a_runtime-0.1.0a1/tests/unit/test_claim6_cross_operator.py +116 -0
  130. ca2a_runtime-0.1.0a1/tests/unit/test_config.py +59 -0
  131. ca2a_runtime-0.1.0a1/tests/unit/test_delegation.py +119 -0
  132. ca2a_runtime-0.1.0a1/tests/unit/test_errors.py +19 -0
  133. ca2a_runtime-0.1.0a1/tests/unit/test_peer.py +73 -0
  134. ca2a_runtime-0.1.0a1/tests/unit/test_peer_request.py +66 -0
  135. ca2a_runtime-0.1.0a1/tests/unit/test_provenance.py +113 -0
  136. ca2a_runtime-0.1.0a1/tests/unit/test_sealed_channel.py +60 -0
  137. ca2a_runtime-0.1.0a1/tests/unit/test_sev_snp.py +159 -0
  138. ca2a_runtime-0.1.0a1/tests/unit/test_tdx.py +149 -0
  139. ca2a_runtime-0.1.0a1/tests/unit/test_tpm.py +120 -0
  140. ca2a_runtime-0.1.0a1/tests/unit/test_verify.py +64 -0
@@ -0,0 +1,14 @@
1
+ # Default owners for all files
2
+ * @agentrust-io/maintainers
3
+
4
+ # Security-sensitive paths require security-reviewers sign-off
5
+ src/ca2a_runtime/delegation/ @agentrust-io/security-reviewers @agentrust-io/maintainers
6
+ src/ca2a_runtime/channel/ @agentrust-io/security-reviewers @agentrust-io/maintainers
7
+ src/ca2a_runtime/tee/ @agentrust-io/security-reviewers @agentrust-io/maintainers
8
+ src/ca2a_verify/ @agentrust-io/security-reviewers @agentrust-io/maintainers
9
+
10
+ # CI/CD workflow changes
11
+ .github/workflows/ @agentrust-io/maintainers
12
+
13
+ # Package configuration
14
+ pyproject.toml @agentrust-io/maintainers
@@ -0,0 +1,32 @@
1
+ ---
2
+ name: Bug report
3
+ about: Defect in runtime or verifier behavior
4
+ labels: bug
5
+ assignees: ''
6
+ ---
7
+
8
+ ## ca2a version
9
+
10
+ <!-- Output of `ca2a --version` or the git SHA if building from source -->
11
+
12
+ ## What happened
13
+
14
+ <!-- Describe the observed behavior. -->
15
+
16
+ ## What you expected
17
+
18
+ <!-- Describe the expected behavior. -->
19
+
20
+ ## Reproduction
21
+
22
+ <!-- Minimal steps, config, and delegation credential (redact secrets) needed to reproduce. -->
23
+
24
+ ## Environment
25
+
26
+ - OS:
27
+ - Python version:
28
+ - TEE provider (`auto` / `tpm` / `sev-snp` / `tdx` / `opaque` / `software-only`):
29
+
30
+ ## Security impact
31
+
32
+ <!-- Does this touch the delegation chain, sealed channel, attestation path, or TRACE record integrity? If yes, do not file here: use GitHub Security Advisories (see SECURITY.md). -->
@@ -0,0 +1,11 @@
1
+ blank_issues_enabled: false
2
+ contact_links:
3
+ - name: Security vulnerability
4
+ url: https://github.com/agentrust-io/ca2a/security/advisories/new
5
+ about: Report a security vulnerability via GitHub Security Advisories. Do not open a public issue.
6
+ - name: Design discussion
7
+ url: https://github.com/agentrust-io/ca2a/discussions
8
+ about: Start a design discussion or ask a broad question in GitHub Discussions before opening an issue.
9
+ - name: Trace spec proposal
10
+ url: https://github.com/agentrust-io/trace-spec/issues/new
11
+ about: Propose a change to the cA2A trace specification in the trace-spec repo.
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: Feature request
3
+ about: Propose a new capability
4
+ labels: enhancement
5
+ ---
6
+
7
+ ## Problem statement
8
+
9
+ <!-- Describe the problem or gap this feature addresses. Be specific about who is affected and under what conditions. -->
10
+
11
+ ## Proposed solution
12
+
13
+ <!-- Describe the capability you want added. Include enough detail for an implementer to scope the work. -->
14
+
15
+ ## Alternatives considered
16
+
17
+ <!-- List other approaches you evaluated and why you ruled them out. -->
18
+
19
+ ## Security/TEE impact
20
+
21
+ <!-- Required. Describe any impact on the TEE boundary, attestation flow, secret handling, or threat model. Write "None" if not applicable. -->
22
+
23
+ ## Spec alignment
24
+
25
+ <!-- Does this require a change to the trace spec? If yes, describe which fields or events are affected and link to the relevant spec section. If no, write "No trace-spec change required." -->
@@ -0,0 +1,26 @@
1
+ ## What
2
+
3
+ <!-- Brief description of the change. One to three sentences. -->
4
+
5
+ ## Why
6
+
7
+ <!-- Motivation and context. Link the issue this closes, e.g. Closes #123. -->
8
+
9
+ ## Security impact
10
+
11
+ <!-- Required. If this change touches TEE boundaries, message signing, audit chain integrity,
12
+ capability tokens, or trust-score inputs, describe the impact. Otherwise write "None". -->
13
+
14
+ ## Test plan
15
+
16
+ - [ ] `pytest` passes
17
+ - [ ] `ruff check` passes
18
+ - [ ] `mypy` passes
19
+ - [ ] Manual test performed (describe steps below if applicable)
20
+
21
+ <!-- Manual test steps (delete if not applicable): -->
22
+
23
+ ## DCO sign-off
24
+
25
+ - [ ] I certify that I wrote or have the right to submit this contribution, and I agree to the
26
+ Developer Certificate of Origin (https://developercertificate.org).
@@ -0,0 +1,19 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "pip"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
7
+ day: "monday"
8
+ open-pull-requests-limit: 5
9
+ ignore:
10
+ - dependency-name: "*"
11
+ update-types:
12
+ - "version-update:semver-major"
13
+
14
+ - package-ecosystem: "github-actions"
15
+ directory: "/"
16
+ schedule:
17
+ interval: "weekly"
18
+ day: "monday"
19
+ open-pull-requests-limit: 5
@@ -0,0 +1,108 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+ workflow_dispatch:
9
+ inputs:
10
+ ref:
11
+ description: "Branch or SHA to run CI on"
12
+ required: false
13
+ default: ""
14
+
15
+ jobs:
16
+ test:
17
+ runs-on: ${{ matrix.os }}
18
+ strategy:
19
+ matrix:
20
+ python-version: ["3.11", "3.12", "3.13"]
21
+ os: [ubuntu-latest, windows-latest]
22
+
23
+ steps:
24
+ - uses: actions/checkout@v7
25
+
26
+ - uses: actions/setup-python@v6
27
+ with:
28
+ python-version: ${{ matrix.python-version }}
29
+
30
+ - name: Install dependencies
31
+ run: python -m pip install --upgrade pip setuptools && pip install -e ".[dev]"
32
+
33
+ - name: Security scan
34
+ run: pip install bandit pip-audit && bandit -r src/ -c pyproject.toml && pip-audit
35
+
36
+ - name: Lint
37
+ run: ruff check src/ tests/
38
+
39
+ - name: Type check
40
+ run: mypy src/ca2a_runtime/ src/ca2a_verify/
41
+
42
+ - name: Test
43
+ run: pytest tests/unit/ tests/conformance/ -v --tb=short --cov=src --cov-report=xml
44
+
45
+ - name: Upload coverage report
46
+ uses: codecov/codecov-action@v7
47
+ with:
48
+ fail_ci_if_error: false
49
+
50
+ governance:
51
+ runs-on: ubuntu-latest
52
+ needs: test
53
+
54
+ steps:
55
+ - uses: actions/checkout@v7
56
+
57
+ - uses: actions/setup-python@v6
58
+ with:
59
+ python-version: "3.12"
60
+
61
+ - name: Install dependencies
62
+ run: python -m pip install --upgrade pip setuptools && pip install -e ".[dev]" "agent-governance-toolkit[full]>=4.1"
63
+
64
+ - name: Generate evidence file
65
+ run: python scripts/gen_agt_evidence.py
66
+
67
+ # Blocking gate: the [full] toolkit provides the ASI coverage modules
68
+ # (10/10) and the evidence declares cA2A's governed capabilities, so strict
69
+ # verify is COMPLETE. A regression that drops coverage or governance fails CI.
70
+ - name: AGT governance verify (strict)
71
+ run: agt verify --evidence agt-evidence.json
72
+
73
+ - name: Save attestation JSON
74
+ run: agt --json verify --evidence agt-evidence.json > agt-attestation.json
75
+
76
+ - name: Upload governance artifacts
77
+ uses: actions/upload-artifact@v7
78
+ with:
79
+ name: agt-governance-${{ github.sha }}
80
+ path: |
81
+ agt-evidence.json
82
+ agt-attestation.json
83
+ if-no-files-found: warn
84
+
85
+ benchmark:
86
+ runs-on: ubuntu-latest
87
+ needs: test
88
+ if: github.ref == 'refs/heads/main'
89
+
90
+ steps:
91
+ - uses: actions/checkout@v7
92
+
93
+ - uses: actions/setup-python@v6
94
+ with:
95
+ python-version: "3.12"
96
+
97
+ - name: Install dependencies
98
+ run: python -m pip install --upgrade pip setuptools && pip install -e ".[dev]"
99
+
100
+ - name: Run benchmark (software-only, CI gate p99 < 5ms)
101
+ run: python -m ca2a_runtime.benchmarks --provider software-only --hops 10000 --out benchmarks/
102
+
103
+ - name: Upload benchmark results
104
+ uses: actions/upload-artifact@v7
105
+ with:
106
+ name: benchmark-results
107
+ path: benchmarks/
108
+ if-no-files-found: warn
@@ -0,0 +1,43 @@
1
+ name: CodeQL
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ pull_request:
8
+ branches:
9
+ - main
10
+ schedule:
11
+ - cron: '15 3 * * 0'
12
+
13
+ permissions:
14
+ actions: read
15
+ contents: read
16
+ security-events: write
17
+
18
+ env:
19
+ FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
20
+
21
+ jobs:
22
+ analyze:
23
+ name: Analyze (python)
24
+ runs-on: ubuntu-latest
25
+
26
+ steps:
27
+ - name: Checkout repository
28
+ uses: actions/checkout@v7
29
+
30
+ - name: Initialize CodeQL
31
+ uses: github/codeql-action/init@v4
32
+ with:
33
+ languages: python
34
+ queries: +security-extended
35
+
36
+ - name: Autobuild
37
+ uses: github/codeql-action/autobuild@v4
38
+
39
+ - name: Perform CodeQL Analysis
40
+ uses: github/codeql-action/analyze@v4
41
+ continue-on-error: true
42
+ with:
43
+ category: /language:python
@@ -0,0 +1,42 @@
1
+ name: Contributor reputation check
2
+
3
+ on:
4
+ pull_request_target:
5
+ types: [opened]
6
+ issues:
7
+ types: [opened]
8
+ workflow_dispatch:
9
+ inputs:
10
+ username:
11
+ description: GitHub username to check
12
+ required: true
13
+
14
+ permissions:
15
+ contents: read
16
+ issues: write
17
+ pull-requests: write
18
+
19
+ jobs:
20
+ check:
21
+ runs-on: ubuntu-latest
22
+ if: |
23
+ github.actor != 'dependabot[bot]' &&
24
+ github.actor != 'github-actions[bot]' &&
25
+ github.actor != 'copilot-swe-agent[bot]' &&
26
+ github.actor != 'claude-code[bot]' &&
27
+ github.actor != 'imran-siddique'
28
+ steps:
29
+ - name: Checkout org action
30
+ uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
31
+ with:
32
+ repository: agentrust-io/.github
33
+ ref: main
34
+ persist-credentials: false
35
+ sparse-checkout: |
36
+ scripts
37
+ .github/actions/contributor-check
38
+
39
+ - name: Run contributor check
40
+ uses: ./.github/actions/contributor-check
41
+ with:
42
+ github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,58 @@
1
+ name: Docker publish
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ env:
9
+ FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
10
+
11
+ jobs:
12
+ build-and-push:
13
+ runs-on: ubuntu-latest
14
+ permissions:
15
+ contents: read
16
+ packages: write
17
+ id-token: write # keyless cosign signing + provenance attestation (OIDC)
18
+ attestations: write # actions/attest-build-provenance
19
+
20
+ steps:
21
+ - name: Checkout
22
+ uses: actions/checkout@v7
23
+
24
+ - name: Log in to GitHub Container Registry
25
+ uses: docker/login-action@v4
26
+ with:
27
+ registry: ghcr.io
28
+ username: ${{ github.actor }}
29
+ password: ${{ secrets.GITHUB_TOKEN }}
30
+
31
+ - name: Extract tag name
32
+ id: tag
33
+ run: echo "tag=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"
34
+
35
+ - name: Build and push
36
+ id: build
37
+ uses: docker/build-push-action@v7
38
+ with:
39
+ context: .
40
+ push: true
41
+ tags: |
42
+ ghcr.io/agentrust-io/ca2a-runtime:${{ steps.tag.outputs.tag }}
43
+ ghcr.io/agentrust-io/ca2a-runtime:latest
44
+
45
+ - name: Install cosign
46
+ uses: sigstore/cosign-installer@v3
47
+
48
+ - name: Sign the image (keyless, by digest)
49
+ env:
50
+ DIGEST: ${{ steps.build.outputs.digest }}
51
+ run: cosign sign --yes ghcr.io/agentrust-io/ca2a-runtime@${DIGEST}
52
+
53
+ - name: Attest build provenance (SLSA)
54
+ uses: actions/attest-build-provenance@v4
55
+ with:
56
+ subject-name: ghcr.io/agentrust-io/ca2a-runtime
57
+ subject-digest: ${{ steps.build.outputs.digest }}
58
+ push-to-registry: true
@@ -0,0 +1,70 @@
1
+ name: Docs
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ paths:
7
+ - "docs/**"
8
+ - "mkdocs.yml"
9
+ - "requirements-docs.txt"
10
+ - "README.md"
11
+ - "CHANGELOG.md"
12
+ - "CONTRIBUTING.md"
13
+ - "GOVERNANCE.md"
14
+ - "ROADMAP.md"
15
+ - "LIMITATIONS.md"
16
+ - "CNAME"
17
+ workflow_dispatch:
18
+
19
+ permissions:
20
+ contents: write
21
+
22
+ concurrency:
23
+ group: docs-deploy
24
+ cancel-in-progress: false
25
+
26
+ jobs:
27
+ deploy:
28
+ name: Build and deploy docs
29
+ runs-on: ubuntu-latest
30
+
31
+ steps:
32
+ - uses: actions/checkout@v7
33
+ with:
34
+ fetch-depth: 0
35
+
36
+ - uses: actions/setup-python@v6
37
+ with:
38
+ python-version: "3.11"
39
+ cache: pip
40
+
41
+ - name: Install docs dependencies
42
+ run: |
43
+ pip install -r requirements-docs.txt
44
+ pip install -e ".[dev]"
45
+
46
+ - name: Configure git for gh-deploy
47
+ run: |
48
+ git config user.name "github-actions[bot]"
49
+ git config user.email "github-actions[bot]@users.noreply.github.com"
50
+
51
+ - name: Assemble docs build directory
52
+ run: |
53
+ BUILD=.docs_build
54
+ mkdir -p $BUILD
55
+
56
+ if [ -d docs ]; then cp -r docs $BUILD/docs; fi
57
+
58
+ for fname in README.md CHANGELOG.md CONTRIBUTING.md GOVERNANCE.md ROADMAP.md LIMITATIONS.md CNAME; do
59
+ if [ -f "$fname" ]; then cp "$fname" "$BUILD/$fname"; fi
60
+ done
61
+
62
+ echo "Build dir contains $(find $BUILD -type f | wc -l) files"
63
+
64
+ - name: Generate build config
65
+ run: |
66
+ # Strip CR before sed so the docs_dir match is robust to CRLF line endings.
67
+ tr -d '\r' < mkdocs.yml | sed 's|^docs_dir: \.$|docs_dir: .docs_build|' > .mkdocs_build.yml
68
+
69
+ - name: Build and deploy to GitHub Pages
70
+ run: mkdocs gh-deploy --force --clean --config-file .mkdocs_build.yml
@@ -0,0 +1,25 @@
1
+ name: Release Drafter
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*.*.*"
7
+
8
+ jobs:
9
+ draft-release:
10
+ runs-on: ubuntu-latest
11
+ permissions:
12
+ contents: write
13
+ steps:
14
+ - uses: actions/checkout@v7
15
+ with:
16
+ fetch-depth: 0
17
+
18
+ - name: Create GitHub Release
19
+ env:
20
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21
+ run: |
22
+ gh release create "${{ github.ref_name }}" \
23
+ --title "ca2a ${{ github.ref_name }}" \
24
+ --generate-notes \
25
+ --draft
@@ -0,0 +1,75 @@
1
+ name: Release
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+ workflow_dispatch:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ build:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
16
+
17
+ - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
18
+ with:
19
+ python-version: "3.12"
20
+
21
+ - name: Install build
22
+ run: python -m pip install build
23
+
24
+ - name: Build distributions
25
+ run: python -m build
26
+
27
+ - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
28
+ with:
29
+ name: dist
30
+ path: dist/
31
+
32
+ publish:
33
+ needs: build
34
+ runs-on: ubuntu-latest
35
+ environment: pypi
36
+ permissions:
37
+ id-token: write # OIDC trusted publishing, no API tokens
38
+ steps:
39
+ - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
40
+ with:
41
+ name: dist
42
+ path: dist/
43
+
44
+ - uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
45
+
46
+ governance-release:
47
+ needs: publish
48
+ runs-on: ubuntu-latest
49
+ permissions:
50
+ contents: write # upload release assets
51
+
52
+ steps:
53
+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
54
+
55
+ - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
56
+ with:
57
+ python-version: "3.12"
58
+
59
+ - name: Install package and AGT
60
+ run: python -m pip install --upgrade pip && pip install -e "." "agent-governance-toolkit[full]>=4.1"
61
+
62
+ - name: Generate evidence file
63
+ run: python scripts/gen_agt_evidence.py
64
+
65
+ - name: AGT governance verify (strict)
66
+ run: agt verify --evidence agt-evidence.json
67
+
68
+ - name: Save attestation JSON
69
+ run: agt --json verify --evidence agt-evidence.json > agt-attestation.json
70
+
71
+ - name: Attach evidence to release
72
+ if: github.event_name == 'release'
73
+ run: gh release upload ${{ github.ref_name }} agt-evidence.json agt-attestation.json
74
+ env:
75
+ GITHUB_TOKEN: ${{ github.token }}
@@ -0,0 +1,84 @@
1
+ name: Require maintainer approval
2
+
3
+ on:
4
+ pull_request_target:
5
+ types: [opened, synchronize, reopened]
6
+ branches: [main]
7
+ # Re-evaluate the gate when a review is submitted or dismissed so an
8
+ # approval clears the failing status without waiting for a new push.
9
+ # Note: pull_request_review does not support a branches filter, so the
10
+ # base-branch check lives in the job-level `if` below.
11
+ pull_request_review:
12
+ types: [submitted, dismissed]
13
+
14
+ permissions:
15
+ contents: read
16
+ pull-requests: read
17
+ statuses: write
18
+
19
+ jobs:
20
+ gate:
21
+ runs-on: ubuntu-latest
22
+ if: github.event.pull_request.base.ref == 'main'
23
+ steps:
24
+ - name: Check for maintainer approval
25
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
26
+ with:
27
+ script: |
28
+ const MAINTAINERS = ['imran-siddique'];
29
+
30
+ const author = context.payload.pull_request.user.login;
31
+ if (MAINTAINERS.includes(author)) {
32
+ core.info(`Author ${author} is a maintainer, skipping gate`);
33
+ return;
34
+ }
35
+
36
+ const association = context.payload.pull_request.author_association;
37
+ if (association === 'MEMBER' || association === 'OWNER') {
38
+ core.info(`Author is ${association}, skipping gate`);
39
+ return;
40
+ }
41
+
42
+ // Both pull_request_target and pull_request_review payloads
43
+ // carry the PR at context.payload.pull_request.
44
+ const prNumber = context.payload.pull_request.number;
45
+
46
+ // Re-fetch the PR so we compare against the head SHA at
47
+ // evaluation time, not a possibly stale SHA from the payload.
48
+ const { data: pr } = await github.rest.pulls.get({
49
+ owner: context.repo.owner,
50
+ repo: context.repo.repo,
51
+ pull_number: prNumber,
52
+ });
53
+ const headSha = pr.head.sha;
54
+
55
+ // Paginate: listReviews otherwise returns only the first 30.
56
+ const reviews = await github.paginate(github.rest.pulls.listReviews, {
57
+ owner: context.repo.owner,
58
+ repo: context.repo.repo,
59
+ pull_number: prNumber,
60
+ });
61
+
62
+ // Only a maintainer's most recent non-comment review counts,
63
+ // and it must approve the current head commit. An approval of
64
+ // an older commit does not clear the gate after a later push
65
+ // (prevents approve-then-swap).
66
+ const latestByMaintainer = new Map();
67
+ for (const review of reviews) {
68
+ if (
69
+ review.user &&
70
+ review.user.type === 'User' &&
71
+ MAINTAINERS.includes(review.user.login) &&
72
+ review.state !== 'COMMENTED'
73
+ ) {
74
+ latestByMaintainer.set(review.user.login, review);
75
+ }
76
+ }
77
+
78
+ const approved = [...latestByMaintainer.values()].some(
79
+ (r) => r.state === 'APPROVED' && r.commit_id === headSha
80
+ );
81
+
82
+ if (!approved) {
83
+ core.setFailed('Waiting for maintainer approval of the current head commit before merging.');
84
+ }
@@ -0,0 +1,30 @@
1
+ name: SBOM
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ release:
7
+ types: [published]
8
+
9
+ env:
10
+ FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
11
+
12
+ permissions:
13
+ contents: write
14
+ id-token: write
15
+
16
+ jobs:
17
+ sbom:
18
+ runs-on: ubuntu-latest
19
+ steps:
20
+ - uses: actions/checkout@v7
21
+ - name: Generate SBOM
22
+ uses: anchore/sbom-action@v0
23
+ with:
24
+ format: spdx-json
25
+ output-file: sbom.spdx.json
26
+ - name: Upload SBOM artifact
27
+ uses: actions/upload-artifact@v7
28
+ with:
29
+ name: sbom
30
+ path: sbom.spdx.json