varden 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.
- varden-0.1.0/AUTHORS +1 -0
- varden-0.1.0/LICENSE +29 -0
- varden-0.1.0/NOTICE +9 -0
- varden-0.1.0/PKG-INFO +282 -0
- varden-0.1.0/README.md +234 -0
- varden-0.1.0/pyproject.toml +77 -0
- varden-0.1.0/setup.cfg +4 -0
- varden-0.1.0/tests/test_api_behaviour.py +101 -0
- varden-0.1.0/tests/test_demo_scripts.py +15 -0
- varden-0.1.0/tests/test_langchain_docs_and_demos.py +19 -0
- varden-0.1.0/tests/test_langchain_integration.py +89 -0
- varden-0.1.0/tests/test_mcp_server.py +170 -0
- varden-0.1.0/tests/test_new_features.py +48 -0
- varden-0.1.0/tests/test_oss_boundaries.py +59 -0
- varden-0.1.0/tests/test_policy_packs.py +146 -0
- varden-0.1.0/tests/test_sdk.py +68 -0
- varden-0.1.0/tests/test_session_parse.py +21 -0
- varden-0.1.0/tests/test_smoke.py +4 -0
- varden-0.1.0/tests/test_sql_policy_pack.py +108 -0
- varden-0.1.0/tests/test_ui_shell.py +33 -0
- varden-0.1.0/tests/test_varden_monitor.py +205 -0
- varden-0.1.0/varden/__init__.py +21 -0
- varden-0.1.0/varden/alerts.py +51 -0
- varden-0.1.0/varden/api.py +23 -0
- varden-0.1.0/varden/app_factory.py +812 -0
- varden-0.1.0/varden/auth.py +166 -0
- varden-0.1.0/varden/blaze.py +28 -0
- varden-0.1.0/varden/classification.py +166 -0
- varden-0.1.0/varden/cli.py +152 -0
- varden-0.1.0/varden/config.py +105 -0
- varden-0.1.0/varden/db.py +133 -0
- varden-0.1.0/varden/export.py +36 -0
- varden-0.1.0/varden/health.py +15 -0
- varden-0.1.0/varden/idempotency.py +13 -0
- varden-0.1.0/varden/intelligence.py +221 -0
- varden-0.1.0/varden/langchain.py +1 -0
- varden-0.1.0/varden/metrics.py +23 -0
- varden-0.1.0/varden/models.py +66 -0
- varden-0.1.0/varden/policy.py +315 -0
- varden-0.1.0/varden/queue.py +54 -0
- varden-0.1.0/varden/ratelimit.py +62 -0
- varden-0.1.0/varden/redaction.py +7 -0
- varden-0.1.0/varden/sdk.py +35 -0
- varden-0.1.0/varden/stores.py +414 -0
- varden-0.1.0/varden/web/app/assets/app.css +1 -0
- varden-0.1.0/varden/web/app/assets/app.js +40 -0
- varden-0.1.0/varden/web/app/index.html +13 -0
- varden-0.1.0/varden/web/assets/varden-icon-128.png +0 -0
- varden-0.1.0/varden/web/assets/varden-icon-legacy.png +0 -0
- varden-0.1.0/varden/web/assets/varden-icon-old.png +0 -0
- varden-0.1.0/varden/web/assets/varden-icon.png +0 -0
- varden-0.1.0/varden/web/assets/varden-logo.png +0 -0
- varden-0.1.0/varden/web/dashboard.html +15 -0
- varden-0.1.0/varden/web/rules.html +15 -0
- varden-0.1.0/varden/worker_runtime.py +44 -0
- varden-0.1.0/varden/worker_service.py +32 -0
- varden-0.1.0/varden.egg-info/PKG-INFO +282 -0
- varden-0.1.0/varden.egg-info/SOURCES.txt +73 -0
- varden-0.1.0/varden.egg-info/dependency_links.txt +1 -0
- varden-0.1.0/varden.egg-info/entry_points.txt +5 -0
- varden-0.1.0/varden.egg-info/requires.txt +25 -0
- varden-0.1.0/varden.egg-info/top_level.txt +5 -0
- varden-0.1.0/varden_langchain/__init__.py +17 -0
- varden-0.1.0/varden_langchain/integration.py +398 -0
- varden-0.1.0/varden_mcp/__init__.py +12 -0
- varden-0.1.0/varden_mcp/_client.py +16 -0
- varden-0.1.0/varden_mcp/server.py +316 -0
- varden-0.1.0/varden_monitor/__init__.py +4 -0
- varden-0.1.0/varden_monitor/cli.py +120 -0
- varden-0.1.0/varden_monitor/payload.py +90 -0
- varden-0.1.0/varden_monitor/protect_run.py +200 -0
- varden-0.1.0/varden_monitor/session.py +146 -0
- varden-0.1.0/varden_monitor/shim_runner.py +179 -0
- varden-0.1.0/varden_sdk/__init__.py +29 -0
- varden-0.1.0/varden_sdk/sdk.py +47 -0
varden-0.1.0/AUTHORS
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Mark Griffiths - Creator and Maintainer
|
varden-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
GNU AFFERO GENERAL PUBLIC LICENSE
|
|
2
|
+
Version 3 or later (AGPL-3.0-or-later)
|
|
3
|
+
|
|
4
|
+
Varden Core Platform
|
|
5
|
+
Copyright (c) 2026 Mark Griffiths
|
|
6
|
+
|
|
7
|
+
This repository's core platform components are licensed under the GNU Affero General Public License,
|
|
8
|
+
version 3 or (at your option) any later version.
|
|
9
|
+
|
|
10
|
+
You may obtain a copy of the license at:
|
|
11
|
+
https://www.gnu.org/licenses/agpl-3.0.txt
|
|
12
|
+
|
|
13
|
+
Unless required by applicable law or agreed to in writing, the software is distributed on an
|
|
14
|
+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
See the AGPL license text at the URL above for the specific language governing permissions and
|
|
16
|
+
limitations under the license.
|
|
17
|
+
|
|
18
|
+
Scope of this root license:
|
|
19
|
+
- varden/ (core platform, control plane, policy engine, dashboard backend, packaged UI)
|
|
20
|
+
- frontend/ (dashboard source)
|
|
21
|
+
- all other repository content unless a subdirectory contains its own LICENSE file
|
|
22
|
+
|
|
23
|
+
Exceptions:
|
|
24
|
+
- sdks/python/ is licensed under Apache License 2.0
|
|
25
|
+
- sdks/java/ is licensed under Apache License 2.0
|
|
26
|
+
- sdks/rust/ is licensed under Apache License 2.0
|
|
27
|
+
|
|
28
|
+
Commercial licensing is available. See COMMERCIAL.md.
|
|
29
|
+
Brand usage is restricted. See TRADEMARK.md.
|
varden-0.1.0/NOTICE
ADDED
varden-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: varden
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A self-hosted runtime firewall for AI agents
|
|
5
|
+
Author: Mark Griffiths
|
|
6
|
+
License: AGPL-3.0-or-later
|
|
7
|
+
Project-URL: Homepage, https://github.com/markndg/varden
|
|
8
|
+
Project-URL: Repository, https://github.com/markndg/varden
|
|
9
|
+
Project-URL: Issues, https://github.com/markndg/varden/issues
|
|
10
|
+
Project-URL: Changelog, https://github.com/markndg/varden/commits/main
|
|
11
|
+
Keywords: ai,agents,llm,security,firewall,observability,runtime,guardrails,policy
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
|
|
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: Topic :: Security
|
|
20
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
21
|
+
Classifier: Topic :: System :: Monitoring
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
License-File: NOTICE
|
|
26
|
+
License-File: AUTHORS
|
|
27
|
+
Requires-Dist: fastapi>=0.111
|
|
28
|
+
Requires-Dist: uvicorn>=0.30
|
|
29
|
+
Requires-Dist: httpx>=0.27
|
|
30
|
+
Requires-Dist: PyJWT>=2.8
|
|
31
|
+
Provides-Extra: postgres
|
|
32
|
+
Requires-Dist: psycopg[binary]>=3.1; extra == "postgres"
|
|
33
|
+
Provides-Extra: langchain
|
|
34
|
+
Requires-Dist: langchain>=0.2; extra == "langchain"
|
|
35
|
+
Requires-Dist: langchain-core>=0.2; extra == "langchain"
|
|
36
|
+
Provides-Extra: mcp
|
|
37
|
+
Requires-Dist: mcp[cli]>=1.2; extra == "mcp"
|
|
38
|
+
Requires-Dist: httpx>=0.27; extra == "mcp"
|
|
39
|
+
Provides-Extra: test
|
|
40
|
+
Requires-Dist: pytest>=8; extra == "test"
|
|
41
|
+
Requires-Dist: mcp[cli]>=1.2; extra == "test"
|
|
42
|
+
Provides-Extra: all
|
|
43
|
+
Requires-Dist: psycopg[binary]>=3.1; extra == "all"
|
|
44
|
+
Requires-Dist: langchain>=0.2; extra == "all"
|
|
45
|
+
Requires-Dist: langchain-core>=0.2; extra == "all"
|
|
46
|
+
Requires-Dist: mcp[cli]>=1.2; extra == "all"
|
|
47
|
+
Dynamic: license-file
|
|
48
|
+
|
|
49
|
+
# Varden
|
|
50
|
+
|
|
51
|
+

