Use cases

Secret manager for Cursor

Give Cursor's agent your project's API keys to run commands with, without putting a single value in its context.

Cursor's agent can run terminal commands for you, and most real commands need secrets: a database URL, a Stripe key, an OpenAI key. A .env file in the workspace is one file read away from the model's context.

With dotsafe, the agent asks dotsafe to run the command instead. You approve it with Touch ID, the command gets your variables, and the agent reads back output with every secret value replaced by [dotsafe:NAME].

Set up

Install the dotsafe command from the app (Settings → Agents → Install), then add it to ~/.cursor/mcp.json:

{  "mcpServers": {    "dotsafe": {      "command": "/usr/local/bin/dotsafe",      "args": ["mcp"]    }  }}

Use the full path: Cursor opened from the Dock doesn't look in /usr/local/bin. dotsafe mcp setup prints this block with the right path.

Move your .env out of the workspace

dotsafe import          # reads ./.env into the project's development environmentrm .env

Now the agent can see that DATABASE_URL exists, but not what it is. When it needs to run npm run dev or a migration, it asks dotsafe, and you approve it.

What the agent gets

Without dotsafeWith dotsafe
Variable namesIn .envListed by dotsafe
ValuesReadable in .envNever returned
Command outputRaw, keys includedKeys replaced by [dotsafe:NAME]
OpenAI and Anthropic keysIn the processBehind a local proxy
Record of useNoneEncrypted audit log

More in A secret manager for AI agents.

Keep your secrets yours.

Set up a vault in a minute and bring your .env files with you.