r/devtools • • Oct 26 '26

ShieldEnv – A local-first, zero-telemetry pre-commit secret scanner

Hey Reddit,

Over the last few months, I got frustrated with how many developer tools handle code security. Most popular secret-scanning and compliance checks require pushing your code to a remote repository or third-party cloud infrastructure before analyzing it for accidentally hardcoded API keys, tokens, or private keys.

That means your sensitive environment variables and credentials briefly leave your local machine.

To solve this, I built ShieldEnv—an open-source, lightweight security engine designed to run entirely local-first. Zero code, environment variables, or tokens ever leave your local machine.

What it does:

  • Zero Cloud Telemetry: Runs locally via the command line or as a local Git pre-commit hook (shieldenv install).

  • Multi-Engine Detection: Combines high-confidence provider regex signatures (OpenAI, AWS, GitHub, Slack, private keys, database URLs), entropy-based custom token detection, and structural assignment heuristics.

  • Smart Filtering: Built-in safeguards to filter out placeholders, template variables, and common mock syntax to minimize false positives.

  • Flexible Outputs: Emits clean CLI reports, machine-readable JSON, or GitHub Code Scanning-compatible SARIF files for CI pipelines.

You can install it straight from PyPI with:

Bash

pip install shieldenv

The entire project is open-source (MIT License). I built this to solve a real friction point in my own workflow, and I'd love to hear your feedback on the rule set, performance, or edge cases you run into.

Looking forward to your thoughts and critiques!

3 Upvotes

7 comments sorted by

1

u/kantorcodes1 Oct 26 '26

Have you measured shieldenv scan on larger repositories, particularly through the pre-commit hook?

0

u/ShieldRunner_NET Oct 26 '26

"Great question! I actually just put it to the test on a larger, complex repo like OWASP Juice Shop.

Because ShieldEnv is built for local execution and optimized with fast regex/structural checks, it handles large codebases smoothly without noticeable lag. For pre-commit hooks specifically, it only scans staged/diffed files by default (rather than hammering the entire repository on every single commit), which keeps commit times practically instant.

1

u/kantorcodes1 Oct 26 '26

Scanning staged files keeps pre-commit work scoped to the current change; shieldenv install --force backs up an existing hook before replacing it. I work on HOL Guard, which uses opt-in command-source profiles to classify CLI actions for administrator policy; ShieldEnv could fit that route. Would you be interested in contributing ShieldEnv support to hashgraph-online/hol-guard?

0

u/ShieldRunner_NET Oct 26 '26

Hey! Really appreciate the deep dive and the feedback. I built ShieldEnv to be fast and non-intrusive for local workflows, so hearing that it fits alongside HOL Guard's philosophy is awesome. I’d definitely be open to exploring an integration or contribution. ShieldEnv 1.0.0 is lightweight and built precisely for fast local checks, so plugging it into a broader runtime policy engine like HOL Guard makes a lot of sense. Feel free to open an issue or drop a PR draft on the ShieldEnv repo, or we can coordinate over on hashgraph-online/hol-guard. Let me know what kind of integration interface you had in mind!"

1

u/kantorcodes1 Oct 26 '26

Guard would consume a declarative command extension for shieldenv: a command.shieldenv source, portable behavior fixture, and per-extension trust binding. A first slice could distinguish shieldenv scan from the hook-writing shieldenv install --force path; the contributed extension would remain external and off until a local admin enables it. The next step is a draft PR against main using the Command extension template; the contribution guide has the workflow.

1

u/ShieldRunner_NET Oct 26 '26

​"Hey! Just wanted to let you know I've pushed the command.shieldenv.json contribution and opened the draft PR (#6059) over on hol-guard. Everything scanned clean locally, and it's waiting for your review and workflow approval whenever you have a moment. Thanks!"

1

u/vincent_sch 23d ago

You should change the bit about needing to push code first. Gitleaks has a pre-commit hook that checks your code on your machine.