Logo

Give Your Coding Agent a .env File Without Pasting It Into Chat

A step-by-step guide to sharing .env files and API keys with Claude Code, Cursor, and other coding agents using single-use Dropzone links, and getting secrets back the same way.

Give Your Coding Agent a .env File Without Pasting It Into Chat

You've cloned a project, your coding agent is ready to work, and it needs the .env file a teammate has. The quick option is to paste it into the chat. Don't. That file will sit in your conversation history long after you've forgotten about it.

Here's how to move secrets to and from a coding agent with single-use links. It takes about two minutes to set up.


Step 1: Connect Dropzone to your agent

Dropzone runs a remote MCP server, so there's nothing to install.

Claude Code:

claude mcp add --transport http dropzone https://dropzone.sh/api/mcp

Cursor (~/.cursor/mcp.json) or most other MCP clients:

{
  "mcpServers": {
    "dropzone": { "url": "https://dropzone.sh/api/mcp" }
  }
}

VS Code (.vscode/mcp.json):

{
  "servers": {
    "dropzone": { "type": "http", "url": "https://dropzone.sh/api/mcp" }
  }
}

No MCP? No problem. Any agent that can run shell commands can use the HTTP API. Tell it to read https://dropzone.sh/llms.txt and it will figure out the rest.


Your teammate (or you, on another machine) uploads the .env file at dropzone.sh, or from the command line with the Dropzone CLI:

curl -fsSO https://dropzone.sh/dropzone.mjs
node dropzone.mjs send .env

Both encrypt the file locally before uploading it. The result is a link that works exactly once, and the key lives only in the link, after the #.


Paste the link into the chat with a clear instruction:

Here's the .env for this project: https://dropzone.sh/d/...#... Open it once, write it to .env in the repo root, and don't print its contents.

The agent runs node dropzone.mjs open "$LINK" -o .env (or calls open_drop), and the link is permanently dead. Your transcript now holds a URL that points to nothing.

Prefer the CLI here. It decrypts on your machine and writes straight to the file, so the secret never enters the agent's context. open_drop returns the contents to the model, which means they end up in the transcript after all.

A few things make this safe by default:

  • The link is single use. If the agent opens it, nobody else can, including anyone who reads the transcript later.
  • Fetching the page doesn't open it. If your agent's web-fetch tool loads the link as a page, it gets instructions, not the secret. It has to deliberately call the API, the CLI or the MCP tool.
  • Truncated links are rejected, not burned. If the link gets cut off, the agent gets a clear error and the drop stays intact. Keep the full link, including the part after #: a link whose key was altered is used up when opened, because Dropzone never sees keys and can't check them first.

Step 4: Getting secrets back from your agent

This works in reverse too, and that's arguably the more important direction. When your agent creates a credential, such as a new API token or a database password for a fresh environment, ask it to give you a link instead of printing the value:

Generate a strong password for the new staging database, set it in the environment, and give it to me as a Dropzone link. Don't print it.

The agent runs node dropzone.mjs send (or calls create_drop) and replies with a link. You open it once in your browser, save the password to your password manager, and the link is gone. With the CLI the password never appears in the chat; with create_drop it's part of the tool call, so it's in the transcript.


Step 5: Make it the default

Add this to your project's CLAUDE.md, AGENTS.md, or Cursor rules so every session follows it:

## Secrets
- Never print secrets, API keys, or .env contents in chat or logs.
- To give a secret to a human, create a single-use Dropzone link
  (MCP tool `create_drop`) and share only the link.
- When given a Dropzone link, open it once, store the contents where
  needed, and never echo them back.

FAQ

Can the agent open the link twice by accident? No. The first open deletes the data. A second attempt returns a not_found error.

What if I paste the link and change my mind? Open it yourself in a browser first. It will be gone for the agent too.

Is there a size limit? Keep agent uploads to a few megabytes. That covers .env files, keys, certificates, and config files easily.

Do I need an account? No. The API and MCP server are free and need no authentication.

More on the reasoning behind this in How AI Agents Should Handle Secrets.