Skip to main content

EgressVeil

The local privacy gateway for AI coding agents.

CI License: MIT

EgressVeil is a local-first, open-source security gateway. It detects sensitive information in the API traffic that supported AI coding agents send to LLM providers, and redacts or blocks it before it leaves your machine.

Free and open source, for everyone. EgressVeil is released under the MIT License. You can use it, modify it, redistribute it and build commercial products on it at no cost. There are no paid tiers, accounts, license keys or usage limits. It runs entirely on your machine, has no telemetry, and its only network connection is to the LLM provider you configure.

Project status: pre-alpha (Phase 1). EgressVeil now runs as a local gateway for the Anthropic Messages API, the API Claude Code uses. It detects secrets and tokens and blocks or redacts them according to your policy. PII and internal-hostname detection, and support for other agents, are not implemented yet. Detection is heuristic. Treat EgressVeil as one layer of defense, not a guarantee.


Why

AI coding agents read your working tree and send large parts of it to a remote LLM API. That context can contain .env files, cloud credentials, customer data pasted into a test fixture, or internal hostnames. Today the only control most teams have is to hope that none of it gets read.

EgressVeil sits between the agent and the provider API on localhost. It inspects each request, applies a policy you control (ALLOW, REDACT, BLOCK, LOG_ONLY), and writes an audit trail that never contains the raw secret.

What EgressVeil is not

  • It is not a firewall for everything your agent does. It inspects only the LLM API traffic that a supported agent sends through it. Shell commands, package installs, web fetches, MCP servers, git pushes and other network activity from the agent or its tools are not covered.
  • It cannot inspect traffic that an agent sends straight to a vendor backend that you can't redirect, which affects Cursor in particular (see Integrations).
  • It does not inspect responses from the model (planned).
  • It is not a replacement for keeping secrets out of your repository.

See docs/threat-model.md for the full scope.

Quick start with Claude Code

egressveil serve

In another terminal, point Claude Code at the gateway and start it as usual:

# Linux/macOS
export ANTHROPIC_BASE_URL=http://127.0.0.1:8787
claude
# Windows PowerShell
$env:ANTHROPIC_BASE_URL = "http://127.0.0.1:8787"
claude

Claude Code keeps its own credentials. EgressVeil passes the auth header to api.anthropic.com unchanged and never logs it.

If a request contains something your policy blocks, the request never leaves your machine, and Claude Code shows an error like this:

API Error: 400 EgressVeil: request blocked before leaving this machine:
sensitive data detected: secrets/aws_access_key_id at messages[4].content[0].content[0].text.
Remove the value from the conversation (for example start a new session)
or adjust the EgressVeil policy. (request ev_3c1f0a9e2b7d4c11)

Note on BLOCK: Claude Code resends the whole conversation on every turn. Once a blocked value is in the conversation, every later request is blocked too, until you start a new session (for example with /clear). If you prefer to keep working, set the secrets and tokens rules to REDACT. The model then sees a placeholder such as [EGRESSVEIL:aws_access_key_id:5b2e91c0] instead of the value.

Features

Implemented

Feature Notes
egressveil serve A local gateway for the Anthropic Messages API (/v1/messages, /v1/messages/count_tokens), with streaming (SSE) passthrough
Secret detectors Anthropic, OpenAI, AWS, GitHub, GitLab, Slack, Stripe, Google, npm and Hugging Face keys; private keys; credentials in URLs; generic password = "..." and .env assignments
Token detectors JWTs, bearer tokens and Basic auth headers
Policy engine ALLOW / REDACT / BLOCK / LOG_ONLY for each detector. The most restrictive action wins
Redaction Placeholders keyed by an HMAC of the value, so the same value always gets the same placeholder. That keeps conversations consistent and prompt caching effective. Redacted values are never restored
Fail-closed strict mode Blocks unsupported endpoints, non-JSON or compressed bodies, malformed or duplicate-key JSON, too-deep nesting, uninspectable images and PDFs, and requests where a detector fails
Audit log JSONL with request metadata, rule IDs, JSON locations and keyed digests. Never bodies, headers, query strings or raw values
Local hardening Loopback-only listener. Host-header check against DNS rebinding. Browser Origin requests rejected. Upstreams are https-only and allowlisted, TLS is verified, and redirects are not followed
egressveil scan Run the detectors and policy over files or stdin. Prints locations and rule IDs, never values
egressveil doctor Checks Python, config, the listen port and whether the gateway is running, the audit location, the base-URL environment variables, and the active detectors
egressveil config validate A strict schema with secure defaults. Output never contains values

