https://github.com/wangyihang/llm-redactor
A transparent egress gateway to redact sensitive credentials and local data for LLM coding agents.
https://github.com/wangyihang/llm-redactor
agent api-gateway claude-code codex gateway gemini gemini-cli llm llm-gateway observability
Last synced: 3 months ago
JSON representation
A transparent egress gateway to redact sensitive credentials and local data for LLM coding agents.
- Host: GitHub
- URL: https://github.com/wangyihang/llm-redactor
- Owner: WangYihang
- Created: 2025-12-03T08:49:00.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2026-03-12T17:28:33.000Z (4 months ago)
- Last Synced: 2026-03-12T23:39:21.024Z (3 months ago)
- Topics: agent, api-gateway, claude-code, codex, gateway, gemini, gemini-cli, llm, llm-gateway, observability
- Language: Go
- Homepage:
- Size: 600 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# LLM-Redactor
A local transparent proxy to redact secrets (API keys, PII) before they leave your machine.
| Feature | Direct Connection | With **LLM-Redactor** |
| :--- | :--- | :--- |
| Data Privacy | Secrets sent to Cloud | **Redacted locally** |
| Provider Sees | `Prompt: "Fix this: API_KEY=sk-123..."` | `Prompt: "Fix this: API_KEY=[REDACTED]"` |
| Streaming | Standard | **Real-time filtering** |
## Core Features
- Automatic Redaction: Detects 100+ secret types using Gitleaks-compatible rules.
- Zero Configuration: No need to modify your existing workflows.
- Zero-Latency Streaming: Intercepts and filters SSE streams in real-time.
- Deep JSON Scanning: Recursively traverses nested structures (e.g., Anthropic content blocks).
- Local Audit: Records detected leaks to `detections.jsonl`.
## Use Case 1: Execute Command with Redaction (Recommended)
This is the easiest way to use LLM-Redactor. Just prepend the command to your existing CLI tool. It will automatically set up the proxy and configure environment variables for the session.
### Install
```bash
go install github.com/wangyihang/llm-redactor/cmd/llm-redactor-exec@latest
```
### Usage
Prepend `llm-redactor-exec --` to your existing command:
```bash
llm-redactor-exec -- claude
llm-redactor-exec -- gemini
llm-redactor-exec -- codex
```
Upon exiting the session, a comprehensive audit summary will be displayed.
## Use Case 2: Standalone Redacting Proxy
Use this if you want to run a persistent proxy server that multiple tools or background processes can use.
### Install
```bash
go install github.com/wangyihang/llm-redactor/cmd/llm-redactor-proxy@latest
```
### Usage
1. Start the proxy server:
```bash
llm-redactor-proxy --port 4000
```
2. Configure your environment or tools to use the proxy:
```bash
export HTTP_PROXY=http://localhost:4000
export HTTPS_PROXY=http://localhost:4000
# Now run your tools normally
claude
```
## Audit & Logs
All detected leaks are logged to `detections.jsonl` with full metadata for post-session review.
