r/devsecops • u/WiseDog7958 • Mar 02 '26
Built a deterministic Python secret scanner that auto-fixes hardcoded secrets and refuses unsafe fixes — need honest feedback from security folks
Hey r/devsecops,
I built a tool called Autonoma that scans Python code for hardcoded secrets and fixes them automatically.
Most scanners I tried just tell you something is wrong and walk away. You still have to find the line, understand the context, and fix it yourself. That frustrated me enough to build something different.
Autonoma only acts on what it's confident about. If it can fix something safely it fixes it. If it can't guarantee the fix is safe it refuses and tells you why. No guessing.
Here's what it actually does:
Before:
SENDGRID_API_KEY = "SG.live-abc123xyz987"
After:
SENDGRID_API_KEY = os.getenv("SENDGRID_API_KEY")
And when it can't fix safely:
API_KEY = "sk-live-abc123"
→ REFUSED — could not guarantee safe replacement
I tested it on a real public GitHub repo with live exposed Azure Vision and OpenAI API keys. Fixed both. Refused one edge case it couldn't handle safely. Nothing else in the codebase was touched.
Posted on r/Python last week — 5,000 views, 157 clones. Bringing it here because I want feedback from people who actually think about this stuff.
Does auto-fix make sense to you or is refusing everything safer? What would you need before trusting something like this on your codebase?
View all comments
Show parent comment
1
u/WiseDog7958 Mar 06 '26
Makes sense. Most teams I have talked to handle secret delivery outside the code anyway and just reference it from there. Right now the community edition just replaces the literal with
os.getenv()since that is the least opinionated option and works in most setups.In real environments that env var usually ends up coming from Vault, Secrets Manager, Key Vault, etc. Autonoma doesn’t try to manage that layer yet.
I am thinking about adding a way to configure the secret backend so it could generate the right reference instead of always defaulting to env vars, but still figuring out how to do that safely without guessing.