Give AI agents secrets without exposing them

Dev, web & IT · checked 2026-10-16

Use 1Password Environments and its local MCP server so coding agents can manage environment variables and mount .env files without the secret values ever being returned to the agent or committed to code.

Independent review. IonBin has no partnership with any tool on this page and was not paid for this page. Our evaluation is our own, based on public documentation and our research. Product names are trademarks of their owners and are used for identification only. How disclosure works.

Goal

Stop API keys leaking through prompts, logs and repositories.

Connects through: MCP

Steps

#WhoWhat happensHowStatus
11Password Manages Environments and mounts .env files locally; never returns secret values
Runs inside the 1Password desktop app and asks you to approve access per Environment.
MCP Confirmed · source ↗
2Your coding agent Uses the mounted .env file at run time AI platform Confirmed
3You Rotate any key that has ever appeared in a chat or commit Human step Confirmed

Confirmed means the vendor documents it (linked). It doesn't mean IonBin has tested it. AI-platform and human steps need no source.

Human approval

You decide which agents get which Environments.

Watch out for

Keep the human approval step: You decide which agents get which Environments.

Starter prompt

Goal: Stop API keys leaking through prompts, logs and repositories. Tools involved: 1Password. Your part: manages environments and mounts .env files locally; never returns secret values; uses the mounted .env file at run time. Work step by step, show me each draft or proposed change, and wait for my approval before anything is sent, published, signed, filed or changed in a live system.

Assembled from this page’s goal and steps. Paste it into your AI platform and adjust it to your situation.

Tools in this workflow

ToolRoleOfficial site
1PasswordMCP 1password.com ↗

Which AI platforms can run it

PlatformStatusWhy
Claude (incl. Claude Code) Confirmed Every MCP and API step is documented for this platform.
OpenAI Codex Confirmed Every MCP and API step is documented for this platform.
Google Antigravity To verify 1Password: pairing not named in vendor docs
ChatGPT To verify 1Password: pairing not named in vendor docs
Gemini To verify 1Password: pairing not named in vendor docs
Perplexity To verify 1Password: pairing not named in vendor docs

Computed from the MCP and API steps only: "Confirmed" needs the tool's docs to name the platform and the platform to support the connection. Browser, upload and human steps work from any platform.

What we checked

1Password’s Environments MCP server lets MCP clients such as Claude Code, Codex, Cursor and Kiro create, list and rename Environments, list variable names, add variables and create locally mounted .env files. It can only see variable and Environment names. By design it can’t return secret values to the client, even if an agent asks. The server runs locally inside the 1Password desktop app and shows an authorization prompt when a client connects or uses a tool that needs per-Environment approval. It needs a client that supports stdio; remote-only clients aren’t supported. 1Password Enterprise Password Manager admins can turn the feature on or off under Policies → Agentic permissions.

Set it up

  1. Install the 1Password desktop app and create an Environment for the project.
  2. In 1Password, go to Settings → Developer and turn on Integrate with MCP clients.
  3. Add the server to your coding agent and approve the prompt.
  4. Ask the agent to mount a .env file for the project.
  5. Rotate any key that has ever been pasted into a chat or commit.

Sources

No affiliate links on this page. No paid placements in workflows. How IonBin makes money.