krj29b

Agent Dlp Proxy — Development skill for Claude Code

Development community

Local code-first DLP and token-compression proxy for CLI coding agents (Claude Code, Codex, Antigravity) — masks secrets and validated PII locally via mitmproxy + Headroom and restores placeholders in.

How to install Agent Dlp Proxy

This entry records only its repository, not the path inside it, so there is no exact command to give. Open krj29b/agent-dlp-proxy and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Agent Dlp Proxy does

Local code-first DLP and token-compression proxy for CLI coding agents (Claude Code, Codex, Antigravity) — masks secrets and validated PII locally via mitmproxy + Headroom and restores placeholders in responses.

Alternatives in Development

  • Dense Compression Protocol — Astryx Translation Protocol 30.7k ★
  • Antigravity Claude Proxy — Proxy that exposes Antigravity provided claude / gemini models, so we can use them in Claude Code and OpenClaw 3.5k ★
  • Sanitize — Detect and redact PII from text files — 15 categories (SSNs, credit cards, API keys, etc.), zero dependencies 3.1k ★

README

agent-dlp-proxy

Local code-first DLP and token-compression proxy stack for CLI coding agents (Claude Code, Codex, and Antigravity `agy`). The mitmproxy addon applies a **code-first, deterministic DLP engine** to JSON payloads before forwarding them to Headroom for context optimization, and restores original values whenever the provider returns the corresponding placeholders.

CLI agent → mitmproxy (dlp/ code-first DLP) → Headroom → provider
CLI agent ← mitmproxy (per-request map)     ← Headroom ← provider
Port on 127.0.0.1 Service Supported model routes
8080 mitmproxy Entry point for CLI agents
8781 Headroom for Anthropic api.anthropic.com for Messages and token counting
8782 Headroom for OpenAI api.openai.com for Chat Completions and Responses. chatgpt.com for the Codex Responses backend
8783 Headroom for Google Gemini API and supported Cloud Code Assist routes

Protection Layers

The scanner in `dlp/` uses Python 3.12+'s standard library for its default layers (instant startup, no ML dependencies required):

  1. Layer 1 — Code-aware secrets (dlp/secrets.py): PEM private keys, provider-prefixed API tokens (OpenAI, Anthropic, AWS, GitHub, GitLab, GCP, Slack, Stripe, HuggingFace, PyPI, npm, SendGrid, Age, Vault), header-validated JWTs, Authorization headers, URI credentials, JSON SECRET_KEYS, and context-gated assignment secrets (password, hasło, api_key, etc.) with filters for type hints, null/env/call expressions, and Git/SHA hashes.
  2. Layer 2 — Validated structured PII (dlp/pii.py): IPv4/IPv6 (masking private + public IPs while allowing loopback 127.0.0.0/8, 0.0.0.0, ::1, RFC 5737/3849 documentation ranges, version strings, and :: code slices), emails, ISO 7064 mod-97 IBANs, Luhn-validated credit cards, checksum-validated Polish PESEL and NIP, formatted phone numbers, Polish legal suffixes (Sp. z o.o., Sp. k., Sp. j.), and local OS