You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Complement to #93 (credential proxy). Even with API keys hidden from the agent, the agent can still leak sensitive data from the codebase (credentials found in source, PII from databases, internal URLs, etc.) to LLM providers via request bodies.
Problem
# Agent reads a config file containing a database password:
DB_PASSWORD=s3cret123
# Agent sends it to the LLM as part of the conversation:
POST https://api.anthropic.com/v1/messages
{"messages": [{"content": "I found this config: DB_PASSWORD=s3cret123 ..."}]}
The LLM provider now has the database password. Even if the agent didn't intend to leak it, the secret is in the training/logging pipeline.
Goal
Scan LLM request/response bodies for secrets and PII — replace with reversible placeholders before sending to the provider, restore originals in responses. The agent works normally but sensitive data never leaves the container.
AES-256-GCM vault, 5-layer detection, F1 0.94, streaming, MCP server
PasteGuard
TS/Bun
97ms
✅
Microsoft Presidio, 30+ PII types, 24 languages, dashboard
mirage-proxy
Rust
<1ms
✅ (fakes)
Plausible fake values instead of tokens, 129 patterns
LLM Guard
Python
varies
❌
Most mature (2.7K★), 20+ scanners, not reversible
LiteLLM + Presidio
Python
varies
✅
Multi-provider routing, most flexible
AegisGate
Python
varies
✅
PII + prompt injection + response sanitization
Integration with OpenCode
OpenCode supports baseURL override per provider and HTTP_PROXY/HTTPS_PROXY env vars — both work for routing traffic through a masking proxy. See integration research.
Possible approach
PII masking proxy as a sidecar container (same as credential proxy in #93, could be the same proxy process):
Proxy receives LLM request from OpenCode
Scans request body for secrets (API keys, passwords, tokens) and PII (names, emails, IPs)
Replaces with reversible placeholders ([[SECRET_1]], [[EMAIL_1]])
Complement to #93 (credential proxy). Even with API keys hidden from the agent, the agent can still leak sensitive data from the codebase (credentials found in source, PII from databases, internal URLs, etc.) to LLM providers via request bodies.
Problem
The LLM provider now has the database password. Even if the agent didn't intend to leak it, the secret is in the training/logging pipeline.
Goal
Scan LLM request/response bodies for secrets and PII — replace with reversible placeholders before sending to the provider, restore originals in responses. The agent works normally but sensitive data never leaves the container.
Prior art
Detailed research in #93 comment. Top candidates:
Integration with OpenCode
OpenCode supports
baseURLoverride per provider andHTTP_PROXY/HTTPS_PROXYenv vars — both work for routing traffic through a masking proxy. See integration research.Possible approach
PII masking proxy as a sidecar container (same as credential proxy in #93, could be the same proxy process):
[[SECRET_1]],[[EMAIL_1]])Relationship to other issues