Keep keys out of Codex, Copilot, Gemini, Windsurf and Cursor
Every AI coding tool has the same problem: to use an API or a server it needs a secret, and the easy place to put one is a .env file or a config file the tool can read. LLLanyard keeps the secrets in your keychain and tells each tool to run commands through lllanyard exec and lllanyard ssh, so it uses a key without ever holding it.
Connect a tool
lllanyard setup codex # OpenAI Codex (CLI and IDE extension) lllanyard setup copilot # GitHub Copilot CLI lllanyard setup copilot --project . # VS Code Copilot Chat, for this folder lllanyard setup gemini # Gemini CLI lllanyard setup windsurf # Windsurf lllanyard setup cursor # Cursor lllanyard setup agent # anything else
Each command does two things. It adds a short section to the tool's own instructions file, telling it to run scripts with lllanyard exec, to use lllanyard ssh for servers, and never to look for keys in .env files. And it adds LLLanyard's MCP server to the tool's settings. Your other settings are kept, the old file is saved as <file>.lllanyard-backup, and --remove undoes it. Run lllanyard setup with no arguments to see what's connected.
Where it goes
| Tool | Instructions | MCP server |
|---|---|---|
| OpenAI Codex | ~/.codex/AGENTS.md | ~/.codex/config.toml |
| GitHub Copilot CLI | ~/.copilot/copilot-instructions.md | ~/.copilot/mcp-config.json |
| VS Code Copilot Chat | .github/copilot-instructions.md | .vscode/mcp.json |
| Gemini CLI | ~/.gemini/GEMINI.md | ~/.gemini/settings.json |
| Windsurf | ~/.codeium/windsurf/memories/global_rules.md | ~/.codeium/windsurf/mcp_config.json |
| Cursor | Its settings (Rules): run setup agent and paste the section | ~/.cursor/mcp.json |
The project files for VS Code name lllanyard rather than paths on your computer, so they're safe to commit. Each person on the team still needs LLLanyard and their own keys.
A tool that isn't listed
Any agent that can run shell commands can use lllanyard exec and lllanyard ssh; it only needs to be told to. lllanyard setup agent adds the instructions to AGENTS.md, which many tools read, and prints the MCP settings to paste into one that supports MCP:
{ "mcpServers": { "lllanyard": { "command": "lllanyard", "args": ["mcp", "--run"] } } }
What this does and doesn't do
- The instructions are a request. The protection is that a command run through LLLanyard never shows the key to the tool. A tool that ignores the instructions can still read keys that are sitting in files, so move those into the keychain with
lllanyard scan --import --apply, and runlllanyard auditto see what's left. - The ChatGPT website and apps can only use MCP servers hosted on the internet, so they can't use one that runs on your computer. OpenAI Codex runs on your computer and is supported.
- Copilot's coding agent runs on GitHub's servers and can't reach your keychain. Use Copilot in VS Code or Copilot CLI.
Try it: LLLanyard is free for up to 10 keys.
npm install -g @lllanyard/cli lllanyard doctor
More guides
- Keep API keys out of Claude Code
- .env files and AI coding agents
- Keep MCP server secrets out of config files
- Connect your own devices with LLLanyard Pro
- Share LLLanyard across your devices or with your team
- Run scripts with API keys from Claude Desktop
- Let AI agents use SSH without seeing your keys
- Stop AI agents reading .env files and SSH keys