The Security Engineering Behind VEN

2026-10-25

Every developer has a folder somewhere that looks like this:

.env
.env.local
.env.production
.env.backup
.env.old-dont-delete

And somewhere in Slack, there's a message from six months ago that says "here's the Stripe key, don't share it." Everyone has shared it.

That's how most of us handle secrets. API keys, database passwords, tokens, all sitting in plaintext files, copied between laptops, pasted into chats, and occasionally, accidentally, pushed to GitHub. We've all seen the tweet: "I committed my AWS keys and woke up to a $4,000 bill."

So we built VEN. It's an open-source vault for your environment variables. You import your .env files, organize them by project and environment (development, staging, production), and pull them back out when you need them, from the terminal or a small dashboard in your browser. And now you can share them with your team without anyone ever pasting a secret into Slack again.

But here's the thing about building a tool that holds people's secrets: it is only as good as its security. A vault that leaks is worse than no vault at all, because it gives you false confidence. So this post is about how we thought about that, the decisions we made, and why we made them.

I'll keep it light. You don't need to be a cryptographer to follow along. (I'm not one either. That's actually rule number one, but we'll get there.)

The stack

VEN is one Go binary. That's it. One file you download and run.

  • Go for the CLI, the dashboard server and the team server. It compiles to a single file for Linux, macOS and Windows, which makes installing it painless.
  • SQLite for storage, using a pure-Go driver. No C compiler needed, no database to set up. Your vault is just one file on your disk.
  • React + TypeScript + Vite for the dashboard, styled with Tailwind and some shadcn-style components.
  • The whole frontend is baked into the binary. When you open the dashboard, nothing loads from the internet. No CDN, no Google Fonts, no third-party scripts. That's a security decision too, and I'll explain why later.

We kept the dependency list deliberately small. Every library you add is code you're trusting with people's secrets, so we only added what we actually needed.

What VEN does

Before the security part, here's what it actually looks like to use:

ven init                                  # choose a master password
ven projects create "Billing API"         # creates dev, staging, production
ven import .env -p billing-api -e development
ven get STRIPE_SECRET_KEY -p billing-api -e development
ven export -p billing-api -e development --out .env
ven ui                                    # open the dashboard

Import shows you a preview before it writes anything: which keys are new, which changed, which stayed the same. If something conflicts, it asks you what to do. Nothing is ever silently overwritten.

And for teams:

ven login                         # sign in with GitHub
ven share --to octocat --env development
ven run -- npm run dev            # inject variables, no .env file on disk

That last command is my favourite. ven run hands your variables straight to your app without ever writing a .env file. No file means nothing to accidentally commit.

Okay. Now the fun part.

Rule #1: Don't invent your own crypto

This is the first thing every security engineer will tell you, and it's the one we followed most strictly. Writing your own encryption is how you end up on Hacker News for the wrong reasons.

So VEN doesn't do anything clever. It uses well-known, battle-tested building blocks, straight from the Go standard library:

  • AES-256-GCM to encrypt your values. It's the same encryption your bank and your browser use.
  • Argon2id to turn your master password into a key. It won a password-hashing competition, and it's designed to be slow and memory-hungry on purpose, so someone trying to guess your password has to work very hard for every single guess.

The trick is in how we put them together.

Two keys, not one

When you run ven init, VEN generates a random key. This is the key that actually encrypts all your values. Your master password does not encrypt your values directly. Instead, your password is used to lock up that random key.

Think of it like a safe inside a safe. Your values are in the inner safe. The key to the inner safe is locked inside an outer safe, and your password opens the outer one.

Why bother? Because it means changing your password is instant. We just re-lock the inner key with your new password. None of your actual values need to be touched or re-encrypted. It also means we can give you a recovery key: a second, independent way to open the outer safe. If you forget your master password, the recovery key lets you set a new one. Nobody else can do that for you, including us.

Every secret is glued to its place

Here's a subtle one that I'm quite proud of.

Imagine someone gets hold of your vault file and can edit it. They can't read your values, they're encrypted. But what if they take the encrypted value of your development database password and swap it into the production slot? Or move a value from one project to another?

With plain encryption, that might just work. The value would decrypt fine, it would just be in the wrong place.

So when VEN encrypts a value, it also stamps it with where it belongs: which vault, which project, which environment, which variable. That stamp isn't secret, but it's checked during decryption. If anyone moves an encrypted value somewhere it doesn't belong, decryption fails loudly instead of quietly giving you the wrong secret. Tampering gets detected, not silently accepted.

We do the same with the password settings. If someone edits the file to weaken the Argon2id settings (to make guessing faster), the vault simply refuses to unlock. We also only accept settings within sensible limits, so a tampered file can't make VEN use 50GB of memory or nearly no protection at all.

Being honest about what's not encrypted

Here's a decision some people might find surprising: variable names are not encrypted in the local vault. Your project names, environment names and key names like STRIPE_SECRET_KEY are readable by anyone who has the file. The values are always encrypted, every single one.

Why? Because it lets you run ven list and see what's in a project without typing your password every time. That's a real usability win.

But we didn't hide this trade-off. It's written plainly in the docs, so you know not to put anything sensitive in a variable's name or description. I think that's one of the most important parts of security engineering: saying out loud what you don't protect. We have a whole section of the docs called "Out of scope." If malware is running on your unlocked laptop, VEN can't save you, and we say so. No tool can, and any tool that claims it can is lying.

The dashboard: a website that only talks to you

This is where it got really interesting.

The dashboard runs on your own machine at 127.0.0.1. It never touches the internet. You'd think that makes it safe automatically. It doesn't.

Your browser has lots of tabs open. Any of those websites could try to send requests to 127.0.0.1:7420 in the background and ask your local dashboard for your secrets. So we had to defend against websites you visit, not just hackers on the network. Here's what we did:

1. The launch link. When you run ven ui, it prints a link with a one-time random token. That token lives after the # in the URL, the part browsers never send to servers or write in logs. The page uses it once, removes it from the address bar, and keeps the session only in memory.

2. Checking who's knocking. Every request must say it's for 127.0.0.1 or localhost. That blocks a sneaky attack called DNS rebinding, where a malicious website tricks your browser into thinking its domain points to your own machine.

3. CSRF protection on everything. Every request needs a special token that only the real dashboard page holds. A random website can't get it, so it can't act on your behalf. We even require it on reads, not just writes.

4. Origin checks. Requests that change things must come from the dashboard itself. Anything marked as coming from another site is refused.

5. A strict Content Security Policy. The dashboard is only allowed to load scripts and styles from itself. This is why we bundle everything into the binary: if we loaded a font from Google or a script from a CDN, that's another party we'd have to trust. Now there isn't one.

6. Slowing down password guessing. After 5 wrong passwords, each new attempt has to wait longer and longer, up to 5 minutes.

7. Auto-lock. If you walk away, the dashboard locks itself after 15 minutes (you can change this). When it locks, the key is wiped from memory and the page throws away everything it had loaded.

8. Secrets don't hang around. When you click "reveal" on a secret, it hides itself again after 30 seconds. Nothing is ever saved to localStorage, the URL, or the browser cache.

None of these on its own is magic. Security is layers. Each one assumes the one before it might fail.

Teams: the server can't read your secrets

The local vault is great when it's just you. But the real pain with .env files is sharing them. So we built team sharing, and we set ourselves one goal:

A leaked invite, a hacked GitHub account or a fully breached server, on its own, should never expose a secret.

That last one matters most. We run a VEN server, and we can't read your secrets. Neither could anyone who hacked us.

That's because team projects are end-to-end encrypted. Your values are encrypted on your laptop before they're uploaded. The server only ever stores scrambled data it has no key for. It doesn't even see your variable names, just one encrypted blob per environment.

Here's how it works without the jargon:

  • GitHub login tells the server who you are. That's it. It decides which projects you can download.
  • Your account password unlocks your personal key, and that password never leaves your machine. Your personal key is what actually decrypts things.

You need both. Steal someone's GitHub account, and you can see project names, but you still can't decrypt anything without their password. Steal the server's database, and you get a pile of encrypted data and no keys.

Invites you can paste anywhere

When you share a project, VEN gives you an invite code to send to your teammate. We wanted it to be safe to paste in Slack or email, because that's where people will paste it anyway. So the invite code:

  • only works for the GitHub account you named,
  • works exactly once,
  • expires in 24 hours,
  • and contains a secret piece that the server never sees.

Even if someone intercepts it, it's useless to them unless they're also logged in as your teammate.

Production is special

For production environments, an invite isn't enough. The owner has to approve the teammate, and both sides compare a short fingerprint code, kind of like WhatsApp's security codes. This protects against the worst case: a compromised server quietly swapping in its own key to sneak into your production secrets.

Access expires on its own

Team access lasts 30 days by default. We've all seen it: the intern who left two years ago still has access to everything. With VEN, forgotten access ends by itself. Renewing is one command.

And when you remove someone, VEN rotates the keys: it generates new ones, re-encrypts everything, and hands the new keys only to the people still on the team.

The honest part

But I'll be straight with you here, because it's important: if a teammate already pulled a secret before you removed them, they still know it. No tool on earth can un-share a secret. What VEN can do is show you an audit log of what they accessed, so you know exactly which keys to rotate at Stripe, AWS or wherever they came from. We put that in the docs too, in a section literally titled "What a leak costs, honestly."

Tokens for CI

Your GitHub Actions pipeline isn't a person with a GitHub account, so it gets a service token instead. Tokens are read-only, scoped to the environments you choose, and must expire (one year max). And like invites, they carry their own secret, so the server still can't decrypt anything.

Guard: stopping the leak before it happens

All of this protects secrets stored in VEN. But most leaks happen the boring way: someone runs git add . and commits their .env.

So we built ven guard. It's a pre-commit hook that checks every commit for .env files (including sneaky ones like env.local and .env_local) and, more interestingly, for any secret value you keep in VEN, even if you pasted it into some random config file.

The clever bit: guard needs to recognise your secrets without knowing your password at commit time. So VEN stores fingerprints of your secrets, not the secrets themselves. When you commit, guard checks if anything in your changes matches a fingerprint. If it does, the commit is blocked and you see a masked preview of what almost leaked.

You can even scan your entire Git history with ven guard scan --history to find old mistakes.

The boring stuff that matters

Some smaller things we did that nobody will notice, which is exactly the point:

  • Passwords and secret values are never accepted as command-line arguments, because those can show up in your shell history and in process lists. You type them in hidden prompts, or pipe them in.
  • Exported .env files are written with owner-only permissions, and never overwritten without asking.
  • Error messages report line numbers, never values. A broken .env file won't print your secrets into your terminal.
  • Deleted secrets are overwritten in the database file, not just marked as deleted.
  • Imports happen in one transaction. If anything fails halfway, nothing is changed.
  • The install script verifies a checksum before installing anything.

Being honest about where we are

VEN is open source under Apache 2.0, and you can read every line of it. But here's what I want you to know: VEN has not had an external security review yet. We say that at the very top of the README, in bold. The team features are a preview.

I'd rather tell you that upfront than have you trust it with your production credentials based on a blog post. Security isn't something you claim, it's something you earn through review, time and people trying to break it. If you find a vulnerability, please report it privately through GitHub's security tab. We'd genuinely love that.

What I learned building this

Building VEN changed how I think about software. A few takeaways:

  1. Use boring, proven tools. The exciting part of security engineering isn't inventing algorithms. It's putting standard pieces together correctly.
  2. Assume every layer fails. Every defense in the dashboard assumes the one before it got bypassed.
  3. Security has to be easy, or people won't use it. ven run is more secure than a .env file and more convenient. That's the sweet spot.
  4. Write down what you don't protect. An honest "out of scope" section builds more trust than any marketing page.
  5. Less is more. Fewer dependencies, no third-party scripts, one binary. Every piece you don't add is one less thing that can betray you.

Try it

If you're tired of passing .env files around:

curl -fsSL https://ven.traceiq.run/install.sh | sh

On Windows, use PowerShell:

irm https://ven.traceiq.run/install.ps1 | iex

Read the docs at ven.traceiq.run/docs, check out the code on GitHub, and if you break something, tell us.

Stop pasting secrets in Slack.

Let's build.