Problem
When I ask an AI assistant for help, I often paste logs, config files or terminal output. That text can contain API keys, passwords or tokens. I wanted a quick way to clean it first, without sending it to yet another online service.
What I built
redactor is a command-line tool and a small local web page. You paste text in, and it returns the same text with secrets replaced by labels like [REDACTED: OpenAI API Key]. The labels keep the text readable, so the assistant still understands it.
It has 25 detectors for known key formats (cloud providers, version control, payment services, private keys, connection strings) and two heuristic detectors for secrets without a fixed shape. Personal data like emails and phone numbers can be switched on in the config. It can also scan a folder, block commits through a git hook, clean the clipboard, and write an audit log without the raw values.
An optional second pass uses a local language model through Ollama. It only redacts text that actually appears in the input, and if the model is not running, the tool still works.
My part
I designed and wrote the whole project on my own.
Result
The tool runs fully offline and has no runtime dependencies. It has a test suite and CI on Python 3.11 to 3.13. I use it myself before sharing text.
What I’d do next
An editor extension, better detection of personal data, and rule packs per project.