panoptes-observe 0.1.0__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.
- panoptes_observe-0.1.0/LICENSE +201 -0
- panoptes_observe-0.1.0/PKG-INFO +359 -0
- panoptes_observe-0.1.0/README.md +326 -0
- panoptes_observe-0.1.0/panoptes/__init__.py +66 -0
- panoptes_observe-0.1.0/panoptes/capture.py +176 -0
- panoptes_observe-0.1.0/panoptes/cli.py +532 -0
- panoptes_observe-0.1.0/panoptes/db.py +1628 -0
- panoptes_observe-0.1.0/panoptes/default_policies/no-prod-access.yaml +22 -0
- panoptes_observe-0.1.0/panoptes/hermes_plugin.py +637 -0
- panoptes_observe-0.1.0/panoptes/install_hermes_plugin.py +179 -0
- panoptes_observe-0.1.0/panoptes/policy.py +1236 -0
- panoptes_observe-0.1.0/panoptes/providers/__init__.py +56 -0
- panoptes_observe-0.1.0/panoptes/providers/anthropic.py +501 -0
- panoptes_observe-0.1.0/panoptes/providers/base.py +292 -0
- panoptes_observe-0.1.0/panoptes/providers/gemini.py +573 -0
- panoptes_observe-0.1.0/panoptes/providers/openai.py +1210 -0
- panoptes_observe-0.1.0/panoptes/proxy.py +2424 -0
- panoptes_observe-0.1.0/panoptes/schema.py +1050 -0
- panoptes_observe-0.1.0/panoptes_observe.egg-info/PKG-INFO +359 -0
- panoptes_observe-0.1.0/panoptes_observe.egg-info/SOURCES.txt +32 -0
- panoptes_observe-0.1.0/panoptes_observe.egg-info/dependency_links.txt +1 -0
- panoptes_observe-0.1.0/panoptes_observe.egg-info/entry_points.txt +2 -0
- panoptes_observe-0.1.0/panoptes_observe.egg-info/requires.txt +9 -0
- panoptes_observe-0.1.0/panoptes_observe.egg-info/top_level.txt +1 -0
- panoptes_observe-0.1.0/pyproject.toml +56 -0
- panoptes_observe-0.1.0/setup.cfg +4 -0
- panoptes_observe-0.1.0/tests/test_capture.py +1113 -0
- panoptes_observe-0.1.0/tests/test_cli.py +231 -0
- panoptes_observe-0.1.0/tests/test_db.py +2360 -0
- panoptes_observe-0.1.0/tests/test_install_hermes_plugin.py +53 -0
- panoptes_observe-0.1.0/tests/test_policy.py +1927 -0
- panoptes_observe-0.1.0/tests/test_provider_security.py +594 -0
- panoptes_observe-0.1.0/tests/test_proxy.py +2073 -0
- panoptes_observe-0.1.0/tests/test_schema.py +1108 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: panoptes-observe
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Adapter-based agent observability, local audit trails, and policy gates.
|
|
5
|
+
Author-email: Miggy <miguel@throttlai.com>
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/miggy-code/Panoptes
|
|
8
|
+
Project-URL: Repository, https://github.com/miggy-code/Panoptes
|
|
9
|
+
Project-URL: Issues, https://github.com/miggy-code/Panoptes/issues
|
|
10
|
+
Project-URL: Changelog, https://github.com/miggy-code/Panoptes/blob/main/CHANGELOG.md
|
|
11
|
+
Project-URL: Security, https://github.com/miggy-code/Panoptes/security/policy
|
|
12
|
+
Keywords: agent,ai,audit,security,observability,claude-code,codex,hermes,antigravity,policy
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
21
|
+
Classifier: Topic :: Security
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Requires-Dist: httpx<1,>=0.27
|
|
26
|
+
Requires-Dist: PyYAML<7,>=6
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
Requires-Dist: pytest<9,>=8; extra == "dev"
|
|
29
|
+
Provides-Extra: release
|
|
30
|
+
Requires-Dist: build<2,>=1.2; extra == "release"
|
|
31
|
+
Requires-Dist: twine<7,>=6; extra == "release"
|
|
32
|
+
Dynamic: license-file
|
|
33
|
+
|
|
34
|
+
# Panoptes
|
|
35
|
+
|
|
36
|
+
<p align="center">
|
|
37
|
+
<strong>Agent observability, local audit trails, and policy gates.</strong><br>
|
|
38
|
+
A local-first view of OpenAI-, Anthropic-, Gemini-, and Hermes-based workflows.
|
|
39
|
+
</p>
|
|
40
|
+
|
|
41
|
+
<p align="center">
|
|
42
|
+
<a href="https://github.com/miggy-code/Panoptes/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/miggy-code/Panoptes/actions/workflows/ci.yml/badge.svg"></a>
|
|
43
|
+
<a href="LICENSE"><img alt="Apache 2.0" src="https://img.shields.io/badge/license-Apache%202.0-blue.svg"></a>
|
|
44
|
+
<img alt="Python 3.10+" src="https://img.shields.io/badge/python-3.10%2B-3776AB.svg">
|
|
45
|
+
</p>
|
|
46
|
+
|
|
47
|
+
Panoptes gives AI-agent traffic one place to land. Point a supported model
|
|
48
|
+
client at the local reverse proxy and Panoptes turns requests, responses, tool
|
|
49
|
+
instructions, policy decisions, and cost data into a queryable SQLite audit
|
|
50
|
+
trail. Hermes integrations can also report lifecycle events and ask Panoptes
|
|
51
|
+
for a synchronous pre-tool decision.
|
|
52
|
+
|
|
53
|
+
Panoptes runs locally with no external service. It records model API traffic
|
|
54
|
+
and host-reported lifecycle events; tool calls emitted by a model remain
|
|
55
|
+
requests unless the host reports an execution outcome.
|
|
56
|
+
|
|
57
|
+
## Why
|
|
58
|
+
|
|
59
|
+
Agent logs tend to be provider-specific, short-lived, and hard to compare.
|
|
60
|
+
Panoptes is built to answer a smaller set of operational questions well:
|
|
61
|
+
|
|
62
|
+
- Which model requests and tool instructions crossed the controlled API path?
|
|
63
|
+
- Which tool requests did a native adapter authorize or deny?
|
|
64
|
+
- Which policy snapshot informed each recorded authorization decision or violation?
|
|
65
|
+
- Has the locally stored event history changed since a checkpoint?
|
|
66
|
+
|
|
67
|
+
Every supported adapter writes the same event shape. Every event carries
|
|
68
|
+
capture metadata describing where it came from and how strong that observation
|
|
69
|
+
is. That gives you one dependable record for tracing agent behavior, reviewing
|
|
70
|
+
policy decisions, investigating incidents, and testing ideas—without the
|
|
71
|
+
operational weight of a distributed observability stack.
|
|
72
|
+
|
|
73
|
+
## Quick Start
|
|
74
|
+
|
|
75
|
+
Install Panoptes as an isolated command-line application:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
pipx install panoptes-observe
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Or use `uv`:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
uv tool install panoptes-observe
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
The distribution is named `panoptes-observe`; the installed command remains
|
|
88
|
+
`panoptes`. To work on the source instead:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
git clone https://github.com/miggy-code/Panoptes.git
|
|
92
|
+
cd Panoptes
|
|
93
|
+
python -m pip install -e ".[dev]"
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Capture model API traffic
|
|
97
|
+
|
|
98
|
+
Start Panoptes in one terminal:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
panoptes proxy --port 8081
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Then point a supported client at it from another terminal:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
ANTHROPIC_BASE_URL=http://127.0.0.1:8081 claude
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
After the run, inspect what Panoptes recorded:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
panoptes status
|
|
114
|
+
panoptes query --event-type tool_call --limit 10
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Observation is fail-open by default. For enforcement, provide a valid policy
|
|
118
|
+
directory and choose `fail_closed` explicitly:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
panoptes proxy \
|
|
122
|
+
--port 8081 \
|
|
123
|
+
--policies-dir ~/.panoptes/policies \
|
|
124
|
+
--policy-failure-mode fail_closed
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
The proxy only binds to loopback. Client sockets have a 30-second I/O timeout
|
|
128
|
+
and the server accepts at most 64 concurrent requests by default; tune these
|
|
129
|
+
with `--client-timeout` and `--max-concurrent-requests`.
|
|
130
|
+
|
|
131
|
+
### Install Hermes lifecycle hooks
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
python -m panoptes.install_hermes_plugin
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
The installer adds lifecycle hooks for `agent:start`, `agent:step`, and
|
|
138
|
+
`agent:end`. Those hooks observe; they do not block. Local tool enforcement
|
|
139
|
+
requires the Hermes host to call `authorize_tool_call()` synchronously and
|
|
140
|
+
honor `allowed=False`. In `fail_closed` mode, an authorization whose evidence
|
|
141
|
+
cannot be stored is denied.
|
|
142
|
+
|
|
143
|
+
### Query and verify
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
panoptes query --agent hermes --event-type agent_step --limit 50
|
|
147
|
+
panoptes query --agent hermes --event-type decision_point --limit 50
|
|
148
|
+
panoptes session <session-id>
|
|
149
|
+
panoptes evidence <event-id>
|
|
150
|
+
|
|
151
|
+
# Verify local hash links and export a checkpoint for separate storage
|
|
152
|
+
panoptes verify
|
|
153
|
+
panoptes checkpoint > checkpoint.json
|
|
154
|
+
|
|
155
|
+
# Later, prove that separately stored checkpoint is a prefix of current history
|
|
156
|
+
panoptes verify --checkpoint checkpoint.json
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Read-only database commands require an existing initialized audit database. A
|
|
160
|
+
missing, mistyped, or empty `--db-path` exits with status 2 instead of creating
|
|
161
|
+
a new database.
|
|
162
|
+
|
|
163
|
+
## Architecture
|
|
164
|
+
|
|
165
|
+
```text
|
|
166
|
+
Enforcement plane: adapter → normalize → policy gate → model/API boundary
|
|
167
|
+
│
|
|
168
|
+
Audit plane: adapter → normalized event → SQLite → CLI
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
The design has two intentionally small paths. The enforcement path makes a
|
|
172
|
+
decision before a controlled boundary. The audit path commits normalized
|
|
173
|
+
evidence to SQLite and keeps it available through the CLI. `capture.py`
|
|
174
|
+
describes each adapter's fidelity so consumers can distinguish a model
|
|
175
|
+
instruction from a host-reported or pre-authorized action.
|
|
176
|
+
|
|
177
|
+
### Capture adapters
|
|
178
|
+
|
|
179
|
+
| Adapter | Observes | Enforcement boundary |
|
|
180
|
+
|---------|----------|----------------------|
|
|
181
|
+
| Reverse proxy | Supported model requests, responses, tool instructions, and client-reported tool results | Request preflight and fully buffered model responses |
|
|
182
|
+
| Hermes plugin | Host-reported `agent_start`, `agent_step`, and `agent_end` events | Optional host-callable pre-tool authorizer, recorded as `decision_point` |
|
|
183
|
+
|
|
184
|
+
The reverse proxy is a real boundary only for traffic that crosses it. It
|
|
185
|
+
cannot see an arbitrary local file read after the agent receives a response,
|
|
186
|
+
and an agent can bypass it if it still holds provider credentials. Stronger
|
|
187
|
+
deployments must isolate those credentials and block direct provider egress.
|
|
188
|
+
At the boundary itself, Panoptes rejects ambiguous JSON instead of guessing
|
|
189
|
+
which duplicate value should inform a policy decision.
|
|
190
|
+
|
|
191
|
+
For reliable cross-request timelines, adapters should send
|
|
192
|
+
`X-Panoptes-Session: <stable-session-id>`. Without it, each exchange is
|
|
193
|
+
isolated. `X-Panoptes-Agent` and session headers are client assertions, not
|
|
194
|
+
authenticated workload identities, and are removed before upstream forwarding.
|
|
195
|
+
|
|
196
|
+
### Audit schema
|
|
197
|
+
|
|
198
|
+
```json
|
|
199
|
+
{
|
|
200
|
+
"event_id": "uuid",
|
|
201
|
+
"timestamp": "2026-07-17T14:30:00.000Z",
|
|
202
|
+
"agent": {
|
|
203
|
+
"type": "claude_code",
|
|
204
|
+
"session_id": "abc123",
|
|
205
|
+
"run_id": "run456"
|
|
206
|
+
},
|
|
207
|
+
"event_type": "tool_call",
|
|
208
|
+
"action": {
|
|
209
|
+
"tool_name": "terminal",
|
|
210
|
+
"parameters": {"command": "kubectl get pods -n prod"},
|
|
211
|
+
"data_accessed": ["infra", "prod"]
|
|
212
|
+
},
|
|
213
|
+
"outcome": {
|
|
214
|
+
"status": "pending",
|
|
215
|
+
"summary": "Model proposed this tool call; local execution was not observed"
|
|
216
|
+
},
|
|
217
|
+
"context": {
|
|
218
|
+
"turn_number": 12,
|
|
219
|
+
"capture": {
|
|
220
|
+
"adapter": "http_proxy",
|
|
221
|
+
"observation_boundary": "model_api",
|
|
222
|
+
"execution_observed": false
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
"cost": {"tokens_in": 800, "tokens_out": 150}
|
|
226
|
+
}
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
Before an event reaches disk, Panoptes validates its identifiers, timestamps,
|
|
230
|
+
outcomes, and costs; redacts common secret forms; and derives heuristic
|
|
231
|
+
data-access tags from the action. Those tags are useful inputs for local policy
|
|
232
|
+
and investigation, but they can be wrong. Treat both redaction and
|
|
233
|
+
classification as defense in depth, not as complete data-loss prevention.
|
|
234
|
+
|
|
235
|
+
Request events include complete bounded summaries of requested client-side,
|
|
236
|
+
provider-hosted, and unknown tool capabilities. Client-executed model tool
|
|
237
|
+
proposals remain `pending`; recognized provider-hosted actions record whether
|
|
238
|
+
they completed, failed, or remain pending upstream. Hosted result excerpts are
|
|
239
|
+
redacted and bounded. Unknown requested tool types are denied in
|
|
240
|
+
`fail_closed`; `fail_open` records and logs a warning.
|
|
241
|
+
|
|
242
|
+
### Policy engine
|
|
243
|
+
|
|
244
|
+
Policies are YAML files in `~/.panoptes/policies/`:
|
|
245
|
+
|
|
246
|
+
```yaml
|
|
247
|
+
name: "no-prod-access"
|
|
248
|
+
description: "Block tool calls classified as production access"
|
|
249
|
+
enabled: true
|
|
250
|
+
scope:
|
|
251
|
+
agents: ["*"]
|
|
252
|
+
rule:
|
|
253
|
+
event_type: "tool_call"
|
|
254
|
+
conditions:
|
|
255
|
+
- field: "action.data_accessed"
|
|
256
|
+
operator: "contains"
|
|
257
|
+
value: "prod"
|
|
258
|
+
logic: "AND"
|
|
259
|
+
action: block
|
|
260
|
+
message: "Production access blocked. Request approval first."
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
- Operators: `==`, `!=`, `contains`, `in`, `matches`, `gt`, `lt`, `gte`, `lte`
|
|
264
|
+
- Logic: `AND` / `OR`
|
|
265
|
+
- Scopes: agent and session
|
|
266
|
+
- Actions: `allow`, `warn`, `block`
|
|
267
|
+
- Loading: one validated, content-digested policy set at startup; restart the
|
|
268
|
+
proxy after changing policy files
|
|
269
|
+
- Failure posture: explicit `fail_open` or `fail_closed`
|
|
270
|
+
|
|
271
|
+
Policies are strict on purpose. Unknown fields, malformed conditions, duplicate
|
|
272
|
+
YAML keys, an empty directory, or any invalid file make the set fail to load.
|
|
273
|
+
That turns a typo into a visible startup problem instead of a silently weaker
|
|
274
|
+
rule.
|
|
275
|
+
|
|
276
|
+
## Supported Protocols and Adapters
|
|
277
|
+
|
|
278
|
+
| Protocol / adapter | Capture method | Boundary |
|
|
279
|
+
|--------------------|----------------|----------|
|
|
280
|
+
| Anthropic Messages API | Reverse proxy | Model API |
|
|
281
|
+
| OpenAI Chat Completions and Responses APIs | Reverse proxy | Model API |
|
|
282
|
+
| Gemini `generateContent` and `streamGenerateContent` | Reverse proxy | Model API |
|
|
283
|
+
| Hermes Agent | Native plugin | Host-reported lifecycle; optional pre-tool authorization |
|
|
284
|
+
|
|
285
|
+
An agent is proxy-compatible only if it lets you replace its model API base URL
|
|
286
|
+
and emits a supported protocol. That is not equivalent to a tested native
|
|
287
|
+
integration.
|
|
288
|
+
|
|
289
|
+
Current action parsing covers OpenAI function/custom/computer/shell/apply-patch
|
|
290
|
+
and hosted-tool output items, Anthropic client and server tool blocks, and
|
|
291
|
+
Gemini function, built-in tool, and code-execution parts. Unknown tool
|
|
292
|
+
declarations or response item types never become an implicit safe result:
|
|
293
|
+
`fail_closed` denies them, while `fail_open` records degraded inspection.
|
|
294
|
+
Provider features introduced after this release, including OpenAI programmatic
|
|
295
|
+
tool-calling output, require an adapter update and adversarial fixtures before
|
|
296
|
+
they are supported.
|
|
297
|
+
|
|
298
|
+
## Commands
|
|
299
|
+
|
|
300
|
+
```text
|
|
301
|
+
panoptes proxy Start the loopback-only model-API reverse proxy
|
|
302
|
+
panoptes --version Show the installed Panoptes version
|
|
303
|
+
panoptes status Show event statistics
|
|
304
|
+
panoptes query Query events by agent, type, tool, or time
|
|
305
|
+
panoptes session <id> Show up to 10,000 newest session events
|
|
306
|
+
panoptes evidence <id> Reconstruct a related decision path
|
|
307
|
+
panoptes verify Verify the local chain or a separately stored checkpoint
|
|
308
|
+
panoptes checkpoint Print the current chain checkpoint
|
|
309
|
+
panoptes policy list List the active policy snapshot
|
|
310
|
+
panoptes policy add Add a policy file
|
|
311
|
+
panoptes policy check Scan a bounded newest-event selection; errors exit nonzero
|
|
312
|
+
panoptes policy test Test one policy against one event
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
## Project Status
|
|
316
|
+
|
|
317
|
+
| Component | Status |
|
|
318
|
+
|-----------|--------|
|
|
319
|
+
| Model-API reverse proxy | Alpha |
|
|
320
|
+
| Hermes lifecycle plugin and authorizer API | Alpha |
|
|
321
|
+
| SQLite storage and local hash chain | Available; external checkpoints remain operator-managed |
|
|
322
|
+
| Query, policy, and integrity CLI | Available |
|
|
323
|
+
| YAML policy engine | Alpha |
|
|
324
|
+
| Mandatory local execution broker | Out of scope today |
|
|
325
|
+
|
|
326
|
+
The project targets Python 3.10 through 3.13 and runs its tests, distribution
|
|
327
|
+
validation, and wheel smoke test in GitHub Actions. Passing tests do not expand
|
|
328
|
+
the adapter guarantees described in [SECURITY.md](SECURITY.md).
|
|
329
|
+
|
|
330
|
+
Runtime dependencies are intentionally small: `httpx` and `PyYAML`.
|
|
331
|
+
|
|
332
|
+
## Development
|
|
333
|
+
|
|
334
|
+
Create an environment, install the development extra, and run the suite:
|
|
335
|
+
|
|
336
|
+
```bash
|
|
337
|
+
python -m venv .venv
|
|
338
|
+
source .venv/bin/activate
|
|
339
|
+
python -m pip install -e ".[dev,release]"
|
|
340
|
+
python -m pytest -q
|
|
341
|
+
python -m build
|
|
342
|
+
python -m twine check --strict dist/*
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
The tests are local and network-independent. A change is ready to review when
|
|
346
|
+
the full suite passes and `git diff --check` is clean. Release ownership and
|
|
347
|
+
the tagged publishing flow are documented in [RELEASING.md](RELEASING.md).
|
|
348
|
+
|
|
349
|
+
## Contributing
|
|
350
|
+
|
|
351
|
+
Bug reports, protocol fixtures, and focused adapters are welcome. The most
|
|
352
|
+
useful contributions strengthen an existing boundary: native pre-execution
|
|
353
|
+
adapters, external append-only audit sinks, signed policy distribution, and
|
|
354
|
+
adversarial provider fixtures. For security issues, please use the private
|
|
355
|
+
reporting path in [SECURITY.md](SECURITY.md).
|
|
356
|
+
|
|
357
|
+
## License
|
|
358
|
+
|
|
359
|
+
Apache 2.0 — see [LICENSE](LICENSE).
|