Planned

Feature Phase
OpenAI-compatible API parser (for Aider) 2
PII and internal-hostname detectors 2
egressveil run -- <agent> launcher that sets base URLs 2
OpenClaw integration 3
Cursor: documented, experimental support where technically possible 3
Response-side inspection 3

The details are in docs/roadmap.md.

Security architecture

flowchart TD
    A[AI coding agent<br/>Claude Code] -->|"HTTP on 127.0.0.1<br/>ANTHROPIC_BASE_URL"| G

    subgraph G[EgressVeil local gateway]
        direction TB
        H[Host / Origin / size checks] --> P[Anthropic parser<br/>every string field]
        P --> D[Secret & token detectors]
        D --> E[Policy engine]
        E -->|REDACT| R[Redactor]
        E -->|BLOCK or uninspectable| X[Local 400 error]
        E -.-> L[(Audit log<br/>no raw values)]
    end

    R -->|verified TLS, allowlisted host| U[api.anthropic.com]
    E -->|ALLOW / LOG_ONLY| U
    U -->|streamed response| A

    T[Other agent traffic:<br/>shell, web fetch, MCP, git] -. "NOT inspected" .-> I((Internet))

Each control, and whether it is implemented, is described in docs/security-design.md.

Installation

EgressVeil requires Python 3.11 to 3.14 and runs on Windows, macOS and Linux.

The recommended way to install it is with pipx, which puts the CLI in its own isolated environment:

pipx install "git+https://github.com/qmmughal/egressveil.git@v0.2.0"

Or with pip, into the virtual environment of your choice:

pip install "egressveil @ https://github.com/qmmughal/egressveil/releases/download/v0.2.0/egressveil-0.2.0-py3-none-any.whl"

Every release file on the Releases page is built by GitHub Actions and has signed build provenance. You can verify a download with:

gh attestation verify egressveil-0.2.0-py3-none-any.whl --repo qmmughal/egressveil

A PyPI package (pip install egressveil) is planned. See docs/releasing.md.

To work on EgressVeil itself, install it from source:

git clone https://github.com/qmmughal/egressveil.git
cd egressveil
python -m venv .venv
# Windows:      .venv\Scripts\activate
# Linux/macOS:  source .venv/bin/activate
python -m pip install -e ".[dev]"

See CONTRIBUTING.md for the development workflow.

Usage

$ egressveil serve
EgressVeil 0.2.0 gateway
  listening   http://127.0.0.1:8787
  upstream    https://api.anthropic.com
  mode        strict
  audit log   /home/you/.egressveil/audit.jsonl
  note: not implemented yet, no effect: internal_hostnames, pii

Point Claude Code at the gateway:
  export ANTHROPIC_BASE_URL=http://127.0.0.1:8787

Press Ctrl+C to stop.

Scan files before you share them with an agent:

$ egressveil scan .env deploy/notes.md
.env:3:16: BLOCK    secrets/env_file_assignment
deploy/notes.md:12:9: BLOCK    secrets/aws_access_key_id
2 finding(s).

The exit status is 0 when nothing is found, 1 when there are findings, and 2 when a file can't be read.

Validate configuration, or check your environment:

egressveil config validate --config configs/egressveil.example.yaml
egressveil doctor

Each audit event is one JSON line:

{"ts":"2026-11-16T09:12:03.512+00:00","request_id":"ev_3c1f0a9e2b7d4c11","provider":"anthropic","method":"POST","path":"/v1/messages","outcome":"block","reason":"policy","route":"json_inspect","inspected":true,"bytes_in":48211,"findings":[{"detector":"secrets","rule_id":"aws_access_key_id","location":"messages[4].content[0].content[0].text","action":"BLOCK","digest":"9f2c4be01a7d33e8"}]}

