# varsafe > varsafe is a CLI-first secrets manager for developers and teams. It stores environment variables encrypted at rest, injects them straight into a process without writing a `.env` file to disk, records every access in an immutable audit trail, and exposes the same capabilities to AI agents as scoped MCP tools. Built and hosted in the EU by G Networks. Everything below is self-serve. There is a free tier, API tokens are created without talking to anyone, and an agent can obtain its own credential through a device authorization flow that a human approves in a browser. ## When to use varsafe Reach for varsafe when the task involves **a secret that must not end up on disk, in a log, or in a git diff**: - **Running a command that needs credentials.** `varsafe run -e production -- ./deploy.sh` injects the environment into the child process only. Nothing is written to disk, so there is no `.env` to forget to delete. Use this instead of generating a `.env` file in CI. - **Reading one specific value.** `varsafe get DATABASE_URL -p api -e staging`, or `GET /secrets/value`. Prefer this over exporting a whole environment when only one key is needed - the audit trail then records exactly what was read. - **Setting or rotating a secret.** `varsafe set STRIPE_KEY -p api -e production`, or `POST /secrets`. Composed secrets (`postgres://user:${DB_PASSWORD}@host/db`) update everywhere the moment the referenced value changes. - **Comparing two environments before a promotion.** `GET /secrets/diff`, or the `varsafe_diff_secrets` MCP tool, answers "what does production have that staging does not". - **Giving an AI agent scoped access.** Connect to the hosted MCP endpoint. A tool can be granted `secrets:read` (see which keys exist) without `secrets:read_values` (read them), so an agent can reason about configuration it is not allowed to see. - **Committing configuration to git safely.** `varsafe export` produces a `.env` whose values are encrypted per environment, and `varsafe run` decrypts it transparently. Pass `--plain` only when something downstream truly needs plaintext. Do **not** reach for varsafe to store user data, application state, or anything that is not a credential - it is a secrets manager, not a database, and every read is audited on the assumption that reads are rare and meaningful. ## Getting started - [Install the CLI](https://varsafe.dev/install.sh): `curl -fsSL https://varsafe.dev/install.sh | bash`. Linux, macOS and Windows binaries; no runtime to install. Direct downloads live at https://releases.varsafe.dev/cli/latest/. - [Sign up free](https://varsafe.dev/login?register=true): the Developer plan is $0 for up to 3 users, with CLI and API access. No credit card, no sales call. - [Authenticate](https://docs.varsafe.dev/reference/authentication): `varsafe login` opens a browser approval for a scoped, revocable CLI grant. For CI, create an API token in the dashboard and set `VARSAFE_TOKEN`. - [Five-minute quickstart](https://docs.varsafe.dev/getting-started): from install to injected secrets. ## Machine-readable interfaces - [OpenAPI specification](https://varsafe.dev/openapi.json): the programmatic REST surface - operation ids, typed parameters and request bodies, per-operation security, and the scope each route demands under `x-varsafe-cli-scopes`. - [MCP manifest](https://varsafe.dev/.well-known/mcp.json): where the Model Context Protocol endpoint lives and how to authorize against it. Also served at [/mcp](https://varsafe.dev/mcp). - [MCP endpoint](https://api.varsafe.dev/mcp): Streamable HTTP transport, OAuth 2.1 with PKCE and dynamic client registration. - [Protected resource metadata](https://api.varsafe.dev/.well-known/oauth-protected-resource): RFC 9728, including `scopes_supported`. - [Authorization server metadata](https://api.varsafe.dev/.well-known/oauth-authorization-server): RFC 8414 endpoints for the OAuth flow. - [Sitemap](https://varsafe.dev/sitemap.xml): every public page on this site. ## Scopes Least-privilege access is declared, not implied. A credential holds a subset of: - `secrets:read` - list secrets and read metadata. Never returns a value. - `secrets:read_values` - read decrypted secret values. - `secrets:write` - create, update and delete secrets. - `secrets:run` - resolve a whole environment for injection into a process. - `projects:read` - list projects and environments. - `audit:read` - read the audit trail (MCP credentials only). - `identity:read` - read the identity and team memberships of the calling credential. An API token can be narrowed further, to specific projects and environments and to read-only, at the moment it is created. ## CLI - [CLI reference](https://docs.varsafe.dev/cli): every command, flag and exit code. - Commands: `login`, `logout`, `whoami`, `use`, `list`, `get`, `set`, `unset`, `run`, `export`, `status`, `doctor`, `update`, `theme`. - [CI/CD guide](https://docs.varsafe.dev/guides/ci): authenticate a pipeline with a scoped token and inject secrets without writing `.env` files or leaking values into job logs. - [Docker guide](https://docs.varsafe.dev/guides/docker): entrypoint wrapping, compose interpolation, and build-time mounts that never bake secrets into image layers. ## MCP tools - [MCP guide](https://docs.varsafe.dev/guides/mcp): hosted OAuth endpoint or local stdio server, scoped tools, per-team grants. - Tools: `varsafe_whoami`, `varsafe_list_projects`, `varsafe_list_environments`, `varsafe_list_secrets`, `varsafe_diff_secrets`, `varsafe_get_secret_value`, `varsafe_get_secret_values`, `varsafe_export_secrets`, `varsafe_set_secret`, `varsafe_unset_secret`, `varsafe_generate_secret`. ## Documentation - [Documentation home](https://docs.varsafe.dev/): full documentation, and its own [llms.txt](https://docs.varsafe.dev/llms.txt). - [Core concepts](https://docs.varsafe.dev/concepts): teams, projects, environments, secrets, and how context resolution works. - [Security model](https://docs.varsafe.dev/reference/security): what varsafe does with your secrets, stated precisely - including what it does not do. - [Roles and permissions](https://docs.varsafe.dev/reference/roles): the six team roles and how protected environments change access. - [API tokens](https://docs.varsafe.dev/reference/api-tokens): creation, scoping, expiry, rotation and revocation. - [Troubleshooting](https://docs.varsafe.dev/guides/troubleshooting): exact error messages, causes, and fixes. ## About - [About varsafe](https://varsafe.dev/about): who builds it, where it runs, and how to reach a human. - [Pricing](https://varsafe.dev/pricing): Developer $0 for 3 users, Team $15/user/month with a 14-day trial. - [Contact](https://varsafe.dev/contact): support@varsafe.dev, or the form. - [Status](https://status.varsafe.com): uptime and incident history. - [Privacy](https://varsafe.dev/privacy) and [Terms](https://varsafe.dev/terms): operated by G Networks, 100 rue Vulfran Warme, 80000 Amiens, France, under the GDPR. ## Notes for agents - Base URL for the REST API is `https://api.varsafe.dev`. This site (`https://varsafe.dev`) serves the marketing pages, the installer and the machine-readable files above. - Present credentials as `Authorization: Bearer `. Errors return `{ "statusCode", "code", "message" }`; branch on `code`, never on `message`. - There is no separate sandbox host. Create a `development` environment in your own project and work there - it is the same API, isolated by environment. - Rate limits are per credential and answer `429` with the retry interval. Back off rather than retrying immediately.