Encryption & Security
Threat Model
What vars protects against — and what it doesn't.
What vars protects against
- Accidental commits — the
.varsfile only contains encrypted blobs for secrets. You can commit it safely. - Log leaks —
Redacted<T>keeps secrets out of structured logs, error reporters, andconsole.logdumps. - Unauthorized file access — if someone gets your
.varsfile (leaked backup, overly-permissive S3 bucket), they get ciphertext. Useless without the PIN orVARS_KEY. - Lateral access within a team — owner PINs mean the frontend team can't decrypt backend secrets, even with access to the same repo and key file. Different keys, not just different permissions.
- Automated tools and AI agents — a tool with file-system access can read the file but can't decrypt it. The PIN prompt blocks it.
What vars doesn't protect against
- A compromised machine where the attacker also knows the PIN. If they can sit at your keyboard and type your PIN, they can decrypt everything. vars doesn't solve physical security.
- Memory on a live system. Once values are decrypted in memory for your running app, an attacker with OS-level access can read them. This is true of every secret manager, not just vars.
- PIN brute-forcing with offline access. If an attacker copies your
.varskeyfile, they can attempt to guess the PIN offline. Argon2id makes it slow and expensive, but a weak PIN is still a weak PIN. - Supply chain attacks. vars can't help if a dependency is exfiltrating
process.envvalues after injection. Audit your dependencies. VARS_KEYexposure. If your CI secrets are compromised andVARS_KEYleaks, rotate immediately withvars key rotate. On a serverless bundle, an attacker who obtains bothVARS_KEYand the deployed artifact can decrypt every secret in that artifact — same blast radius as pushing each secret individually into the platform dashboard, but concentrated on one key. TreatVARS_KEYwith the same care you'd give a root deploy token.