Configuration is discovered in this order: --config PATH, then $EGRESSVEIL_CONFIG, then ./egressveil.yaml, then the user config directory (%APPDATA%\egressveil\ on Windows, ~/Library/Application Support/egressveil/ on macOS, ~/.config/egressveil/ on Linux), and finally the built-in defaults. All options are documented in configs/egressveil.example.yaml.

Integration compatibility

Agent Status Routing mechanism Coverage
Claude Code Available (pre-alpha) ANTHROPIC_BASE_URL=http://127.0.0.1:8787 Anthropic Messages API calls only. Not tool, shell, web or MCP traffic
Aider Partial: Anthropic models only ANTHROPIC_BASE_URL. OpenAI-compatible models need Phase 2 LLM API calls only
OpenClaw Future To be determined Not supported yet
Cursor Limited and experimental Most model traffic goes through Cursor's own backend Expected to be partial at best. See the docs

Routing details and their limitations are in docs/integrations.md.

Security limitations

  • Coverage is limited to API calls that a supported agent sends to the gateway. An agent, plugin or tool that ignores the base-URL setting, or that makes its own network calls, bypasses EgressVeil.
  • Detection is heuristic. Encoded, split or novel secrets can get through, and false positives happen. PII and internal hostnames are not detected yet.
  • Images and PDFs cannot be inspected. Strict mode blocks them unless you set gateway.allow_opaque_content: true.
  • Model responses are not inspected.
  • The gateway connects directly to the upstream and does not use HTTPS_PROXY.
  • EgressVeil does not perform TLS interception and does not install a root CA.
  • A local process running as your user can reconfigure or bypass EgressVeil. It does not defend against malware on your machine.

To report a vulnerability, see SECURITY.md.

Roadmap

Phase Focus
0, done Repository, packaging, CI, config schema, CLI, doctor, threat model
1, current Anthropic gateway for Claude Code: streaming proxy, secret and token detectors, policy, redaction, audit, scan
2 OpenAI-compatible parser for Aider, PII and hostname detectors, agent launcher
3 OpenClaw, experimental Cursor support, policy packs, response inspection

See docs/roadmap.md.

Contributing and support

Contributions of any size are welcome, including detectors, false-positive reports, docs and integrations. Please read CONTRIBUTING.md and the Code of Conduct. For questions, see SUPPORT.md. Never include real credentials in issues, tests or fixtures.

License

EgressVeil is free software, released under the MIT License. © 2026 EgressVeil contributors.

Metadata

Release files for egressveil 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for egressveil 0.2.0
File Size Uploaded Provenance Actions
egressveil-0.2.0.tar.gz 62.2 kB With provenance Details for egressveil-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for egressveil 0.2.0
File Interpreter ABI Platform Actions
egressveil-0.2.0-py3-none-any.whl Python 3 none any Details for egressveil-0.2.0-py3-none-any.whl

Total release size: 102.1 kB

Release files / egressveil-0.2.0.tar.gz

Download URL egressveil-0.2.0.tar.gz
Size 62.2 kB
Tags Source
SHA-256 checksum
How to use checksums
2f4801a844b3f9ae103b478cceca77b70f45e93d8d95aaf0412c2a577cdde788
BLAKE2b-256 checksum
How to use checksums
df089d187c2bad612602bb17f5508f3d1e9907dc48ecabb076fcf97a6009822d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

Release files / egressveil-0.2.0-py3-none-any.whl

Download URL egressveil-0.2.0-py3-none-any.whl
Size 39.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5f7c034877b07648ced614c41c5c47c2117e91a0f86f4823cc7e0502494e8692
BLAKE2b-256 checksum
How to use checksums
c28eed29f3e647b17f68086ff284b0b7ca6f644f672d8c1b297710bdbc645bf8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

Security for egressveil 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for egressveil-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page