RedActor
March 27, 2026 ยท View on GitHub
Anonymize code before sharing or using AI.
Automatically detect and remove sensitive data from your code, logs, and prompts โ locally, with zero setup.
๐ Why RedActor
Developers constantly copy/paste code into:
- AI tools (Copilot, ChatGPT)
- GitHub issues / PRs
- StackOverflow / Slack
๐ This often leaks:
- API keys
- internal URLs
- emails
- IPs
RedActor prevents that โ instantly.
โก What it does
RedActor automatically anonymizes:
- Emails โ
user@email.com - URLs โ
https://example.com - IP addresses โ
0.0.0.0 - AWS keys โ
SECRET_1 - Your custom patterns โ fully configurable
Runs fully local. No data leaves your machine.
๐ง Example
Input
const email = "dev@company.com";
const api = "https://intranet.local";
const ip = "10.0.0.12";
const aws = "AKIA1234567890ABCDEF";
Output
const email = "user@email.com";
const api = "https://example.com";
const ip = "0.0.0.0";
const aws = "SECRET_1";
๐ง Custom patterns (power feature)
Define your own anonymization rules using regex.
Replace internal IDs
{
"/user_[0-9]+/g": "user_XXX"
}
Example:
const id = "user_12345"; โ const id = "user_XXX";
Mask company domains
{
"/https:\\/\\/.*\\.internal/g": "https://example.com"
}
Example:
const api = "https://payments.internal"; โ const api = "https://example.com";
Replace tokens
{
"/token_[a-zA-Z0-9]+/g": "TOKEN"
}
Example:
const token = "token_abC123XYZ"; โ const token = "TOKEN";
๐ Adapt RedActor to your company rules or any custom format.
๐งฉ VSCode Extension
Use RedActor directly in VSCode:
- Command: Anonymize Code
- Works instantly on your file
- Opens anonymized version side-by-side
๐ฆ Installation
Monorepo (local dev)
pnpm install
pnpm build
Core package
pnpm add @gianfa/redactor-core
โ๏ธ Usage
import { anonymize } from "@gianfa/redactor-core";
const result = anonymize(code);
console.log(result.code);
console.log(result.findings);
console.log(result.map);
๐ฅ CLI
node packages/core/dist/cli.js ./input.txt
- anonymized code โ
stdout - findings โ
stderr
๐ง Use custom rules from JSON
node packages/core/dist/cli.js ./input.txt ./anonymizations.json
or
ANONYMIZE_JSON=./anonymizations.json node packages/core/dist/cli.js ./input.txt
๐ฏ Use cases
- Safe AI usage (no leaks)
- Sharing code publicly
- Cleaning logs before debugging
- Protecting internal data
๐ข For teams
Using AI with real code?
You might be leaking sensitive data across your organization.
โ Contact for a team-ready solution (policies, CI integration, custom rules)
๐ Examples
See docs/examples
๐ก Keywords (SEO)
anonymize code, remove secrets, redact code, AI privacy, sanitize logs, protect API keys