# Guardry vs .env files

> A .env file gives every value to any process that can read it, while Guardry releases named values to one agent under limits and records each read.

A `.env` file is a plain-text file of names and values that any process with file access can read in full. Guardry Secrets is a hosted vault that releases named values to one agent at a time, under a scope, permissions and a lifetime you set, and records every release. With a file, access to the file is access to everything in it, and with a vault you decide access for each agent.

## The difference in general terms

| | A `.env` file | Guardry Secrets |
| --- | --- | --- |
| What it is | A plain-text file of names and values | A hosted vault, organised by organization, project and environment |
| Who can read a value | Any process with access to the file, in full | An agent whose credential allows it, and people according to their role |
| Limits for one agent | None in the file itself | A scope, an optional name prefix, permissions and a lifetime |
| Record of reads | None in the file itself | Every released value is written to the audit log before it leaves the vault |
| Where it lives | On a disk, and wherever the file is copied | In a hosted service |

## When Guardry fits better

- An AI agent works in the directory that holds the file. The agent can read the whole file, including values its task does not need.
- More than one agent or teammate needs the values, and the file is being copied between machines and people.
- You want to know which agent read which secret, and when.
- You want to end one agent's access in one step.
- You want a person to approve each read of a sensitive secret.
- You want agents to store new credentials they create, without being able to edit, rotate or delete existing entries.

## When the other option fits better

- **Nothing may leave your machine.** Guardry is a hosted service and is not self-hosted. A file that stays on your machine involves no other party.
- **No other party may be able to decrypt your values.** Guardry is not zero-knowledge and not end-to-end encrypted. The service decrypts a value in order to release it to an authorized agent.
- **A policy requires a certified or independently audited service.** Guardry has no compliance certifications today, and no independent security audit has been completed yet.
- **The file holds nothing sensitive.** If it contains only settings that are safe to show, a file is simpler.

## Using both

Guardry imports a `.env` file, a flat JSON file or pasted text, up to 100 entries and 512 KiB per import and 16 KiB per value. Nothing in the file is executed, and names that already exist are skipped.

After the import, a program gets its values when it starts, and nothing is written to disk:

```sh
guardry --profile coding-agent secrets run --secret API_KEY --secret DATABASE_URL -- python agent.py
```

Two things remain for you to do. Guardry does not delete the source file, so remove it yourself when you no longer need it. And if an agent has already read the file, the values are already with that agent. Replacing them at their providers is the only way to undo that.

A file can stay for settings that are safe to show.

[Request an invite](https://guardry.ai/invite/) or read [the setup guide](https://guardry.ai/docs.md).

## Questions

### Can an AI agent read my .env file?

If the agent can read files in the directory where the file is, yes, and in full. A `.env` file is plain text, and any process with file access can read every value in it.

### Can I import my .env file into Guardry?

Yes, up to 100 entries and 512 KiB per import, and 16 KiB per value. Existing names are skipped, nothing in the file is executed, and Guardry does not delete the source file.

### Does Guardry write secrets to disk?

`guardry secrets run` injects secrets into the environment of the program it starts, and nothing is written to disk.

---

Source: https://guardry.ai/compare/env-files/ · Updated 2026-11-27 · Guardry for language models: https://guardry.ai/llms.txt
