redact-bridge
Proxies redacted prompts to OpenAI-compatible Chat Completions and Responses endpoints and restores model responses locally.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
redact-bridge
A small local proxy and MCP server for penetration testers. It runs on your machine, replaces client identifiers in an outgoing prompt with stable placeholders before the request leaves the machine, and puts the real values back into the model's answer locally. The mapping between placeholders and real values stays on your machine: in memory, or in an encrypted file you choose.
you / your agent ──► redact-bridge (127.0.0.1) ──► model API
"scan dc01.corp.client.test" "scan [[HOST_1]]"
◄── "dc01.corp.client.test runs SMB without signing" ◄── "[[HOST_1]] runs SMB without signing"Works with any OpenAI-compatible or Anthropic-compatible endpoint (Chat Completions, Responses, Messages; streamed or not). PentestLLM is the built-in preset. No dependencies beyond Node.js 20 or newer.
What it replaces
Placeholder | What | How it is found |
| IPv4 addresses | every valid dotted quad, except |
| IPv6 addresses | every valid address with two or more groups, except |
| hostnames and domains in your scope | each domain you pass with |
| email addresses | every address, any domain |
| cookie values |
|
| tokens, keys, passwords |
|
| private keys |
|
| password hashes |
|
| your words | each |
| your patterns | each regex in the config file, under the name you give it |
The same value gets the same placeholder for the whole session (and across sessions with --map-file), so the
model can reason about "[[HOST_3]] talks to [[IPV4_2]]" consistently.
Related MCP server: genpark-personal-vault-zero-knowledge-sanitizer-skill
What it does not catch
It is pattern-based. It recognises things by shape or by the scope you give it. It cannot recognise:
Secrets with no known shape and no telling label: a random password written in a sentence, a hex key on its own, an internal ticket number. Add a
--termor a pattern for anything like that.Hostnames outside your scope list on a public TLD (
client-portal.comunless you scope it).Usernames, real names, MAC addresses, phone numbers, street addresses, account numbers, unless you add a term or pattern.
Anything inside images, PDFs or other files attached to the request (base64 data is passed through unread), and encoded data (base64, URL-encoded or hex-encoded copies of a value are not decoded).
What the model infers. A placeholder hides the value, not the context around it.
Restoration gives back the first spelling seen: hosts, emails and terms are matched case-insensitively, so
ACME and Acme share one placeholder and both come back as the first one seen.
Over-redaction is the safer failure, so some harmless text is replaced too (a version string shaped like an IPv4
address, name=value pairs whose name contains "token"). Run redact or --dry-run on real material before you
rely on it.
Install
npm install -g github:pentestllm/redact-bridge
# or run from a clone: node bin/redact-bridge.js ...See what would be sent first
redact-bridge redact findings.txt --scope client.example,corp.client.test --term "Contoso Bank" --show-mapprints the redacted text to stdout and the placeholder table to stderr. Nothing is sent anywhere.
redact-bridge proxy --dry-run does the same for live requests: it prints each redacted request body and answers
the client with a 503 instead of forwarding it.
Proxy
redact-bridge proxy --preset pentestllm --scope client.example,corp.client.test --term "Contoso Bank"
# redact-bridge on http://127.0.0.1:8787 -> https://api.pentestllm.aiPoint your client at it:
OpenAI-compatible clients (OpenAI SDKs, OpenCode, Cline, Continue, curl): base URL
http://127.0.0.1:8787/v1Anthropic-compatible clients (Claude Code, Anthropic SDKs):
ANTHROPIC_BASE_URL=http://127.0.0.1:8787
Your API key goes through unchanged. proxy and mcp send nothing until you name the destination: --preset pentestllm, or --upstream https://api.example.com (the origin, without /v1) for any other endpoint.
JSON bodies are redacted field by field (tool-call arguments as JSON), plain-text bodies as text, and query values in the URL. A body the bridge cannot read (multipart uploads, binary) is refused with a 415 and not sent. Browser cookies sent to the bridge are not forwarded, and redirects from the upstream are refused so the key never goes to another origin.
Streaming answers are restored as they arrive. A placeholder split across chunks ([[HO then ST_1]]) is held
back until it is complete; tool-call arguments are restored as valid JSON.
MCP server
{
"mcpServers": {
"redact-bridge": {
"command": "npx",
"args": ["-y", "github:pentestllm/redact-bridge", "mcp", "--preset", "pentestllm", "--scope", "client.example"],
"env": { "REDACT_BRIDGE_API_KEY": "<your key for the upstream, only needed for ask>" }
}
}
}In Claude Desktop you can instead open redact-bridge-<version>.mcpb from the releases and fill in the scope there.
Tools: redact (text in, placeholders out), restore (placeholders in, real values out) and ask (redact a prompt,
send it to the upstream's /v1/chat/completions with the model you name, restore the answer). Use it when a local
agent should consult a remote model about client material.
Keeping the mapping
By default the mapping lives in memory and is gone when the process stops. To keep it across runs (to restore a
report written yesterday, or to share placeholders between proxy and restore):
export REDACT_BRIDGE_PASSPHRASE='a long passphrase'
redact-bridge proxy --map-file ~/engagements/contoso.map --scope client.example
redact-bridge restore model-answer.md --map-file ~/engagements/contoso.mapUse one bridge process and one map file per engagement: every placeholder issued in a process can be restored by that process, and two processes writing the same map file will overwrite each other.
The file is AES-256-GCM encrypted with a key derived by scrypt from the passphrase, written with mode 600. Without the passphrase it cannot be read.
Config file
{
"scope": ["client.example", "corp.client.test"],
"terms": ["Contoso Bank", "Project Bluebird"],
"patterns": [{ "name": "ticket", "regex": "CASE-\\d{5}" }],
"internalTlds": true
}redact-bridge proxy --config contoso.json. Terms and patterns run first.
Defaults
Listens on
127.0.0.1only.Logs nothing.
--verboseprints the method, path and placeholder counts per request, never a value.The mapping is never sent upstream, never written unencrypted, and never printed unless you ask with
--show-map.
Tests
npm test runs a corpus of fake findings (a Burp request and response, nmap output, a Python stack trace with
credentials and an NTLM hash) through the redactor, a fake upstream behind the proxy (Chat Completions, Messages,
streamed and not) and the MCP server, and checks that every seeded identifier is gone from what the upstream
receives and back in what the client gets, with placeholders split at every chunk position.
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Detect and redact PII and secrets before text reaches an LLM, with reversible placeholders.
Detect and redact PII and secrets (API keys, tokens) in text, HTML or PDF before it reaches an LLM.
Find and redact leaked secrets, wallet keys and PII before an AI agent sends text.
Detects and redacts PII (emails, phones, SSNs, names, addresses) from text. $0.02/call via x402.
Related MCP Servers
AlicenseNot gradedqualityCmaintenanceEnables MCP clients to safely connect to MCP servers by sanitizing sensitive data in tool results and restoring it in tool arguments, so the model never sees PII while downstream tools still receive real values.MIT- FlicenseNot gradedqualityNot gradedmaintenanceEnables agents to encrypt and sanitize sensitive data such as credentials, credit card numbers, and addresses locally before dispatching prompts to cloud LLMs, then rehydrate the masked values client-side. It runs deterministically with zero external dependencies over MCP JSON-RPC stdio, so no plaintext PII leaves the user's machine.-
- AlicenseBqualityBmaintenanceEnables local grammar-preserving masking of sensitive content, entities, and code identifiers into synthetic tokens before sending prompts to LLMs, then restores the original text and symbols from responses using session-scoped in-memory mappings.52Apache 2.0
- FlicenseNot gradedqualityBmaintenanceEnables reversible anonymization of sensitive PII such as SSNs, credit cards, passport numbers, emails, and phone numbers before sending prompts to external LLMs, then restores original values locally using HMAC isolation.7-