API keys for Cursor Cloud Agents, without long-lived keys on the machine
Cursor Cloud Agents, formerly called background agents, work on isolated machines in the cloud. To run and test your code they need the same API keys a developer has. This page explains how their environment gets secrets, and how Shipkey keeps the real keys off the machine.
How the Cursor Cloud Agents environment works
Cloud agents run on isolated Ubuntu machines. You configure the environment so that the agent has the repositories, tools, dependencies, secrets and network access a developer would have: with an agent-led setup, a saved snapshot, or a Dockerfile referenced from .cursor/environment.json.
What it gives you for secrets
Secrets are managed in the Secrets tab of the Cloud Agents dashboard, and are exposed to the cloud agent as environment variables. A secret can be scoped to one environment. That gives the agent what it needs, and it also means a long-lived key sits in the environment of a process that reads untrusted input.
From the product's documentation, as read in December 2026: cursor.com/docs: cloud environment setup
Where Shipkey fits
- Store a grant in place of the provider keys. The agent's token lasts hours, only works for the providers you allow, and can be revoked.
- You approve each environment with a passkey and see what it will get before you say yes.
- The real keys stay in your gateway, a Cloudflare Worker in your own account.
- The same gateway serves Claude Code, Codex and Gemini CLI.
Set it up for Cursor Cloud Agents
1.Deploy the Shipkey issuer and gateway, two Cloudflare Workers, in your own account, and register your passkey as the approver. Self-hosting guide
2.Add the Shipkey plugin to the agent and tell it your issuer's address.
3.Make sure the environment's network access lets the agent reach your issuer's and gateway's domains.
4.Approve the environment with your passkey when the agent shows the check code. From then on its commands go through your gateway.