deponent 0.1.1__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 (61) hide show
  1. deponent-0.1.1/.dockerignore +13 -0
  2. deponent-0.1.1/.github/workflows/ci.yml +47 -0
  3. deponent-0.1.1/.gitignore +28 -0
  4. deponent-0.1.1/Dockerfile +26 -0
  5. deponent-0.1.1/LICENSE +202 -0
  6. deponent-0.1.1/Makefile +36 -0
  7. deponent-0.1.1/NOTICE +17 -0
  8. deponent-0.1.1/PKG-INFO +237 -0
  9. deponent-0.1.1/README.md +205 -0
  10. deponent-0.1.1/SECURITY.md +38 -0
  11. deponent-0.1.1/SPEC.md +338 -0
  12. deponent-0.1.1/TRADEMARKS.md +51 -0
  13. deponent-0.1.1/canaries/CANARIES.md +165 -0
  14. deponent-0.1.1/conftest.py +8 -0
  15. deponent-0.1.1/deponent/__init__.py +59 -0
  16. deponent-0.1.1/deponent/adapters/__init__.py +15 -0
  17. deponent-0.1.1/deponent/adapters/contract.py +51 -0
  18. deponent-0.1.1/deponent/adapters/deponent.py +95 -0
  19. deponent-0.1.1/deponent/badge.py +265 -0
  20. deponent-0.1.1/deponent/cell.py +171 -0
  21. deponent-0.1.1/deponent/claims.py +259 -0
  22. deponent-0.1.1/deponent/conform.py +56 -0
  23. deponent-0.1.1/deponent/conformance.py +255 -0
  24. deponent-0.1.1/deponent/gate.py +195 -0
  25. deponent-0.1.1/deponent/jail.py +289 -0
  26. deponent-0.1.1/deponent/ledger.py +125 -0
  27. deponent-0.1.1/deponent/operator_attest.py +151 -0
  28. deponent-0.1.1/deponent/playground.py +817 -0
  29. deponent-0.1.1/deponent/profiles.py +75 -0
  30. deponent-0.1.1/deponent/reach.py +132 -0
  31. deponent-0.1.1/deponent/receipts.py +162 -0
  32. deponent-0.1.1/deponent/reconcile.py +77 -0
  33. deponent-0.1.1/deponent/selfgate.py +154 -0
  34. deponent-0.1.1/docs/demo.cast +12 -0
  35. deponent-0.1.1/docs/demo.gif +0 -0
  36. deponent-0.1.1/docs/deponent-badge.svg +1 -0
  37. deponent-0.1.1/examples/backends.py +149 -0
  38. deponent-0.1.1/examples/custom_tool.py +69 -0
  39. deponent-0.1.1/examples/demo.py +58 -0
  40. deponent-0.1.1/examples/governed_team.py +311 -0
  41. deponent-0.1.1/examples/minimal.py +34 -0
  42. deponent-0.1.1/examples/playground/mixed.json +12 -0
  43. deponent-0.1.1/examples/playground/rogue.json +12 -0
  44. deponent-0.1.1/examples/playground/well_behaved.json +11 -0
  45. deponent-0.1.1/examples/safety_action_governor.py +106 -0
  46. deponent-0.1.1/pyproject.toml +61 -0
  47. deponent-0.1.1/tests/test_badge.py +106 -0
  48. deponent-0.1.1/tests/test_cell.py +82 -0
  49. deponent-0.1.1/tests/test_claims.py +193 -0
  50. deponent-0.1.1/tests/test_conformance.py +272 -0
  51. deponent-0.1.1/tests/test_gate.py +101 -0
  52. deponent-0.1.1/tests/test_jail.py +167 -0
  53. deponent-0.1.1/tests/test_jail_backends.py +122 -0
  54. deponent-0.1.1/tests/test_ledger.py +81 -0
  55. deponent-0.1.1/tests/test_operator_attest.py +98 -0
  56. deponent-0.1.1/tests/test_playground.py +227 -0
  57. deponent-0.1.1/tests/test_profiles.py +70 -0
  58. deponent-0.1.1/tests/test_reach.py +101 -0
  59. deponent-0.1.1/tests/test_receipts.py +81 -0
  60. deponent-0.1.1/tests/test_reconcile.py +97 -0
  61. deponent-0.1.1/tests/test_selfgate.py +72 -0
