Secret Brokers for Agent-Run Cloud Workspaces and Builds
The short answer
Use the broker built into the cloud agent you already run, and add a vendor-neutral proxy only for what it cannot cover. As of November 17, 2026, the agent-run cloud workspaces differ sharply in where a secret lives once a session starts:
| Platform | Broker mechanism | Does the key enter the workspace? | Build-only secrets | Short-lived identity |
|---|---|---|---|---|
| Claude Code cloud sessions | Network secrets: Anthropic’s agent proxy adds the key to requests for listed hosts | No — added after the request leaves the VM | Setup script runs with environment variables | GitHub via server-side GitHub proxy |
| Cursor Cloud Agents | Runtime secrets redacted from tool results, transcript and commits | Yes, as environment variables (visible in the terminal) | Build secrets for the Docker build only | OIDC tokens for AWS, GCP, Azure, Vault |
| OpenAI Codex cloud | Secrets decrypted only for setup scripts | Removed before the agent phase | Yes — that is the only use | — |
| GitHub Copilot cloud agent | Agents secrets and variables, org or repo level | Yes, as environment variables; COPILOT_MCP_ secrets go only to MCP servers | Via copilot-setup-steps.yml (Actions runs) | GitHub Actions OIDC on Actions runners |
| Infisical Agent Vault | HTTP credential proxy attaches the real credential | No — the agent holds placeholders | n/a | Time-bound agent sessions |
This page is the cloud-workspace spoke of our best secrets managers for AI agents hub.
Claude Code: network secrets keep the key outside the VM
Claude Code cloud environments have three places to put configuration. Environment variables are readable by every command Claude runs. A setup script runs before Claude starts. Network secrets are the broker: you store an API key on the environment, list the hosts it is for (a leading *. matches subdomains) and the header that carries it, and Anthropic’s agent proxy adds the key to matching requests after each request leaves the session’s VM. Claude can call the API; it cannot print the key. GitHub works the same way: in Anthropic-hosted environments the GitHub credentials stay on Anthropic’s servers and a GitHub proxy attaches them.
Limits: network secrets are on Pro, Max, Ultra, Team and Enterprise plans; they are not available in self-hosted environments, cannot be saved if your organization uses customer-managed encryption keys, and the target API must accept connections from the internet because requests leave from Anthropic’s network.
Cursor: three secret types plus OIDC
Cursor Cloud Agents let you pick the exposure per secret. Environment Variable secrets are visible to the agent — Cursor recommends them for flags and public URLs. Runtime Secrets are loaded as environment variables but redacted to [REDACTED] in tool results, the chat transcript, commits and commit messages; anyone using the agent’s terminal can still read them. Build Secrets exist only during the Docker build through a secret mount. For cloud roles, Cursor recommends OIDC identity tokens: the agent mints a Cursor-signed JWT from a local socket and presents it to AWS, GCP, Azure or Vault, so no long-lived key exists at all. Cloud agents have internet access by default; restrict egress per team or environment.
Codex: secrets for setup, none for the agent
Codex cloud environments encrypt secrets and decrypt them only for the task, and only setup scripts can read them — they are removed before the agent phase starts. Agent internet access is off by default and all traffic passes an HTTP/HTTPS proxy. This is the safest default for builds (private registries, package mirrors) and the least useful for agents that must call authenticated APIs while they work. For that, route calls through a broker such as Agent Vault.
GitHub Copilot: Agents secrets and MCP-only secrets
Copilot cloud agent has its own Agents secrets and variables at organization and repository level, separate from Actions, Codespaces and Dependabot. They are exposed as environment variables, except those prefixed COPILOT_MCP_, which only MCP servers receive — the cleanest way to give a tool a key without giving it to the model. In a cloud sandbox only secrets are available, not variables; setup steps in copilot-setup-steps.yml apply only to sessions on GitHub Actions.
Infisical Agent Vault: the vendor-neutral broker
When agents run on your own runners, in several products or against private APIs, put a proxy in front of them. Infisical Agent Vault sets the agent’s HTTPS_PROXY, swaps placeholder values for the real credential on outbound requests, filters which agents reach which services and endpoints, and logs every authenticated request. A vault can run in strict deny mode, rejecting any host you have not configured with a 403. Pricing on Infisical’s page, read November 17, 2026: the first 5,000 brokered requests a month are free, then $1 per 10,000; the core is MIT and self-hostable. Kong’s Token Vault, generally available since November 4, 2026 inside Kong Identity, is the gateway-based alternative for enterprises already routing agent traffic through Kong.
How to choose
- Claude Code in the cloud, calling a few SaaS APIs: network secrets. Nothing else to run.
- Cursor with AWS or GCP: OIDC tokens for cloud roles, runtime secrets for the rest, build secrets for registries.
- Codex: keep registry credentials as setup secrets; broker any runtime API call through a proxy.
- Copilot with MCP tools:
COPILOT_MCP_secrets so the key reaches the tool, not the model. - Mixed fleet or self-hosted runners: Infisical Agent Vault in strict deny mode, backed by your existing vault.
Pair any of them with deny-by-default egress: see egress control strategies for AI agents and the runtime credential brokers comparison.
Last verified: November 17, 2026.