Commit f2a7f64
committed
feat(ai-firewall): wire local AI clients to the gateway and manage its policy
`vulnetix ai-firewall` points the AI clients on a machine at the hosted
policy-enforcing gateway, proves they are pointed there, and manages the policy it
enforces. Previously only `config set ai-firewall` existed — three RPC wrappers —
and everything else was manual clicking in the dashboard.
install shell, project env, Claude Code, Codex, Continue, aider
status what is wired, and every way it conflicts with org policy
policy provider / model / guardrail rules
key BYOK provider keys, write-only
apply reconcile org policy from .vulnetix/ai-firewall.yaml
snippet ready-to-run code for the SDKs env vars cannot reach
Three facts drive the design and must not be "tidied up":
Only OPENAI_BASE_URL, OPENAI_API_BASE and ANTHROPIC_BASE_URL are read by real
SDKs. MISTRAL_BASE_URL and its friends do not exist. Writing a variable that
looks like an SDK setting and is read by nothing is worse than writing nothing:
the user believes they are protected while their traffic goes straight to the
provider. Those providers get a code snippet instead, and install says so.
Anthropic needs ANTHROPIC_AUTH_TOKEN, not ANTHROPIC_API_KEY — the latter is sent
as x-api-key and the gateway authenticates with Bearer, so the obvious variable
produces a 401 that looks exactly like a bad key. And its base URL carries no /v1:
the Anthropic SDK appends /v1/messages itself, so a trailing /v1 yields
/v1/v1/messages.
Codex and Claude Code speak non-chat wires. Both are gated on the gateway's
advertised capabilities and skipped with a reason when it cannot serve them,
rather than written a config that 404s at request time.
status exists for the finding nothing else surfaces: a client whose base URL
points somewhere other than the gateway never errors — it simply is not screened.
It also compiles every guardrail pattern, because the gateway silently skips one
that does not compile, leaving a rule that looks enforced and enforces nothing.
Config files are edited surgically and reversibly: managed blocks for env files,
non-destructive merges for JSON/TOML/YAML that preserve comments and unrelated
keys byte-for-byte, and a backup before any whole-file write. Cursor and Windsurf
keep their base URL in application state, so they are detected and explained,
never written — a file we invented there would be ignored by the app and would
make status lie.1 parent 0c1fbc6 commit f2a7f64
43 files changed
Lines changed: 8265 additions & 0 deletions
File tree
- cmd
- docs
- pkg
- aifirewall
- templates
- vdb
- website
- content/docs
- ai-firewall
- cli-reference
- layouts/partials
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
39 | 55 | | |
40 | 56 | | |
41 | 57 | | |
| |||
0 commit comments