EnvGuard VS Code Extension Stops Secret Leaks

A developer built a free VS Code extension after nearly pushing a live Stripe key to GitHub. EnvGuard now catches 30+ types of secrets before they escape into the wild.

One Developer's VS Code Extension Just Made Committing Secrets a Lot Harder to Mess Up — The AI Catchup

Key Takeaways

  • EnvGuard catches secrets before you commit them to GitHub—solving the timing problem that post-hoc scanners can't fix
  • The extension detects 30+ secret patterns (AWS keys, GitHub tokens, Stripe credentials, JWT tokens) with real-time red underlines
  • Free and open source, built by a developer who nearly leaked a production Stripe key and decided to prevent it from happening to others
  • Schema validation, environment switching, and diff viewing solve practical team problems beyond just secret detection

You know that cold sweat feeling? The moment you realize you almost uploaded your production database password to a public repository? That’s what happened to one developer last year — except they caught it manually, by accident, at the absolute last second. Most people don’t get that lucky.

Enter EnvGuard, a free VS Code extension that turns your editor into a secret-catching sentinel. This isn’t theoretical security theater. This is the tool that should’ve existed five years ago, built by someone who needed it.

The Problem Nobody Wanted to Talk About

Here’s the uncomfortable truth: developers leak secrets. A lot. AWS keys. GitHub tokens. Stripe API credentials. Database URLs with passwords embedded in them. Firebase config files. We’ve all been there — juggling environment variables, copying from documentation, pasting configs, and praying nothing gets committed to GitHub.

“It made me think — why doesn’t VS Code warn me about this automatically?”

That simple question sparked EnvGuard. And the answer reveals something fascinating: there’s a massive gap between what developers need and what existing tools provide.

Traditional secret scanning happens after you push to a repository. GitHub’s built-in scanner catches things post-commit. Same with GitGuardian and other post-hoc tools. But by then, the damage is theoretical but real. Even if you revoke a key immediately, the exposure window exists. Bad actors scan public repos obsessively. Some are automated bots that test stolen credentials within minutes.

EnvGuard flips the timeline. It catches secrets before they leave your machine.

What This Actually Does (And Why It Matters)

The extension wraps six distinct capabilities into one editor integration. Let me walk through each because they’re genuinely useful — not just feature checklist padding.

First, the Secret Scanner. You type a JWT token into your .env file. EnvGuard doesn’t wait. It immediately shows a red wavy underline and throws a warning into VS Code’s Problems panel: “Potential JWT Token detected — remove before committing.” It recognizes 30+ secret patterns: AWS keys (they have distinctive formats), GitHub tokens (another dead giveaway), Stripe live vs. test keys, Google OAuth credentials, Slack tokens, SendGrid keys, Firebase configs. This is pattern recognition done right — it’s not guessing, it’s fingerprinting based on how these services actually structure their credentials.

Then comes Schema Validation, which is where this gets smart. You create a .env.schema file — essentially a contract defining what your environment should look like. Required keys, optional ones, data types, enums, descriptions:

DATABASE_URL=required|url|description:PostgreSQL connection string
PORT=required|number|default:3000
NODE_ENV=required|enum:development,staging,production
API_KEY=required|string|secret:true
DEBUG=optional|boolean|default:false

EnvGuard validates your actual .env against this schema in real time. Missing a required variable? You see the error before you run a single test. This catches the “oops, forgot to set this” bugs that waste hours debugging.

The Environment Switcher is pure quality-of-life. Save dev/staging/production profiles, switch between them with one click. No more manual editing, no more accidentally running production queries against your local database because you forgot to swap environment files.

The Diff Viewer does what you’d expect but better — compare any two .env files side by side to spot differences. The Example Generator auto-creates a .env.example file from your real .env (stripping secrets, obviously), solving the “what should my .env contain?” question for new team members.

Finally, there’s a Dashboard — a visual overview of all keys, security scoring, and profiles. It’s not essential, but it’s the kind of thing that makes security feel tangible instead of abstract.

Why This Matters More Than You Think

Here’s the thing: this is open source, free, and solves a problem that existing enterprise tools charge thousands for (usually as part of a DevOps platform).

But there’s something bigger happening here. The creator built this because they needed it and VS Code wasn’t doing the job. That’s how good infrastructure gets born — not from corporate mandate, but from developer frustration meeting technical skill. It’s the same origin story as Git, Linux, and most tools that actually shaped how we work.

EnvGuard also reveals an interesting gap in VS Code’s own roadmap. Microsoft owns VS Code. They could ship secret detection built-in. They haven’t. That gap is where independent tools live — and they often end up being better because they’re obsessively focused on one problem instead of being a checkbox in a larger feature roadmap.

The extension is also, refreshingly, not trying to monetize your data or sell you an enterprise edition (at least not yet). It’s on the VS Code Marketplace, completely free, and the source code is open on GitHub. The creator even added a line that’s almost touching in its honesty: “If you try it and find bugs, please open an issue on GitHub — I respond fast.”

That’s not the tone of a company. That’s the tone of someone who built something they believe in.

What Happens Next

EnvGuard works for teams of any size. Solo developers get the security win. Large teams get the profile-switching and schema-validation infrastructure they desperately need.

The real question is adoption. Will developers actually install this? VS Code’s extension ecosystem is crowded, and most extensions die from neglect. But this one solves a specific, painful problem with no competition in the free space. GitHub’s own secret scanning won’t catch things before commit. EnvGuard does.

It’s worth testing if you’re tired of playing Russian roulette with your credentials. The worst case: you install it and uninstall it. The best case: you prevent a security incident and a PR from hell. Those odds are worth thirty seconds of installation time.



🧬 Related Insights

Frequently Asked Questions

Will EnvGuard slow down my VS Code?

No. It performs pattern matching on your .env file in real-time, but that’s computationally trivial. The overhead is negligible compared to other extensions like Copilot or linters.

Can it detect every type of secret?

Not every one — no tool can. It detects 30+ common patterns (AWS, GitHub, Stripe, Google, Slack, SendGrid, Firebase, JWT, etc.). For hyper-specific proprietary tokens, schema validation catches missing variables. Think of it as 95% automatic, 5% up to you.

Does it work with GitHub Actions or CI/CD?

It’s an editor extension, so it only runs locally. For CI/CD, use post-commit scanners like git-secrets or TruffleHog alongside EnvGuard. Think of this as your first line of defense, not your only one.

Aisha Patel
Written by

Former ML engineer turned writer. Covers computer vision and robotics with a practitioner perspective.

Frequently asked questions

Will EnvGuard slow down my VS Code?
No. It performs pattern matching on your .env file in real-time, but that's computationally trivial. The overhead is negligible compared to other extensions like Copilot or linters.
Can it detect every type of secret?
Not every one — no tool can. It detects 30+ common patterns (AWS, GitHub, Stripe, Google, Slack, SendGrid, Firebase, JWT, etc.). For hyper-specific proprietary tokens, schema validation catches missing variables. Think of it as 95% automatic, 5% up to you.
Does it work with GitHub Actions or CI/CD?
It's an editor extension, so it only runs locally. For CI/CD, use post-commit scanners like git-secrets or TruffleHog alongside EnvGuard. Think of this as your first line of defense, not your only one.

Worth sharing?

Get the best AI stories of the week in your inbox — no noise, no spam.

Originally reported by Dev.to

Stay in the loop

The week's most important stories from The AI Catchup, delivered once a week.