@@ -0,0 +1,13 @@
1
+ # Version-control, environment, build, test, and local run artifacts.
2
+ .git
3
+ .venv
4
+ **/__pycache__/
5
+ **/*.pyc
6
+ **/*.pyo
7
+ .pytest_cache/
8
+ .ruff_cache/
9
+ dist/
10
+ build/
11
+ *.egg-info/
12
+ runs/
13
+ .DS_Store
@@ -0,0 +1,47 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ # Least privilege: CI only needs to read the checked-out code.
9
+ permissions:
10
+ contents: read
11
+
12
+ concurrency:
13
+ group: ci-${{ github.ref }}
14
+ cancel-in-progress: true
15
+
16
+ jobs:
17
+ test:
18
+ name: tests (${{ matrix.os }}, py${{ matrix.python-version }})
19
+ runs-on: ${{ matrix.os }}
20
+ strategy:
21
+ fail-fast: false
22
+ matrix:
23
+ # Both OSes run the platform-independent core (gate/ledger/receipts/…);
24
+ # the macOS-native Seatbelt jail tests and the DRAFT Docker tests skip on
25
+ # Linux, while macOS runs the full suite incl. the live Seatbelt proofs.
26
+ os: [ubuntu-latest, macos-latest]
27
+ python-version: ['3.10', '3.11', '3.12', '3.13']
28
+ steps:
29
+ - uses: actions/checkout@v4
30
+
31
+ - name: Set up Python ${{ matrix.python-version }}
32
+ uses: actions/setup-python@v5
33
+ with:
34
+ python-version: ${{ matrix.python-version }}
35
+
36
+ - name: Install (core is zero-dep; the dev extra adds pytest + cryptography)
37
+ run: |
38
+ python -m pip install --upgrade pip
39
+ python -m pip install -e ".[dev]"
40
+
41
+ - name: Run the suite
42
+ run: python -m pytest -q
43
+
44
+ # The mark is earnable infrastructure, not a self-claim: CI re-derives it,
45
+ # fail-closed. A non-conformant kernel fails this step and the badge goes red.
46
+ - name: Self-verify the GAK-conformant mark
47
+ run: python -m deponent.badge verify --kernel deponent
@@ -0,0 +1,28 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.egg-info/
5
+ .eggs/
6
+ build/
7
+ dist/
8
+ .venv/
9
+ venv/
10
+
11
+ # Test / tooling
12
+ .pytest_cache/
13
+ .ruff_cache/
14
+ .mypy_cache/
15
+ .coverage
16
+ htmlcov/
17
+
18
+ # Deponent runtime artifacts (never commit receipts or live ledgers)
19
+ .deponent/
20
+ receipts/
21
+ runs/
22
+ *.jsonl
23
+ .jail.sb
24
+ .tmp/
25
+ .run_out
26
+
27
+ # OS
28
+ .DS_Store
@@ -0,0 +1,26 @@
1
+ # Deponent — a governed sovereign agent kernel. "It doesn't answer. It testifies."
2
+ # Zero third-party deps in the core, so this image is tiny and offline-buildable.
3
+ #
4
+ # docker build -t deponent .
5
+ # docker run --rm deponent # scores the kernel against its own standard
6
+ # docker run --rm deponent make test # run the suite in-container
7
+ #
8
+ # NOTE on confinement in-container: the in-language jail is macOS Seatbelt (host) or a
9
+ # Docker backend (host daemon). Inside this container the gate + ledger + receipts +
10
+ # conformance run fully (platform-independent); the live OS-jail escape-proofs are a
11
+ # host concern and skip here — by design, not omission.
12
+ FROM python:3.12-slim
13
+
14
+ LABEL org.opencontainers.image.title="Deponent"
15
+ LABEL org.opencontainers.image.description="A governed sovereign agent kernel — make any local AI agent testify. Deny-by-default gate, tamper-evident hash-chained ledger, verifiable receipts."
16
+ LABEL org.opencontainers.image.source="https://github.com/cjchanh/deponent"
17
+ LABEL org.opencontainers.image.licenses="Apache-2.0"
18
+
19
+ WORKDIR /app
20
+ COPY . /app
21
+ # stdlib-only core -> the install pulls nothing from the network for the kernel itself.
22
+ RUN pip install --no-cache-dir . && python -c "import deponent; print('deponent import OK')"
23
+
24
+ # Default: score the reference kernel against the GAK conformance standard — the
25
+ # 10-second "it actually works" proof. Override with any command (e.g. `make test`).
26
+ CMD ["python", "-m", "deponent.conform", "--kernel", "deponent"]
deponent-0.1.1/LICENSE ADDED
@@ -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,36 @@
1
+ .PHONY: help test demo self-gate self-gate-live install lint clean
2
+
3
+ help:
4
+ @echo "make test - run the full suite (jail tests are macOS-only)"
5
+ @echo "make demo - run the minimal testify demo (no model needed)"
6
+ @echo "make self-gate - dogfood: deponent gates its own development (CONFORMANT + SOUND)"
7
+ @echo "make self-gate-live - full dogfood: govern a REAL jailed git+rustc self-build"
8
+ @echo "make install - editable install of the kernel"
9
+ @echo "make lint - ruff check (if installed)"
10
+ @echo "make clean - remove caches + runtime artifacts"
11
+
12
+ # Dogfood / quality ratchet: the engine gates the engine. Exit non-zero if the
13
+ # reference kernel stops passing its own GAK clauses, or a governed self-build's
14
+ # testimony is not sound. Wire as a pre-commit / CI check.
15
+ self-gate:
16
+ python3 -m deponent.selfgate
17
+
18
+ # Full dogfood: deponent governs its OWN real git+rustc build, jailed — the local
19
+ # commit ALLOWs and runs, the push BLOCKs at the irreversible floor, all testified.
20
+ self-gate-live:
21
+ python3 -m deponent.selfgate --live
22
+
23
+ test:
24
+ python3 -m pytest -q
25
+
26
+ demo:
27
+ python3 examples/minimal.py
28
+
29
+ install:
30
+ python3 -m pip install -e .
31
+
32
+ lint:
33
+ ruff check . || true
34
+
35
+ clean:
36
+ rm -rf .pytest_cache .ruff_cache .mypy_cache **/__pycache__ build dist *.egg-info .deponent runs
deponent-0.1.1/NOTICE ADDED
@@ -0,0 +1,17 @@
1
+ Deponent — a governed sovereign agent kernel
2
+ Copyright 2026 CJ — Centennial Defense Systems
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
7
+
8
+ "It doesn't answer. It testifies."
9
+
10
+ This is the open-core reference primitive beneath Centennial Defense Systems'
11
+ deterministic safety and deployment-governance work. It is given freely so the
12
+ pattern — deny-by-default, jailed, tamper-evident, fail-closed — can be inspected,
13
+ reproduced, and built upon.
14
+
15
+ This public kernel is and will remain Apache-2.0. The grant on every published
16
+ version is irrevocable by the terms of the License; it will not be relicensed or
17
+ withdrawn.
@@ -0,0 +1,237 @@
1
+ Metadata-Version: 2.5
2
+ Name: deponent
3
+ Version: 0.1.1
4
+ Summary: A fail-closed agent governance kernel with a deny-by-default gate, tamper-evident ledger, and verifiable receipts.
5
+ Project-URL: Homepage, https://github.com/cjchanh/deponent
6
+ Project-URL: Source, https://github.com/cjchanh/deponent
7
+ Project-URL: Issues, https://github.com/cjchanh/deponent/issues
8
+ Project-URL: Company, https://centennialdefense.systems
9
+ Author-email: "Christopher \"CJ\" Chanhnourack" <contact@centennialdefense.systems>
10
+ License-Expression: Apache-2.0
11
+ License-File: LICENSE
12
+ Keywords: agent,ai-safety,audit,audit-log,deny-by-default,governance,local-first,sandbox,tamper-evident
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: Apache Software License
16
+ Classifier: Operating System :: MacOS
17
+ Classifier: Operating System :: POSIX :: Linux
18
+ Classifier: Programming Language :: Python :: 3 :: Only
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Topic :: Security
21
+ Classifier: Topic :: Software Development :: Quality Assurance
22
+ Requires-Python: >=3.10
23
+ Provides-Extra: attest
24
+ Requires-Dist: cryptography>=42; extra == 'attest'
25
+ Provides-Extra: dev
26
+ Requires-Dist: cryptography>=42; extra == 'dev'
27
+ Requires-Dist: pytest>=7; extra == 'dev'
28
+ Provides-Extra: mlx
29
+ Requires-Dist: mlx-vlm>=0.1; extra == 'mlx'
30
+ Provides-Extra: ollama
31
+ Description-Content-Type: text/markdown
32
+
33
+ # Deponent
34
+
35
+ [![deponent: conformant](docs/deponent-badge.svg)](#proven) &nbsp;·&nbsp; [![CI](https://github.com/cjchanh/deponent/actions/workflows/ci.yml/badge.svg)](https://github.com/cjchanh/deponent/actions/workflows/ci.yml) &nbsp;·&nbsp; **Apache-2.0** &nbsp;·&nbsp; verify the mark yourself: `python3 -m deponent.badge verify --kernel deponent`
36
+
37
+ **A governed sovereign agent kernel. It doesn't answer. It testifies.**
38
+
39
+ ![Deponent blocks a destructive action and an unknown tool, then detects a forged audit record](docs/demo.gif)
40
+
41
+ A local AI agent runs on your machine. It edits files, runs commands, touches your system — and when it finishes, all you have is its word that it behaved, and a failed step reports success as readily as a real one. Deponent replaces the word with a record you can verify yourself.
42
+
43
+ It is a small, model-agnostic governance layer that sits under any agent's tool calls:
44
+
45
+ ```
46
+ deny-by-default gate -> Seatbelt jail -> tamper-evident ledger -> verifiable receipt
47
+ ```
48
+
49
+ The core is pure Python and standard-library only: **zero third-party runtime dependencies.** Install it with `pip install deponent`.
50
+
51
+ ---
52
+
53
+ ## Quickstart
54
+
55
+ ```python
56
+ import tempfile
57
+ from deponent import Cell
58
+
59
+ cell = Cell(tempfile.mkdtemp(), use_jail=False) # a sovereign, local sandbox
60
+ # use_jail=True on macOS adds the Seatbelt jail
61
+ print(cell.act("write_file", {"path": "notes.txt", "content": "hello"}).output) # ALLOW
62
+ print(cell.act("read_file", {"path": "notes.txt"}).output) # ALLOW
63
+ print(cell.act("run_cmd", {"cmd": "rm -rf ./blocked-example"}).output) # BLOCK (destructive)
64
+ print(cell.act("exfiltrate", {"to": "evil.example"}).output) # BLOCK (deny-by-default)
65
+
66
+ ok, msg = cell.verify() # recompute the chain — don't trust it
67
+ print(f"testimony intact: {ok} — {msg}")
68
+ ```
69
+
70
+ That is exactly `examples/minimal.py`. Run it (`python3 examples/minimal.py`) and it prints:
71
+
72
+ ```text
73
+ wrote 5 bytes -> notes.txt
74
+ hello
75
+ BLOCKED [destructive-or-out-of-scope]: matched deny pattern 'rm -rf'
76
+ BLOCKED [unknown-tool]: no policy for tool 'exfiltrate' (deny-by-default)
77
+
78
+ testimony intact: True — chain intact (4 entries)
79
+ ALLOW write_file [reversible-local-write]
80
+ ALLOW read_file [reversible-local-read]
81
+ BLOCK run_cmd [destructive-or-out-of-scope]
82
+ BLOCK exfiltrate [unknown-tool]
83
+ ```
84
+
85
+ No model needed for the demo. No network. No install required to run it from the repo.
86
+
87
+ ---
88
+
89
+ ## Why this exists
90
+
91
+ Local agents are useful precisely because they act on your machine. That is also the risk: you are trusting they only did what they said they did.
92
+
93
+ A self-report is not evidence. Every system has two surfaces — what it says about itself and what it actually did — and they drift. Agents are no exception: "tests pass," "done," "cleaned up" is a claim, not a fact.
94
+
95
+ Deponent replaces the trust with a record. Every action an agent proposes is gated before it runs, jailed while it runs, and recorded after it runs into a hash-chained ledger you can re-verify from scratch. At the end you can **prove what happened** — or prove the record was altered. There is no third option.
96
+
97
+ ---
98
+
99
+ ## How it works
100
+
101
+ One object, `Cell`, is the whole architecture. Each action goes through `.act()`:
102
+
103
+ ```
104
+ agent proposes an action
105
+
106
+
107
+ ┌─────────┐ deny-by-default. unknown tool / path escape /
108
+ │ GATE │ destructive cmd / network / privilege -> BLOCK
109
+ └────┬────┘
110
+ │ ALLOW
111
+
112
+ ┌─────────┐ macOS Seatbelt: no network, writes confined to
113
+ │ JAIL │ the sandbox, CPU + memory + wall-clock bounded
114
+ └────┬────┘
115
+ │ output
116
+
117
+ ┌─────────┐ append-only sha256 hash chain. every decision +
118
+ │ LEDGER │ a hash of its outcome, link-locked to the prior
119
+ └────┬────┘
120
+
121
+
122
+ ┌─────────┐ recompute the chain AND the content hash.
123
+ │ RECEIPT │ verify() is real — there is no return-True stub
124
+ └─────────┘
125
+ ```
126
+
127
+ - **The Gate** governs the shell + path surface — which programs may run, which paths may be touched, whether a command chains or substitutes its way out of policy. Deny-by-default and fail-closed: anything it cannot classify is blocked. It can also gate on real blast radius: wire a `ReachOracle` (opt-in) and a write is gated on its **reverse-dependency closure** — what the action can reach, not just what string it contains. The default policy is the substring + path gate; the reach closure is opt-in.
128
+ - **The Jail** closes the gap the gate cannot see: the *code inside* an allowed command. On macOS the native primitive is `sandbox-exec` (Seatbelt) — no Docker assumed.
129
+ - **The Ledger** is the testimony: an append-only, hash-chained record where mutating or reordering any past entry breaks the re-link.
130
+ - **The Receipt** is the closure artifact. Its verifier recomputes the chain from genesis *and* recomputes the receipt's own content hash. `persist()` runs that verifier as a write-time round-trip and **raises on failure**, so a corrupt write can never be reported as success.
131
+
132
+ The Cell is the keystone, and it composes at every scale: one tool call, one agent, or a whole team sharing one ledger. The kernel does not change when the model does. Subclass `Cell` and override `_execute` to govern your own tool surface — the gate + jail + ledger wrapping is inherited unchanged.
133
+
134
+ ---
135
+
136
+ ## What it does NOT do
137
+
138
+ This section is the trust anchor. Read it before you build on this.
139
+
140
+ - **It is a reference governance primitive, not a hardened production sandbox.** It is the smallest honest version of the idea — clear enough to read end-to-end, strong enough to be useful, not a certified security product.
141
+ - **The in-language jail is macOS-only.** Seatbelt is the native primitive. On Linux you plug in firejail, nsjail, or a container. The gate and ledger are platform-independent; only the jail is swapped.
142
+ - **It is tamper-EVIDENT, not tamper-PROOF.** The ledger core is a **keyless sha256 hash chain** — nothing in the agent's execution path is signed. It proves *internal consistency* — that no entry was altered or reordered — **not authorship.** An attacker who can rewrite the entire file from genesis can produce a consistent chain. The core ledger is **not cryptographic signatures.** There is an **optional, verification-only ed25519 operator-attestation overlay** (`operator_attest.py`, opt-in via `deponent[attest]`) that verifies an operator's out-of-band signature over a run; it signs nothing the agent does. The core stays keyless on purpose — asymmetric signing in the execution path is a deliberate non-goal.
143
+ - **The default gate policy is a sane coding-agent sandbox, not a universal security policy.** It is overridable per instance (`deny=`, `allow_heads=`). Tune it for your tool surface.
144
+
145
+ State the limits, or the guarantees mean nothing.
146
+
147
+ ---
148
+
149
+ ## Proven
150
+
151
+ The suite exercises the gate, live macOS Seatbelt confinement, ledger integrity,
152
+ receipts, reconciliation, claims, build profiles, the public playground, and the
153
+ conformance harness. Platform- or optional-capability checks skip explicitly when
154
+ their real backend is unavailable; they are never replaced with a passing mock.
155
+
156
+ Run `python3 -m pytest -q` to get the current count and host-specific skip set.
157
+ `make self-gate-live` drives a real local build through the same gate, jail, and
158
+ ledger path and emits receipts for inspection.
159
+
160
+ **The `GAK-conformant` mark.** Passing the harness is earnable infrastructure, not a self-claim. `python3 -m deponent.badge certify --kernel deponent` emits a self-contained badge (the SVG above), a markdown snippet, and a JSON receipt carrying a sha256 `clauses_digest` over the per-clause results — so the badge maps to a specific, reproducible outcome. Re-derive it yourself, fail-closed:
161
+
162
+ ```sh
163
+ python3 -m deponent.badge verify --kernel deponent # exit 0 only when the mark is earned
164
+ ```
165
+
166
+ Any kernel that implements the small adapter and passes the clause set earns the same mark; a kernel that fails gets a red "not conformant" badge and a non-zero exit. The badge is generated locally — no shields.io, no network — because a sovereignty product shouldn't phone home to prove it passed.
167
+
168
+ **Seatbelt escape-proofs — two kinds, kept separate so the claim is exactly as strong as the evidence.** (1) **Committed live canaries** (`canaries/CANARIES.md`, J1–J8): network exfil, raw-socket egress, writes outside the sandbox, child-process escape, memory-bomb, and wall-clock runaway — each a real test run against the live macOS sandbox, 0 through; if a canary stops holding, the suite goes red. (2) **Manual development red-team** — during development I hand-ran Seatbelt bypasses (`osascript 'do shell script'`, `launchctl submit`, loopback `/dev/tcp`, DNS, symlink/hardlink/rename writes-out), all blocked; these **shaped the gate denylist and the Seatbelt profile but are not committed tests** — take them as reported, not reproducible from the repo.
169
+
170
+ **Recompute-not-trust receipts:** the verifier does not read a stored boolean. It re-links the chain from genesis and recomputes the receipt's content hash over its canonical body. `persist()` runs that verifier on write and raises on failure. This is the project's core rule made mechanical: *self-reported health is never the evidence.*
171
+
172
+ ---
173
+
174
+ ## Governed agent team example
175
+
176
+ `examples/governed_team.py` shows an Architect, a gated Builder, and an advisory
177
+ Reviewer sharing one ledger. The example is model-agnostic through
178
+ `examples/backends.py`; use an Ollama or MLX backend, or add your own. Closure is
179
+ an out-of-band test run plus an intact ledger—not the Builder saying “done.”
180
+
181
+ ```bash
182
+ # Ollama (any tool-capable coder)
183
+ python3 examples/governed_team.py --backend ollama --model qwen3-coder:30b \
184
+ --goal "Implement reverse_words(s): reverse word order, collapse runs of spaces."
185
+
186
+ # Local MLX North Mini Code (Apple Silicon)
187
+ DEPONENT_MLX_MODEL=mlx-community/North-Mini-Code-1.0-4bit \
188
+ python3 examples/governed_team.py --backend mlx --goal "..."
189
+ ```
190
+
191
+ ---
192
+
193
+ ## Install + run the tests
194
+
195
+ ```bash
196
+ git clone <repo> deponent && cd deponent
197
+ python3 -m pip install -e . # or just run from the repo — the core needs no install
198
+
199
+ make test # current suite; real-backend skips are host-dependent
200
+ make demo # the minimal testify demo, no model needed
201
+ ```
202
+
203
+ The kernel has **zero third-party dependencies.** Only the example team needs a model runtime; the kernel does not.
204
+
205
+ ### Run it in Docker (any platform)
206
+
207
+ ```bash
208
+ docker build -t deponent .
209
+ docker run --rm deponent # scores the kernel against its own GAK standard -> CONFORMANT
210
+ docker run --rm deponent make test # run the suite in-container
211
+ ```
212
+
213
+ The gate, ledger, and receipts are platform-independent; OS confinement is macOS Seatbelt on the host or the Docker backend elsewhere (escape-proofs live-verified, `tests/test_jail_backends.py`).
214
+
215
+ ---
216
+
217
+ ## Stewardship
218
+
219
+ Deponent is an open-source project from
220
+ [Centennial Defense Systems](https://centennialdefense.systems), maintained by
221
+ Christopher “CJ” Chanhnourack. The repository is the complete public reference
222
+ kernel; its claims are limited to behavior you can reproduce from the source.
223
+
224
+ ---
225
+
226
+ ## Support
227
+
228
+ Report vulnerabilities through [SECURITY.md](SECURITY.md). General support and
229
+ contributions are best-effort; no response-time SLA is offered.
230
+
231
+ ---
232
+
233
+ ## License
234
+
235
+ Apache-2.0 — including the patent grant.
236
+
237
+ The license applies to the public source and includes the Apache 2.0 patent grant.