|
|
52
|
+
|
|
53
|
+
[](https://github.com/markndg/varden/blob/main/LICENSE) [](https://github.com/markndg/varden/releases) [](https://github.com/markndg/varden/actions) [](https://github.com/markndg/varden) [](https://www.python.org) [](https://github.com/markndg/varden/blob/main/COMMERCIAL.md)
|
|
54
|
+
|
|
55
|
+
> Using Varden? I read everything — [open a blank issue titled "Using this"](https://github.com/markndg/varden/issues/new)
|
|
56
|
+
Your developers are using Cursor. It's calling APIs, running git commands,
|
|
57
|
+
talking to external services, executing shell commands.
|
|
58
|
+
|
|
59
|
+
Do you know what it's doing?
|
|
60
|
+
|
|
61
|
+
Now multiply that by a team of ten, all running AI agents with MCP access to your
|
|
62
|
+
infrastructure. Nobody has a list of what those agents can touch. Nobody sees it when
|
|
63
|
+
one does something unexpected.
|
|
64
|
+
|
|
65
|
+
**Varden is the thing watching.**
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Try it now
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
# 1. Install
|
|
73
|
+
git clone https://github.com/markndg/varden
|
|
74
|
+
cd varden
|
|
75
|
+
python -m venv .venv && source .venv/bin/activate
|
|
76
|
+
pip install -e .
|
|
77
|
+
|
|
78
|
+
# 2. Start Varden
|
|
79
|
+
python -m varden.api --config examples/dev.env
|
|
80
|
+
|
|
81
|
+
# 3. In a second terminal — wrap Cursor
|
|
82
|
+
export VARDEN_BASE_URL=http://127.0.0.1:8000
|
|
83
|
+
export VARDEN_API_KEY=admin-demo-key
|
|
84
|
+
varden session . -- cursor .
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Subprocess calls, HTTP requests, and LLM calls that Cursor makes now appear in your
|
|
88
|
+
dashboard — blocked, warned, or logged according to your policy.
|
|
89
|
+
|
|
90
|
+
> **Note:** Varden intercepts via a PATH shim. Child processes Cursor spawns will
|
|
91
|
+
> be covered; processes Cursor launches outside the shell PATH may not be. Use an
|
|
92
|
+
> interactive `varden session` shell for broadest coverage.
|
|
93
|
+
|
|
94
|
+

|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## One line protects your Python agents
|
|
99
|
+
|
|
100
|
+
```python
|
|
101
|
+
import varden
|
|
102
|
+
import requests
|
|
103
|
+
|
|
104
|
+
varden.protect()
|
|
105
|
+
|
|
106
|
+
# Everything below is now intercepted, checked against policy, and logged.
|
|
107
|
+
# Nothing changes in your code. Everything changes in your visibility.
|
|
108
|
+
requests.post("https://partner.example/api", json={"token": "abc123"})
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Varden patches the Python runtime — `requests`, `httpx`, `subprocess`, OpenAI, Anthropic
|
|
112
|
+
— so every action is checked before it runs. Your developers add one line. You get a
|
|
113
|
+
dashboard full of traces.
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## What Varden covers
|
|
118
|
+
|
|
119
|
+
| Action type | What gets checked |
|
|
120
|
+
|-------------|-------------------|
|
|
121
|
+
| Tool calls | MCP tool calls, before execution |
|
|
122
|
+
| HTTP/API requests | Outbound calls, including payload classification |
|
|
123
|
+
| Subprocess execution | Shell commands, before they run |
|
|
124
|
+
| LLM calls | Provider calls to OpenAI, Anthropic, others |
|
|
125
|
+
| CLI tools | kubectl, terraform, aws, gcloud, git, docker, cursor — via `varden session` |
|
|
126
|
+
|
|
127
|
+
Decisions are **allow**, **warn**, **block**, or **monitor**. Every decision lands in the
|
|
128
|
+
dashboard with classifiers, risk scores, and a full trace.
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## Rule impact intelligence
|
|
133
|
+
|
|
134
|
+
Know which rules are working, which are over-firing, and where your coverage gaps are.
|
|
135
|
+
|
|
136
|
+

|
|
137
|
+
|
|
138
|
+
Every rule shows its detection count, coverage percentage, false positive proxy, and
|
|
139
|
+
which agents and tools it's touching. The drilldown panel shows the most recent
|
|
140
|
+
decision for any rule in one click.
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## Why self-hosted matters
|
|
145
|
+
|
|
146
|
+
Most AI security products inspect prompts in the cloud. Your data leaves your
|
|
147
|
+
infrastructure to be evaluated by someone else's service.
|
|
148
|
+
|
|
149
|
+
Varden runs on your infrastructure. Your policy file, your data, your control plane.
|
|
150
|
+
No traffic leaves unless you decide it does.
|
|
151
|
+
|
|
152
|
+

|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## Quickstart
|
|
157
|
+
|
|
158
|
+
### 1. Install
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
git clone https://github.com/markndg/varden
|
|
162
|
+
cd varden
|
|
163
|
+
python -m venv .venv && source .venv/bin/activate
|
|
164
|
+
pip install -e .
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### 2. Create a policy
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
python -c "import json, pathlib; p=pathlib.Path('policy-packs/baseline-operational-safety.json'); pathlib.Path('policy.json').write_text(json.dumps(json.loads(p.read_text(encoding='utf-8'))['template'], indent=2) + '\n', encoding='utf-8')"
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### 3. Start Varden
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
python -m varden.api --config examples/dev.env
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### 4. Open the dashboard
|
|
180
|
+
|
|
181
|
+
- Dashboard: `http://127.0.0.1:8000/`
|
|
182
|
+
- Rules editor: `http://127.0.0.1:8000/ui/rules`
|
|
183
|
+
- API docs: `http://127.0.0.1:8000/docs`
|
|
184
|
+
- Bootstrap key: `admin-demo-key`
|
|
185
|
+
|
|
186
|
+
### 5. Run the demo
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
python -m varden.cli demo
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Shows a blocked action, a warned action, and a clean allowed action — all visible in the
|
|
193
|
+
dashboard immediately.
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## Policy model
|
|
198
|
+
|
|
199
|
+
Policies are a JSON file with four lists: `block`, `warn`, `monitor`, `allow`.
|
|
200
|
+
|
|
201
|
+
```json
|
|
202
|
+
{
|
|
203
|
+
"block": [
|
|
204
|
+
{"type": "tool_call", "tool": "delete_database"},
|
|
205
|
+
{"type": "tool_call", "tool": "subprocess.run", "field:args.args": {"contains": "delete_database"}}
|
|
206
|
+
],
|
|
207
|
+
"warn": [
|
|
208
|
+
{"classifier:secrets": true},
|
|
209
|
+
{"classifier:internal": true}
|
|
210
|
+
],
|
|
211
|
+
"monitor": [],
|
|
212
|
+
"allow": []
|
|
213
|
+
}
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
Rules are evaluated in order: `block → warn → monitor → allow`. First match wins.
|
|
217
|
+
Edit visually at `/ui/rules` or directly in the JSON file. Policy versions are tracked.
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## LangChain integration
|
|
222
|
+
|
|
223
|
+
```python
|
|
224
|
+
import varden
|
|
225
|
+
from varden_langchain import protect_tools
|
|
226
|
+
|
|
227
|
+
varden.protect_from_env(auto_instrument=False)
|
|
228
|
+
tools = protect_tools(tools, agent_name='support-agent')
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
Pre-execution allow / warn / block on every tool call, with full trace visibility in the
|
|
232
|
+
dashboard. Drop-in — no changes to your agent architecture.
|
|
233
|
+
|
|
234
|
+
**Demos:**
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
python demos/langchain/allow_warn_block_demo.py
|
|
238
|
+
python demos/langchain/sql_guard_demo.py
|
|
239
|
+
python demos/langchain/exfiltration_demo.py
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
## `varden session`: wrap any CLI tool
|
|
243
|
+
|
|
244
|
+
The session command starts a shell with a PATH prefix so selected binaries route through
|
|
245
|
+
Varden before running. Use it to watch — and enforce policy on — any tool your team or
|
|
246
|
+
their agents call.
|
|
247
|
+
|
|
248
|
+
```bash
|
|
249
|
+
# Watch what Cursor does in the current directory
|
|
250
|
+
varden session . -- cursor .
|
|
251
|
+
|
|
252
|
+
# One-shot: guard a single kubectl command
|
|
253
|
+
varden session -- kubectl delete pod my-pod
|
|
254
|
+
|
|
255
|
+
# Passive mode: log without blocking
|
|
256
|
+
varden session --passive
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
**Shimmed by default:** cursor, kubectl, terraform, aws, gcloud, az, docker,
|
|
260
|
+
docker-compose, git, npm, pip, pip3, railway, supabase, vercel, fly, render, psql, mysql.
|
|
261
|
+
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
## Self-hosting
|
|
265
|
+
|
|
266
|
+
```bash
|
|
267
|
+
docker compose -f deploy/docker-compose.yml up
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
See `deploy/self_hosting.md` and `deploy/operations.md` for production configuration.
|
|
271
|
+
Local defaults use SQLite. Production self-hosting should use a strong signing secret
|
|
272
|
+
and disable the dev bootstrap auth.
|
|
273
|
+
|
|
274
|
+
---
|
|
275
|
+
|
|
276
|
+
## Licence
|
|
277
|
+
|
|
278
|
+
**Core platform and dashboard:** AGPL-3.0
|
|
279
|
+
**SDKs** (`sdks/python`, `sdks/java`, `sdks/rust`): Apache-2.0
|
|
280
|
+
|
|
281
|
+
Commercial licence available for teams that cannot accept AGPL obligations —
|
|
282
|
+
see [COMMERCIAL.md](COMMERCIAL.md).
|
varden-0.1.0/README.md
ADDED
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
# Varden
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
[](https://github.com/markndg/varden/blob/main/LICENSE) [](https://github.com/markndg/varden/releases) [](https://github.com/markndg/varden/actions) [](https://github.com/markndg/varden) [](https://www.python.org) [](https://github.com/markndg/varden/blob/main/COMMERCIAL.md)
|
|
6
|
+
|
|
7
|
+
> Using Varden? I read everything — [open a blank issue titled "Using this"](https://github.com/markndg/varden/issues/new)
|
|
8
|
+
Your developers are using Cursor. It's calling APIs, running git commands,
|
|
9
|
+
talking to external services, executing shell commands.
|
|
10
|
+
|
|
11
|
+
Do you know what it's doing?
|
|
12
|
+
|
|
13
|
+
Now multiply that by a team of ten, all running AI agents with MCP access to your
|
|
14
|
+
infrastructure. Nobody has a list of what those agents can touch. Nobody sees it when
|
|
15
|
+
one does something unexpected.
|
|
16
|
+
|
|
17
|
+
**Varden is the thing watching.**
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Try it now
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# 1. Install
|
|
25
|
+
git clone https://github.com/markndg/varden
|
|
26
|
+
cd varden
|
|
27
|
+
python -m venv .venv && source .venv/bin/activate
|
|
28
|
+
pip install -e .
|
|
29
|
+
|
|
30
|
+
# 2. Start Varden
|
|
31
|
+
python -m varden.api --config examples/dev.env
|
|
32
|
+
|
|
33
|
+
# 3. In a second terminal — wrap Cursor
|
|
34
|
+
export VARDEN_BASE_URL=http://127.0.0.1:8000
|
|
35
|
+
export VARDEN_API_KEY=admin-demo-key
|
|
36
|
+
varden session . -- cursor .
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Subprocess calls, HTTP requests, and LLM calls that Cursor makes now appear in your
|
|
40
|
+
dashboard — blocked, warned, or logged according to your policy.
|
|
41
|
+
|
|
42
|
+
> **Note:** Varden intercepts via a PATH shim. Child processes Cursor spawns will
|
|
43
|
+
> be covered; processes Cursor launches outside the shell PATH may not be. Use an
|
|
44
|
+
> interactive `varden session` shell for broadest coverage.
|
|
45
|
+
|
|
46
|
+

|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## One line protects your Python agents
|
|
51
|
+
|
|
52
|
+
```python
|
|
53
|
+
import varden
|
|
54
|
+
import requests
|
|
55
|
+
|
|
56
|
+
varden.protect()
|
|
57
|
+
|
|
58
|
+
# Everything below is now intercepted, checked against policy, and logged.
|
|
59
|
+
# Nothing changes in your code. Everything changes in your visibility.
|
|
60
|
+
requests.post("https://partner.example/api", json={"token": "abc123"})
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Varden patches the Python runtime — `requests`, `httpx`, `subprocess`, OpenAI, Anthropic
|
|
64
|
+
— so every action is checked before it runs. Your developers add one line. You get a
|
|
65
|
+
dashboard full of traces.
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## What Varden covers
|
|
70
|
+
|
|
71
|
+
| Action type | What gets checked |
|
|
72
|
+
|-------------|-------------------|
|
|
73
|
+
| Tool calls | MCP tool calls, before execution |
|
|
74
|
+
| HTTP/API requests | Outbound calls, including payload classification |
|
|
75
|
+
| Subprocess execution | Shell commands, before they run |
|
|
76
|
+
| LLM calls | Provider calls to OpenAI, Anthropic, others |
|
|
77
|
+
| CLI tools | kubectl, terraform, aws, gcloud, git, docker, cursor — via `varden session` |
|
|
78
|
+
|
|
79
|
+
Decisions are **allow**, **warn**, **block**, or **monitor**. Every decision lands in the
|
|
80
|
+
dashboard with classifiers, risk scores, and a full trace.
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Rule impact intelligence
|
|
85
|
+
|
|
86
|
+
Know which rules are working, which are over-firing, and where your coverage gaps are.
|
|
87
|
+
|
|
88
|
+

|
|
89
|
+
|
|
90
|
+
Every rule shows its detection count, coverage percentage, false positive proxy, and
|
|
91
|
+
which agents and tools it's touching. The drilldown panel shows the most recent
|
|
92
|
+
decision for any rule in one click.
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Why self-hosted matters
|
|
97
|
+
|
|
98
|
+
Most AI security products inspect prompts in the cloud. Your data leaves your
|
|
99
|
+
infrastructure to be evaluated by someone else's service.
|
|
100
|
+
|
|
101
|
+
Varden runs on your infrastructure. Your policy file, your data, your control plane.
|
|
102
|
+
No traffic leaves unless you decide it does.
|
|
103
|
+
|
|
104
|
+

|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Quickstart
|
|
109
|
+
|
|
110
|
+
### 1. Install
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
git clone https://github.com/markndg/varden
|
|
114
|
+
cd varden
|
|
115
|
+
python -m venv .venv && source .venv/bin/activate
|
|
116
|
+
pip install -e .
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### 2. Create a policy
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
python -c "import json, pathlib; p=pathlib.Path('policy-packs/baseline-operational-safety.json'); pathlib.Path('policy.json').write_text(json.dumps(json.loads(p.read_text(encoding='utf-8'))['template'], indent=2) + '\n', encoding='utf-8')"
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### 3. Start Varden
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
python -m varden.api --config examples/dev.env
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### 4. Open the dashboard
|
|
132
|
+
|
|
133
|
+
- Dashboard: `http://127.0.0.1:8000/`
|
|
134
|
+
- Rules editor: `http://127.0.0.1:8000/ui/rules`
|
|
135
|
+
- API docs: `http://127.0.0.1:8000/docs`
|
|
136
|
+
- Bootstrap key: `admin-demo-key`
|
|
137
|
+
|
|
138
|
+
### 5. Run the demo
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
python -m varden.cli demo
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Shows a blocked action, a warned action, and a clean allowed action — all visible in the
|
|
145
|
+
dashboard immediately.
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## Policy model
|
|
150
|
+
|
|
151
|
+
Policies are a JSON file with four lists: `block`, `warn`, `monitor`, `allow`.
|
|
152
|
+
|
|
153
|
+
```json
|
|
154
|
+
{
|
|
155
|
+
"block": [
|
|
156
|
+
{"type": "tool_call", "tool": "delete_database"},
|
|
157
|
+
{"type": "tool_call", "tool": "subprocess.run", "field:args.args": {"contains": "delete_database"}}
|
|
158
|
+
],
|
|
159
|
+
"warn": [
|
|
160
|
+
{"classifier:secrets": true},
|
|
161
|
+
{"classifier:internal": true}
|
|
162
|
+
],
|
|
163
|
+
"monitor": [],
|
|
164
|
+
"allow": []
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Rules are evaluated in order: `block → warn → monitor → allow`. First match wins.
|
|
169
|
+
Edit visually at `/ui/rules` or directly in the JSON file. Policy versions are tracked.
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## LangChain integration
|
|
174
|
+
|
|
175
|
+
```python
|
|
176
|
+
import varden
|
|
177
|
+
from varden_langchain import protect_tools
|
|
178
|
+
|
|
179
|
+
varden.protect_from_env(auto_instrument=False)
|
|
180
|
+
tools = protect_tools(tools, agent_name='support-agent')
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Pre-execution allow / warn / block on every tool call, with full trace visibility in the
|
|
184
|
+
dashboard. Drop-in — no changes to your agent architecture.
|
|
185
|
+
|
|
186
|
+
**Demos:**
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
python demos/langchain/allow_warn_block_demo.py
|
|
190
|
+
python demos/langchain/sql_guard_demo.py
|
|
191
|
+
python demos/langchain/exfiltration_demo.py
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
## `varden session`: wrap any CLI tool
|
|
195
|
+
|
|
196
|
+
The session command starts a shell with a PATH prefix so selected binaries route through
|
|
197
|
+
Varden before running. Use it to watch — and enforce policy on — any tool your team or
|
|
198
|
+
their agents call.
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
# Watch what Cursor does in the current directory
|
|
202
|
+
varden session . -- cursor .
|
|
203
|
+
|
|
204
|
+
# One-shot: guard a single kubectl command
|
|
205
|
+
varden session -- kubectl delete pod my-pod
|
|
206
|
+
|
|
207
|
+
# Passive mode: log without blocking
|
|
208
|
+
varden session --passive
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
**Shimmed by default:** cursor, kubectl, terraform, aws, gcloud, az, docker,
|
|
212
|
+
docker-compose, git, npm, pip, pip3, railway, supabase, vercel, fly, render, psql, mysql.
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## Self-hosting
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
docker compose -f deploy/docker-compose.yml up
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
See `deploy/self_hosting.md` and `deploy/operations.md` for production configuration.
|
|
223
|
+
Local defaults use SQLite. Production self-hosting should use a strong signing secret
|
|
224
|
+
and disable the dev bootstrap auth.
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
## Licence
|
|
229
|
+
|
|
230
|
+
**Core platform and dashboard:** AGPL-3.0
|
|
231
|
+
**SDKs** (`sdks/python`, `sdks/java`, `sdks/rust`): Apache-2.0
|
|
232
|
+
|
|
233
|
+
Commercial licence available for teams that cannot accept AGPL obligations —
|
|
234
|
+
see [COMMERCIAL.md](COMMERCIAL.md).
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "varden"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "A self-hosted runtime firewall for AI agents"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = { text = "AGPL-3.0-or-later" }
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "Mark Griffiths" }
|
|
14
|
+
]
|
|
15
|
+
keywords = [
|
|
16
|
+
"ai", "agents", "llm", "security", "firewall",
|
|
17
|
+
"observability", "runtime", "guardrails", "policy"
|
|
18
|
+
]
|
|
19
|
+
classifiers = [
|
|
20
|
+
"Development Status :: 4 - Beta",
|
|
21
|
+
"Intended Audience :: Developers",
|
|
22
|
+
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
|
|
23
|
+
"Programming Language :: Python :: 3",
|
|
24
|
+
"Programming Language :: Python :: 3.10",
|
|
25
|
+
"Programming Language :: Python :: 3.11",
|
|
26
|
+
"Programming Language :: Python :: 3.12",
|
|
27
|
+
"Topic :: Security",
|
|
28
|
+
"Topic :: Software Development :: Libraries",
|
|
29
|
+
"Topic :: System :: Monitoring",
|
|
30
|
+
]
|
|
31
|
+
dependencies = [
|
|
32
|
+
"fastapi>=0.111",
|
|
33
|
+
"uvicorn>=0.30",
|
|
34
|
+
"httpx>=0.27",
|
|
35
|
+
"PyJWT>=2.8",
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
[project.optional-dependencies]
|
|
39
|
+
postgres = [
|
|
40
|
+
"psycopg[binary]>=3.1",
|
|
41
|
+
]
|
|
42
|
+
langchain = [
|
|
43
|
+
"langchain>=0.2",
|
|
44
|
+
"langchain-core>=0.2",
|
|
45
|
+
]
|
|
46
|
+
mcp = [
|
|
47
|
+
"mcp[cli]>=1.2",
|
|
48
|
+
"httpx>=0.27",
|
|
49
|
+
]
|
|
50
|
+
test = [
|
|
51
|
+
"pytest>=8",
|
|
52
|
+
"mcp[cli]>=1.2",
|
|
53
|
+
]
|
|
54
|
+
all = [
|
|
55
|
+
"psycopg[binary]>=3.1",
|
|
56
|
+
"langchain>=0.2",
|
|
57
|
+
"langchain-core>=0.2",
|
|
58
|
+
"mcp[cli]>=1.2",
|
|
59
|
+
]
|
|
60
|
+
|
|
61
|
+
[project.urls]
|
|
62
|
+
Homepage = "https://github.com/markndg/varden"
|
|
63
|
+
Repository = "https://github.com/markndg/varden"
|
|
64
|
+
Issues = "https://github.com/markndg/varden/issues"
|
|
65
|
+
Changelog = "https://github.com/markndg/varden/commits/main"
|
|
66
|
+
|
|
67
|
+
[project.scripts]
|
|
68
|
+
varden = "varden.cli:main"
|
|
69
|
+
varden-monitor = "varden_monitor.cli:main"
|
|
70
|
+
varden-session = "varden_monitor.session:main"
|
|
71
|
+
varden-mcp = "varden_mcp.server:main"
|
|
72
|
+
|
|
73
|
+
[tool.setuptools.packages.find]
|
|
74
|
+
include = ["varden*", "varden_sdk*", "varden_langchain*", "varden_monitor*", "varden_mcp*"]
|
|
75
|
+
|
|
76
|
+
[tool.setuptools.package-data]
|
|
77
|
+
"varden" = ["web/**/*", "policy-packs/*.json"]
|
varden-0.1.0/setup.cfg
ADDED