Settings

Theme

Show HN: LLM Anon – Anonymize code before sending to AI assistants

github.com

1 points by ChrisbyMe 6 months ago · 0 comments · 1 min read

Reader

Hi HN!

I use AI to debug lots of issues for work and always have to play this game where I remove company specific info from the code to anonymize it before uploading.

I wanted to automate this process into a CLI tool and give coding agents a shot.

The results were really good and way better than I expected so I'd like to share it with you all. Everything runs via local LLM with Ollama and can be installed with uv.

Key features:

  - Local processing (no data leaves your machine)

  - Validation system with banned string detection and re-prompting

  - Supports Python, JS/TS, Java, C++, Rust, Go

  - Simple installation: uv tool install llm-anon
Example workflow:

Create validation config

echo "MyCompany" > secrets.txt

echo "internal-api.company.com" >> secrets.txt

Anonymize code with validation

llm-anon sensitive_code.py --validation-config secrets.txt -o clean_code.py

The tool will retry anonymization if it detects any banned strings in the output, making it much safer to share code with external AI services.

GitHub: https://github.com/ChristianBako/LLM-Anonymizer

No comments yet.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection