# Varlock

> AI-safe .env file management with schemas for agents and secrets for humans, featuring validation, leak scanning, and runtime protection.

Varlock is an open-source CLI tool that brings schema-driven configuration management to `.env` files, making them safe for both AI agents and human developers. It provides a single source of truth via `.env.schema` files with type validation, coercion, and IntelliSense support. Varlock is purpose-built for the AI era, ensuring agents can read config context without ever accessing secret values, while proactive leak scanning and runtime log redaction prevent accidental exposure.

- **AI-safe config** — *AI agents read your schema (variable names, types, descriptions) but never your actual secret values, keeping credentials secure in agentic workflows.*
- **Proactive leak scanning** — *Run `varlock scan` or use git hooks to detect secrets accidentally committed or generated in AI-produced code.*
- **Runtime protection** — *Automatic log redaction and leak prevention guard secrets at runtime across your application.*
- **Schema validation & type safety** — *Define types (url, port, enum, string with constraints), required flags, and default values with full IntelliSense support via the VSCode extension.*
- **Multi-environment management** — *Auto-loads `.env.*` files based on your current environment flag, with explicit import support for flexible workflows.*
- **Flexible plugin system** — *Pull secrets declaratively from 1Password, AWS Secrets Manager, Azure Key Vault, GCP Secret Manager, HashiCorp Vault, Infisical, Bitwarden, KeePass, Passbolt, Proton Pass, and more.*
- **Framework integrations** — *Drop-in integrations for Astro, Next.js, and Vite add security guardrails with minimal setup.*
- **MCP server support** — *Varlock exposes its docs via MCP (HTTP and SSE) for seamless AI assistant integration.*
- **@env-spec DSL** — *Built on a new open DSL using JSDoc-style comments to attach schema and functionality directly to `.env` files.*
- **Easy installation** — *Install via `npx varlock init`, Homebrew, cURL, or Docker; run `varlock load` to validate and print your environment.*

## Features
- AI-safe config (agents read schema, never secrets)
- Proactive secret leak scanning via `varlock scan` and git hooks
- Runtime log redaction and leak prevention
- Schema validation, coercion, and type safety with IntelliSense
- Multi-environment management with auto .env.* loading
- Plugin system for 1Password, AWS, Azure, GCP, HashiCorp Vault, Infisical, Bitwarden, and more
- Framework integrations for Astro, Next.js, and Vite
- MCP server for docs (HTTP and SSE)
- @env-spec DSL for schema-annotated .env files
- VSCode extension for env-spec language support
- Docker image support
- Variable expansion and referencing

## Integrations
1Password, AWS Secrets Manager, Azure Key Vault, Google Secret Manager, HashiCorp Vault, Infisical, Bitwarden, KeePass, Passbolt, Proton Pass, Astro, Next.js, Vite, Docker, Git hooks

## Platforms
MACOS, API, VSC_EXTENSION, CLI

## Pricing
Open Source

## Version
@varlock/1password-plugin@1.0.2

## Links
- Website: https://varlock.dev
- Documentation: https://varlock.dev/getting-started/installation/
- Repository: https://github.com/dmno-dev/varlock
- EveryDev.ai: https://www.everydev.ai/tools/varlock
