scpe-protocol 0.1.2__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 (79) hide show
  1. scpe_protocol-0.1.2/LICENSE +202 -0
  2. scpe_protocol-0.1.2/LICENSE-SPEC +10 -0
  3. scpe_protocol-0.1.2/PKG-INFO +221 -0
  4. scpe_protocol-0.1.2/README.md +190 -0
  5. scpe_protocol-0.1.2/pyproject.toml +42 -0
  6. scpe_protocol-0.1.2/reference/__init__.py +10 -0
  7. scpe_protocol-0.1.2/reference/disclosure.py +144 -0
  8. scpe_protocol-0.1.2/reference/level1_lint.py +97 -0
  9. scpe_protocol-0.1.2/reference/producer.py +647 -0
  10. scpe_protocol-0.1.2/reference/standalone/__init__.py +6 -0
  11. scpe_protocol-0.1.2/reference/standalone/verify_envelope.py +470 -0
  12. scpe_protocol-0.1.2/scpe/__init__.py +2 -0
  13. scpe_protocol-0.1.2/scpe/analyze.py +67 -0
  14. scpe_protocol-0.1.2/scpe/attestation.py +361 -0
  15. scpe_protocol-0.1.2/scpe/backends.py +93 -0
  16. scpe_protocol-0.1.2/scpe/changes.py +90 -0
  17. scpe_protocol-0.1.2/scpe/checks.py +96 -0
  18. scpe_protocol-0.1.2/scpe/cli.py +1020 -0
  19. scpe_protocol-0.1.2/scpe/contribute.py +142 -0
  20. scpe_protocol-0.1.2/scpe/envelope.py +211 -0
  21. scpe_protocol-0.1.2/scpe/handshake.py +229 -0
  22. scpe_protocol-0.1.2/scpe/identity.py +245 -0
  23. scpe_protocol-0.1.2/scpe/inspect.py +73 -0
  24. scpe_protocol-0.1.2/scpe/label.py +153 -0
  25. scpe_protocol-0.1.2/scpe/mcp_server.py +334 -0
  26. scpe_protocol-0.1.2/scpe/optin.py +79 -0
  27. scpe_protocol-0.1.2/scpe/prompting.py +33 -0
  28. scpe_protocol-0.1.2/scpe/repo_snapshot.py +74 -0
  29. scpe_protocol-0.1.2/scpe/sandbox.py +196 -0
  30. scpe_protocol-0.1.2/scpe/scrub.py +48 -0
  31. scpe_protocol-0.1.2/scpe/seal.py +117 -0
  32. scpe_protocol-0.1.2/scpe/signing.py +55 -0
  33. scpe_protocol-0.1.2/scpe/workspace.py +189 -0
  34. scpe_protocol-0.1.2/scpe_protocol.egg-info/PKG-INFO +221 -0
  35. scpe_protocol-0.1.2/scpe_protocol.egg-info/SOURCES.txt +77 -0
  36. scpe_protocol-0.1.2/scpe_protocol.egg-info/dependency_links.txt +1 -0
  37. scpe_protocol-0.1.2/scpe_protocol.egg-info/entry_points.txt +4 -0
  38. scpe_protocol-0.1.2/scpe_protocol.egg-info/requires.txt +8 -0
  39. scpe_protocol-0.1.2/scpe_protocol.egg-info/top_level.txt +2 -0
  40. scpe_protocol-0.1.2/setup.cfg +4 -0
  41. scpe_protocol-0.1.2/tests/test_action_yaml.py +429 -0
  42. scpe_protocol-0.1.2/tests/test_analyze.py +76 -0
  43. scpe_protocol-0.1.2/tests/test_attestation.py +336 -0
  44. scpe_protocol-0.1.2/tests/test_backends.py +55 -0
  45. scpe_protocol-0.1.2/tests/test_checks.py +137 -0
  46. scpe_protocol-0.1.2/tests/test_cli.py +266 -0
  47. scpe_protocol-0.1.2/tests/test_cli_attest.py +230 -0
  48. scpe_protocol-0.1.2/tests/test_cli_commands.py +209 -0
  49. scpe_protocol-0.1.2/tests/test_cli_seal.py +133 -0
  50. scpe_protocol-0.1.2/tests/test_cli_submit.py +102 -0
  51. scpe_protocol-0.1.2/tests/test_contribute.py +61 -0
  52. scpe_protocol-0.1.2/tests/test_differential_verifiers.py +319 -0
  53. scpe_protocol-0.1.2/tests/test_disclosure.py +204 -0
  54. scpe_protocol-0.1.2/tests/test_e2e_local.py +243 -0
  55. scpe_protocol-0.1.2/tests/test_e2e_mock.py +57 -0
  56. scpe_protocol-0.1.2/tests/test_envelope.py +171 -0
  57. scpe_protocol-0.1.2/tests/test_envelope_identity.py +82 -0
  58. scpe_protocol-0.1.2/tests/test_handshake.py +254 -0
  59. scpe_protocol-0.1.2/tests/test_identity.py +115 -0
  60. scpe_protocol-0.1.2/tests/test_inspect.py +75 -0
  61. scpe_protocol-0.1.2/tests/test_label.py +55 -0
  62. scpe_protocol-0.1.2/tests/test_level1_lint.py +133 -0
  63. scpe_protocol-0.1.2/tests/test_mcp.py +327 -0
  64. scpe_protocol-0.1.2/tests/test_optin.py +69 -0
  65. scpe_protocol-0.1.2/tests/test_producer_cli.py +181 -0
  66. scpe_protocol-0.1.2/tests/test_producer_roundtrip.py +149 -0
  67. scpe_protocol-0.1.2/tests/test_producer_submit.py +108 -0
  68. scpe_protocol-0.1.2/tests/test_profiles_demo.py +223 -0
  69. scpe_protocol-0.1.2/tests/test_prompting.py +179 -0
  70. scpe_protocol-0.1.2/tests/test_repo_snapshot.py +68 -0
  71. scpe_protocol-0.1.2/tests/test_sandbox.py +121 -0
  72. scpe_protocol-0.1.2/tests/test_scrub.py +82 -0
  73. scpe_protocol-0.1.2/tests/test_seal.py +109 -0
  74. scpe_protocol-0.1.2/tests/test_signing.py +25 -0
  75. scpe_protocol-0.1.2/tests/test_spec_vectors.py +54 -0
  76. scpe_protocol-0.1.2/tests/test_ssrf_fetch.py +327 -0
  77. scpe_protocol-0.1.2/tests/test_stress_100prs.py +705 -0
  78. scpe_protocol-0.1.2/tests/test_verify_identity.py +44 -0
  79. scpe_protocol-0.1.2/tests/test_workspace.py +102 -0
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,10 @@
1
+ The SCPE specification (everything under /spec) is licensed under the
2
+ Creative Commons Attribution 4.0 International License (CC BY 4.0).
3
+
4
+ You are free to share and adapt the specification for any purpose, including
5
+ commercially, as long as you give appropriate credit.
6
+
7
+ Full legal text: https://creativecommons.org/licenses/by/4.0/legalcode
8
+
9
+ All code in this repository (everything outside /spec) is licensed under the
10
+ Apache License 2.0 — see the LICENSE file.
@@ -0,0 +1,221 @@
1
+ Metadata-Version: 2.4
2
+ Name: scpe-protocol
3
+ Version: 0.1.2
4
+ Summary: SCPE: an open protocol for verifiable provenance of any digital artifact — who produced a contribution or file, and that it wasn't tampered with, verified offline with no server and no new accounts. Reference implementation + CLI (the console command is `scpe`).
5
+ Author: Augusto Bastos
6
+ License: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/augbastos/scpe
8
+ Project-URL: Repository, https://github.com/augbastos/scpe
9
+ Project-URL: Documentation, https://github.com/augbastos/scpe/blob/main/spec/SPEC.md
10
+ Keywords: github,contributions,open-source,supply-chain,provenance,attestation,in-toto,dsse,code-signing,ssh,verification
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: Apache Software License
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Topic :: Software Development :: Version Control :: Git
17
+ Classifier: Topic :: Security
18
+ Classifier: Topic :: Security :: Cryptography
19
+ Classifier: Environment :: Console
20
+ Requires-Python: >=3.11
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ License-File: LICENSE-SPEC
24
+ Requires-Dist: cryptography>=42
25
+ Provides-Extra: dev
26
+ Requires-Dist: pytest>=8; extra == "dev"
27
+ Requires-Dist: pyyaml>=6; extra == "dev"
28
+ Provides-Extra: mcp
29
+ Requires-Dist: mcp>=1.2; extra == "mcp"
30
+ Dynamic: license-file
31
+
32
+ <p align="center">
33
+ <img src="docs/assets/scpe-logo.svg" alt="SCPE" width="104" height="104">
34
+ </p>
35
+
36
+ <h1 align="center">SCPE</h1>
37
+
38
+ <p align="center">
39
+ <b>A protocol for verifiable digital artifacts.</b><br>
40
+ A single envelope. Multiple specifications.<br>
41
+ <i>Merge code, not claims.</i>
42
+ </p>
43
+
44
+ <p align="center">
45
+ <img alt="tests" src="https://img.shields.io/badge/tests-441_passing-41c257?style=flat-square&labelColor=0b0b0c">
46
+ <img alt="3 impls" src="https://img.shields.io/badge/verifiers-python%20%2B%20go%20%2B%20rust-41c257?style=flat-square&labelColor=0b0b0c">
47
+ <img alt="spec" src="https://img.shields.io/badge/spec-scpe%2F0.1-41c257?style=flat-square&labelColor=0b0b0c">
48
+ <img alt="python" src="https://img.shields.io/badge/python-3.10%2B-41c257?style=flat-square&labelColor=0b0b0c">
49
+ <img alt="license" src="https://img.shields.io/badge/code-Apache--2.0-41c257?style=flat-square&labelColor=0b0b0c">
50
+ <img alt="status" src="https://img.shields.io/badge/v0.1-early-d29922?style=flat-square&labelColor=0b0b0c">
51
+ </p>
52
+
53
+ An open protocol that lets a repository owner verify — with no SCPE server and no new
54
+ accounts — *who* made a pull request and that *nothing was tampered with*, then turn on a
55
+ policy that only merges contributions they can verify. There is no SCPE server, ever: the
56
+ default forge path makes exactly one HTTPS GET, to the contributor's git host, for keys it
57
+ already publishes — and even that is avoidable by supplying a local keys file, for
58
+ verification with zero network calls.
59
+
60
+ When a PR arrives from someone you don't know — a person, or increasingly an AI agent — trust
61
+ today rests on a GitHub username, the platform, and reading the diff by eye. SCPE adds a
62
+ cryptographic answer to two questions the platform doesn't: **who really produced this change**,
63
+ and **is the diff exactly what they signed** — carrying a signed AI-use disclosure (and,
64
+ optionally, a machine-attribution record) alongside. The owner re-derives everything with
65
+ `ssh-keygen`, `git`, and the public keys the contributor's git host already publishes. There is
66
+ no SCPE server, so there is nothing to trust and nothing to shut down.
67
+
68
+ **SCPE standardizes evidence, not content.** It never says an artifact is good, true, or safe —
69
+ it standardizes how verifiable evidence (who produced it, that it's untampered, and any signed
70
+ attestations) travels with a hashed artifact and is checked offline.
71
+
72
+ **One core, many specifications.** *SCPE Core* — the envelope, identity, and verification — is
73
+ shared by every domain. Each *SCPE Specification* adds only its domain's conventions on top; the
74
+ `profile` label is surfaced but never changes the verify decision.
75
+
76
+ | Specification | For | Seals | Example |
77
+ |---|---|---|---|
78
+ | **SCPE-C** | Code | a diff (`code-change`) | a pull request |
79
+ | **SCPE-I** | Images | the file's bytes (`artifact`) | `.png`, `.jpg` |
80
+ | **SCPE-V** | Video | the file's bytes | `.mp4`, `.mov` |
81
+ | **SCPE-A** | Audio | the file's bytes | `.wav`, `.mp3` |
82
+ | **SCPE-M** | Models | the file's bytes | `.safetensors`, `.gguf` |
83
+ | **SCPE-DATA** | Datasets | the file's bytes | `.csv`, `.parquet` |
84
+ | **SCPE-D** | Documents | the file's bytes | `.pdf` |
85
+ | **SCPE-AR** | Any artifact | the file's bytes | any file |
86
+
87
+ Identity is a `(provider, subject)` pair resolved from a fixed host table (`github`, `gitlab`,
88
+ `codeberg`) or an offline keys file — the manifest never carries a hostname, so a contribution
89
+ can't steer the verifier at an attacker's host.
90
+
91
+ **Open, and meant to stay that way.** SCPE is — and will always be — open source: the
92
+ specification and every reference implementation are free to read, implement, and fork. The
93
+ goal is a single, open, *universal* standard for artifact provenance, and a standard only
94
+ becomes universal if anyone can implement it without asking permission. So being open isn't a
95
+ license choice here; it's the whole point.
96
+
97
+ > **Attribution tells you *what*. Provenance proves *who* — and that nothing was tampered with.**
98
+
99
+ ## What SCPE is — and isn't
100
+
101
+ | **SCPE is** | **SCPE is not** |
102
+ |---|---|
103
+ | a minimal, transportable, offline-verifiable **evidence format** for a contribution or artifact — *who* produced it, proof it's *untampered*, and any *signed attestations* — with one core and thin per-domain profiles. | a code reviewer, a malware scanner, an artifact registry, a CI/CD security system, a compliance framework, or a hosted service. It doesn't judge whether the artifact is *good* or *safe* — only that the evidence checks out. |
104
+
105
+ For how SCPE relates to code review, build provenance, and attribution records, see
106
+ [docs/comparison.md](docs/comparison.md).
107
+
108
+ ## The assurance ladder
109
+
110
+ Adopt at the level that fits your project, and upgrade later without changing the format.
111
+
112
+ | Level | What the repo requires | Contributor cost |
113
+ |---|---|---|
114
+ | **L1 — Disclosure** | An AI-use disclosure is present (an `Assisted-by:` trailer or a PR-template checkbox). | Zero — it's the policy you may already have written, now enforced. |
115
+ | **L2 — Signed envelope** | A valid signed SCPE envelope: verifiable identity + an untampered diff. | One command to sign. |
116
+ | **L3 — Countersignature** *(roadmap)* | A third party (a reviewer, or the agent platform) co-signs. | — |
117
+
118
+ Higher levels include the lower ones. Most projects that already require AI disclosure need
119
+ **L1** today; the signature is the *mechanism*, the policy is the *product* — the same shape
120
+ SLSA uses to sell levels. See [docs/LEVELS.md](docs/LEVELS.md).
121
+
122
+ ## How it works
123
+
124
+ 1. **Contributor** (human or agent) packs the change into a signed *envelope*: a manifest
125
+ (target repo, base commit, a SHA-256 of the exact diff, an AI-use disclosure, and an
126
+ optional attribution record) signed with the SSH key already on their GitHub profile
127
+ (`ssh-keygen -Y sign -n scpe/0.1`). No new account.
128
+ 2. It travels inside a **normal pull request** — the diff in the branch, the ~1–2 KB signed
129
+ attestation embedded in the PR body. Merging leaves the repo history clean.
130
+ 3. The **owner's side** — a GitHub Action, or a single-file verifier auditable in ten minutes —
131
+ re-derives everything itself, with no SCPE server involved: the signature is checked against
132
+ `github.com/<login>.keys` (one HTTPS GET to keys the contributor's host already publishes —
133
+ or, with a supplied keys file, no network call at all), the diff's SHA-256 is recomputed from
134
+ the PR and compared, and a seal is posted (or, in require mode, an unverifiable PR is
135
+ rejected).
136
+
137
+ ## What `verified` proves — and what it doesn't
138
+
139
+ A `verified` result means exactly: *a key published on this GitHub account signed exactly this
140
+ change and this disclosure, and the diff you're looking at matches, byte-for-byte after
141
+ normalizing line endings, what they signed.* Nothing more.
142
+
143
+ It does **not** prove the code is safe or good (SCPE is not review), that the disclosure is
144
+ honest (a signature proves *who claimed*, not that the claim is true), or anything if the GitHub
145
+ account or key is compromised (that's the trust root). Read
146
+ [spec/THREAT_MODEL.md](spec/THREAT_MODEL.md) before relying on it — it states the limits plainly.
147
+
148
+ ## For maintainers — turn it on
149
+
150
+ Add a workflow that verifies every PR and posts a seal. Set `require` to gate merges.
151
+
152
+ ```yaml
153
+ # .github/workflows/scpe.yml — see docs/workflows/scpe.yml for the fork-safe full version
154
+ - uses: augbastos/scpe@v0.1
155
+ with:
156
+ level: "1" # 1 = disclosure lint · 2 = signed envelope required
157
+ require: "true" # fail the check on anything not verifiable
158
+ ```
159
+
160
+ The Action uses a fork-safe two-job split: the untrusted job (which runs contributor code) holds
161
+ no secrets; only a trusted follow-up job posts the comment.
162
+
163
+ ## Verify anything yourself
164
+
165
+ The reference verifier is one stdlib-only file — read it top to bottom and you know exactly what
166
+ a seal means:
167
+
168
+ ```bash
169
+ python reference/standalone/verify_envelope.py <envelope.zip> --keys <login.keys>
170
+ # → [OK] verified (or a precise reject status: tampered, signature-invalid, …)
171
+ ```
172
+
173
+ The 18 normative [test vectors](spec/test-vectors) are the conformance contract: any
174
+ implementation that produces their expected statuses conforms to the spec.
175
+
176
+ **Cost** — measured on the Python reference (Ryzen 5 5600H, Python 3.14, `local` provider):
177
+
178
+ | | Measured |
179
+ |---|---|
180
+ | PR-body attestation (manifest + sig, base64) | 1.1–1.5 KB |
181
+ | Standalone envelope (3-file / 27-line PR, zipped) | ~1.5 KB |
182
+ | Verify wall-time | ~210 ms cold CLI · ~39 ms in a warm process |
183
+
184
+ An `artifact` subject adds its payload size on top of ~800 B fixed overhead. Order-of-magnitude,
185
+ single machine — not a formal benchmark suite.
186
+
187
+ ## Where it sits
188
+
189
+ - **Not code review.** Copilot / CodeRabbit judge whether the code is good. SCPE proves *who*
190
+ and *integrity*.
191
+ - **Complements attribution, doesn't compete.** [Agent Trace](https://github.com/cursor/agent-trace)
192
+ and [git-ai](https://github.com/git-ai-project/git-ai) *record* who/what wrote which lines,
193
+ self-reported; SCPE carries that record inside the signed manifest, making it verifiable.
194
+ - **A different layer from build provenance.** Sigstore / SLSA / in-toto attest *artifacts and
195
+ builds*; SCPE attests a *contribution*, at the pull-request boundary.
196
+ - **Direct prior art:** `patatt` + `b4` ([kernel.org](https://github.com/mricon/patatt)) have run
197
+ this exact pattern — self-sign a patch with a key the platform publishes, verify independently,
198
+ no CA, no server — on the Linux kernel's mailing list for years. SCPE applies the same shape to
199
+ the GitHub pull-request boundary.
200
+
201
+ ## Status
202
+
203
+ **v0.1 — early.** This is a specification plus a reference implementation (a single-file
204
+ verifier, a producer, and a maintainer-side Action) with **441 passing tests**, including a
205
+ 100-PR stress proof and a local end-to-end — plus two more independent verifiers, in Go and
206
+ Rust, that reach the same verdict as the Python reference on every one of the 18 normative
207
+ vectors — and a differential test that runs mutated manifests through all three and confirms
208
+ they never disagree. There is **no external adoption yet**. It is not a hosted service and
209
+ never will be.
210
+
211
+ ## Docs
212
+
213
+ - [spec/SPEC.md](spec/SPEC.md) — the protocol (`scpe/0.1`)
214
+ - [spec/THREAT_MODEL.md](spec/THREAT_MODEL.md) — what it does and does not defend against
215
+ - [spec/FAQ.md](spec/FAQ.md) — why SSH, why the PR body, relation to Agent Trace / Sigstore / patatt
216
+ - [docs/LEVELS.md](docs/LEVELS.md) — the L1 / L2 / L3 assurance ladder
217
+
218
+ ## License
219
+
220
+ Code is [Apache-2.0](LICENSE); the specification (everything under `spec/`) is
221
+ [CC-BY-4.0](LICENSE-SPEC). © 2026 Augusto Bastos.
@@ -0,0 +1,190 @@
1
+ <p align="center">
2
+ <img src="docs/assets/scpe-logo.svg" alt="SCPE" width="104" height="104">
3
+ </p>
4
+
5
+ <h1 align="center">SCPE</h1>
6
+
7
+ <p align="center">
8
+ <b>A protocol for verifiable digital artifacts.</b><br>
9
+ A single envelope. Multiple specifications.<br>
10
+ <i>Merge code, not claims.</i>
11
+ </p>
12
+
13
+ <p align="center">
14
+ <img alt="tests" src="https://img.shields.io/badge/tests-441_passing-41c257?style=flat-square&labelColor=0b0b0c">
15
+ <img alt="3 impls" src="https://img.shields.io/badge/verifiers-python%20%2B%20go%20%2B%20rust-41c257?style=flat-square&labelColor=0b0b0c">
16
+ <img alt="spec" src="https://img.shields.io/badge/spec-scpe%2F0.1-41c257?style=flat-square&labelColor=0b0b0c">
17
+ <img alt="python" src="https://img.shields.io/badge/python-3.10%2B-41c257?style=flat-square&labelColor=0b0b0c">
18
+ <img alt="license" src="https://img.shields.io/badge/code-Apache--2.0-41c257?style=flat-square&labelColor=0b0b0c">
19
+ <img alt="status" src="https://img.shields.io/badge/v0.1-early-d29922?style=flat-square&labelColor=0b0b0c">
20
+ </p>
21
+
22
+ An open protocol that lets a repository owner verify — with no SCPE server and no new
23
+ accounts — *who* made a pull request and that *nothing was tampered with*, then turn on a
24
+ policy that only merges contributions they can verify. There is no SCPE server, ever: the
25
+ default forge path makes exactly one HTTPS GET, to the contributor's git host, for keys it
26
+ already publishes — and even that is avoidable by supplying a local keys file, for
27
+ verification with zero network calls.
28
+
29
+ When a PR arrives from someone you don't know — a person, or increasingly an AI agent — trust
30
+ today rests on a GitHub username, the platform, and reading the diff by eye. SCPE adds a
31
+ cryptographic answer to two questions the platform doesn't: **who really produced this change**,
32
+ and **is the diff exactly what they signed** — carrying a signed AI-use disclosure (and,
33
+ optionally, a machine-attribution record) alongside. The owner re-derives everything with
34
+ `ssh-keygen`, `git`, and the public keys the contributor's git host already publishes. There is
35
+ no SCPE server, so there is nothing to trust and nothing to shut down.
36
+
37
+ **SCPE standardizes evidence, not content.** It never says an artifact is good, true, or safe —
38
+ it standardizes how verifiable evidence (who produced it, that it's untampered, and any signed
39
+ attestations) travels with a hashed artifact and is checked offline.
40
+
41
+ **One core, many specifications.** *SCPE Core* — the envelope, identity, and verification — is
42
+ shared by every domain. Each *SCPE Specification* adds only its domain's conventions on top; the
43
+ `profile` label is surfaced but never changes the verify decision.
44
+
45
+ | Specification | For | Seals | Example |
46
+ |---|---|---|---|
47
+ | **SCPE-C** | Code | a diff (`code-change`) | a pull request |
48
+ | **SCPE-I** | Images | the file's bytes (`artifact`) | `.png`, `.jpg` |
49
+ | **SCPE-V** | Video | the file's bytes | `.mp4`, `.mov` |
50
+ | **SCPE-A** | Audio | the file's bytes | `.wav`, `.mp3` |
51
+ | **SCPE-M** | Models | the file's bytes | `.safetensors`, `.gguf` |
52
+ | **SCPE-DATA** | Datasets | the file's bytes | `.csv`, `.parquet` |
53
+ | **SCPE-D** | Documents | the file's bytes | `.pdf` |
54
+ | **SCPE-AR** | Any artifact | the file's bytes | any file |
55
+
56
+ Identity is a `(provider, subject)` pair resolved from a fixed host table (`github`, `gitlab`,
57
+ `codeberg`) or an offline keys file — the manifest never carries a hostname, so a contribution
58
+ can't steer the verifier at an attacker's host.
59
+
60
+ **Open, and meant to stay that way.** SCPE is — and will always be — open source: the
61
+ specification and every reference implementation are free to read, implement, and fork. The
62
+ goal is a single, open, *universal* standard for artifact provenance, and a standard only
63
+ becomes universal if anyone can implement it without asking permission. So being open isn't a
64
+ license choice here; it's the whole point.
65
+
66
+ > **Attribution tells you *what*. Provenance proves *who* — and that nothing was tampered with.**
67
+
68
+ ## What SCPE is — and isn't
69
+
70
+ | **SCPE is** | **SCPE is not** |
71
+ |---|---|
72
+ | a minimal, transportable, offline-verifiable **evidence format** for a contribution or artifact — *who* produced it, proof it's *untampered*, and any *signed attestations* — with one core and thin per-domain profiles. | a code reviewer, a malware scanner, an artifact registry, a CI/CD security system, a compliance framework, or a hosted service. It doesn't judge whether the artifact is *good* or *safe* — only that the evidence checks out. |
73
+
74
+ For how SCPE relates to code review, build provenance, and attribution records, see
75
+ [docs/comparison.md](docs/comparison.md).
76
+
77
+ ## The assurance ladder
78
+
79
+ Adopt at the level that fits your project, and upgrade later without changing the format.
80
+
81
+ | Level | What the repo requires | Contributor cost |
82
+ |---|---|---|
83
+ | **L1 — Disclosure** | An AI-use disclosure is present (an `Assisted-by:` trailer or a PR-template checkbox). | Zero — it's the policy you may already have written, now enforced. |
84
+ | **L2 — Signed envelope** | A valid signed SCPE envelope: verifiable identity + an untampered diff. | One command to sign. |
85
+ | **L3 — Countersignature** *(roadmap)* | A third party (a reviewer, or the agent platform) co-signs. | — |
86
+
87
+ Higher levels include the lower ones. Most projects that already require AI disclosure need
88
+ **L1** today; the signature is the *mechanism*, the policy is the *product* — the same shape
89
+ SLSA uses to sell levels. See [docs/LEVELS.md](docs/LEVELS.md).
90
+
91
+ ## How it works
92
+
93
+ 1. **Contributor** (human or agent) packs the change into a signed *envelope*: a manifest
94
+ (target repo, base commit, a SHA-256 of the exact diff, an AI-use disclosure, and an
95
+ optional attribution record) signed with the SSH key already on their GitHub profile
96
+ (`ssh-keygen -Y sign -n scpe/0.1`). No new account.
97
+ 2. It travels inside a **normal pull request** — the diff in the branch, the ~1–2 KB signed
98
+ attestation embedded in the PR body. Merging leaves the repo history clean.
99
+ 3. The **owner's side** — a GitHub Action, or a single-file verifier auditable in ten minutes —
100
+ re-derives everything itself, with no SCPE server involved: the signature is checked against
101
+ `github.com/<login>.keys` (one HTTPS GET to keys the contributor's host already publishes —
102
+ or, with a supplied keys file, no network call at all), the diff's SHA-256 is recomputed from
103
+ the PR and compared, and a seal is posted (or, in require mode, an unverifiable PR is
104
+ rejected).
105
+
106
+ ## What `verified` proves — and what it doesn't
107
+
108
+ A `verified` result means exactly: *a key published on this GitHub account signed exactly this
109
+ change and this disclosure, and the diff you're looking at matches, byte-for-byte after
110
+ normalizing line endings, what they signed.* Nothing more.
111
+
112
+ It does **not** prove the code is safe or good (SCPE is not review), that the disclosure is
113
+ honest (a signature proves *who claimed*, not that the claim is true), or anything if the GitHub
114
+ account or key is compromised (that's the trust root). Read
115
+ [spec/THREAT_MODEL.md](spec/THREAT_MODEL.md) before relying on it — it states the limits plainly.
116
+
117
+ ## For maintainers — turn it on
118
+
119
+ Add a workflow that verifies every PR and posts a seal. Set `require` to gate merges.
120
+
121
+ ```yaml
122
+ # .github/workflows/scpe.yml — see docs/workflows/scpe.yml for the fork-safe full version
123
+ - uses: augbastos/scpe@v0.1
124
+ with:
125
+ level: "1" # 1 = disclosure lint · 2 = signed envelope required
126
+ require: "true" # fail the check on anything not verifiable
127
+ ```
128
+
129
+ The Action uses a fork-safe two-job split: the untrusted job (which runs contributor code) holds
130
+ no secrets; only a trusted follow-up job posts the comment.
131
+
132
+ ## Verify anything yourself
133
+
134
+ The reference verifier is one stdlib-only file — read it top to bottom and you know exactly what
135
+ a seal means:
136
+
137
+ ```bash
138
+ python reference/standalone/verify_envelope.py <envelope.zip> --keys <login.keys>
139
+ # → [OK] verified (or a precise reject status: tampered, signature-invalid, …)
140
+ ```
141
+
142
+ The 18 normative [test vectors](spec/test-vectors) are the conformance contract: any
143
+ implementation that produces their expected statuses conforms to the spec.
144
+
145
+ **Cost** — measured on the Python reference (Ryzen 5 5600H, Python 3.14, `local` provider):
146
+
147
+ | | Measured |
148
+ |---|---|
149
+ | PR-body attestation (manifest + sig, base64) | 1.1–1.5 KB |
150
+ | Standalone envelope (3-file / 27-line PR, zipped) | ~1.5 KB |
151
+ | Verify wall-time | ~210 ms cold CLI · ~39 ms in a warm process |
152
+
153
+ An `artifact` subject adds its payload size on top of ~800 B fixed overhead. Order-of-magnitude,
154
+ single machine — not a formal benchmark suite.
155
+
156
+ ## Where it sits
157
+
158
+ - **Not code review.** Copilot / CodeRabbit judge whether the code is good. SCPE proves *who*
159
+ and *integrity*.
160
+ - **Complements attribution, doesn't compete.** [Agent Trace](https://github.com/cursor/agent-trace)
161
+ and [git-ai](https://github.com/git-ai-project/git-ai) *record* who/what wrote which lines,
162
+ self-reported; SCPE carries that record inside the signed manifest, making it verifiable.
163
+ - **A different layer from build provenance.** Sigstore / SLSA / in-toto attest *artifacts and
164
+ builds*; SCPE attests a *contribution*, at the pull-request boundary.
165
+ - **Direct prior art:** `patatt` + `b4` ([kernel.org](https://github.com/mricon/patatt)) have run
166
+ this exact pattern — self-sign a patch with a key the platform publishes, verify independently,
167
+ no CA, no server — on the Linux kernel's mailing list for years. SCPE applies the same shape to
168
+ the GitHub pull-request boundary.
169
+
170
+ ## Status
171
+
172
+ **v0.1 — early.** This is a specification plus a reference implementation (a single-file
173
+ verifier, a producer, and a maintainer-side Action) with **441 passing tests**, including a
174
+ 100-PR stress proof and a local end-to-end — plus two more independent verifiers, in Go and
175
+ Rust, that reach the same verdict as the Python reference on every one of the 18 normative
176
+ vectors — and a differential test that runs mutated manifests through all three and confirms
177
+ they never disagree. There is **no external adoption yet**. It is not a hosted service and
178
+ never will be.
179
+
180
+ ## Docs
181
+
182
+ - [spec/SPEC.md](spec/SPEC.md) — the protocol (`scpe/0.1`)
183
+ - [spec/THREAT_MODEL.md](spec/THREAT_MODEL.md) — what it does and does not defend against
184
+ - [spec/FAQ.md](spec/FAQ.md) — why SSH, why the PR body, relation to Agent Trace / Sigstore / patatt
185
+ - [docs/LEVELS.md](docs/LEVELS.md) — the L1 / L2 / L3 assurance ladder
186
+
187
+ ## License
188
+
189
+ Code is [Apache-2.0](LICENSE); the specification (everything under `spec/`) is
190
+ [CC-BY-4.0](LICENSE-SPEC). © 2026 Augusto Bastos.