Agents
Self-Hosted Cloud Agent Team Pools: Shared Worker Capacity
A Team Pool is a named routing target that sends Cloud Agent requests to self-hosted workers your admins run. A request waits in the pool until an available worker claims it, and each session claims one worker at a time. Pools need an Enterprise plan and a service account API key. The agent loop still runs in Cursor's cloud.

On this page
- What is a team pool and when does a team need one?
- How do you start a pool worker?
- Should a pool be repo-backed or any-repo?
- How do requests reach the right pool?
- How do the team's self-hosted settings change routing?
- How does a pool scale up and down?
- How do you protect the machines a controller starts?
- What happens to a worker's workspace between follow-ups?
- What does a custom controller have to do?
- What does a pool need on the network, and what can you monitor?
- What leaves your network, and what runs on a pool worker?
What is a team pool and when does a team need one?
A pool groups Self-Hosted Machines workers under one name, so sessions can route to a specific set of machines. Teams create separate pools for different execution environments, such as one for work that needs GPUs and another for work that needs a Mac.
Pools are for Enterprise teams that want Cloud AgentsAgents that run in a Cursor-managed virtual machine, check out the repo, do the work and open a pull request, then shut down, with no load on your laptop. Press Enter for the full definition. to run inside company-managed infrastructure. Admins operate the workers, so developers don't each start one on a personal machine. Each worker opens a long-lived outbound HTTPS connection to Cursor's cloud, where inference and planning happen. The worker runs the tool calls that come back over that connection: terminal commands, file edits, browser actions and access to internal services. It needs no inbound ports, public IPs or VPN tunnels.
Cursor's docs list the needs that call for a pool.
- Centrally managed workers for a team or organization
- Service account authentication instead of individual browser logins
- Kubernetes, autoscaling, or centrally managed capacity
- Labels that route work to the right environment, team, repo, or hardware profile
- Company-owned hosts for tool execution, build outputs, worker logs, and monitoring
Cursor recommends its managed Cloud AgentsAgents that run in a Cursor-managed virtual machine, check out the repo, do the work and open a pull request, then shut down, with no load on your laptop. Press Enter for the full definition. for most teams, including teams that need private network access. Before you take on a worker fleet, its docs point you to managed environments with network controls, Tailscale or a similar client, or private connectivity. The runtime comparison sets the options side by side.
My Machines is the quicker personal setup, with each machine connected to one user's account. Pool workers belong to the organization and authenticate with a service account. Cursor supports up to 200 workers per user and 1000 per team, and asks larger company-wide deployments to contact sales.
This is covered hands-on in Agent Mode Foundations — 6 short Units, free to read.
Rather do it than read about it? Run 11 interactive Cursor walkthroughs in a simulated editor. Free, no account needed.
How do you start a pool worker?
Check four prerequisites before you start a pool worker.
- An Enterprise plan.
- Self-hosted settings from a team admin in the Cloud AgentsAgents that run in a Cursor-managed virtual machine, check out the repo, do the work and open a pull request, then shut down, with no load on your laptop. Press Enter for the full definition. dashboard. Allow Self-Hosted Machines lets users opt in, and Require Self-Hosted Machines routes every Cloud Agent run to self-hosted workers.
- A service account API key.
- A machine with the
agentCLI,gitonPATH, a workspace directory, and access to the build tools, registries, secrets and internal services your agents need.gitis optional on any-repo workers whose own scripts handle source control.
curl https://cursor.com/install -fsS | bash agent --version
Authentication is where pools differ most from My Machines. A pool worker takes a service account API key, or a session token minted from that key for a single claim. User, personal, team and organization API keys can't start pool workers. Personal and user keys belong with My Machines.
export CURSOR_API_KEY="your-service-account-api-key" cd /path/to/repo agent worker --pool my-pool --idle-release-timeout 600 start
--pool registers the worker for pool assignment. With a name after the flag, the worker joins that pool, and without one it joins default. --idle-release-timeout sets how many seconds a worker stays connected after a session ends, waiting for follow-up messages. The default is 3600. When the timeout fires, the CLI exits with code 0 so a supervisor can recycle the machine.
Should a pool be repo-backed or any-repo?
Pools come in two repo configurations, and the choice decides how a request finds a worker. A repo-backed pool is tied to one or more repositories. An any-repo pool leaves source control to you.
- Feature
- Request labels
- Repo-backed pool
repo=<owner/repo>, pluspool=<name>for a named pool- Any-repo pool
pool=<name>only, with norepo=label
- Feature
- Matching
- Repo-backed pool
- Workers serving that repository
- Any-repo pool
- The pool name alone
- Feature
- Dashboard
- Repo-backed pool
- Under the repository
- Any-repo pool
- Under Any repo
- Feature
- Source control
- Repo-backed pool
- The worker directory is a git checkout with a remote
- Any-repo pool
- Any existing directory passed to
--worker-dir; you or the agent manage cloning
| Feature | Repo-backed pool | Any-repo pool |
|---|---|---|
| Request labels | repo=<owner/repo>, plus pool=<name> for a named pool | pool=<name> only, with no repo= label |
| Matching | Workers serving that repository | The pool name alone |
| Dashboard | Under the repository | Under Any repo |
| Source control | The worker directory is a git checkout with a remote | Any existing directory passed to --worker-dir; you or the agent manage cloning |
Both kinds register with the same agent worker --pool command.
Any-repo workers clone only when you ask. --clone-git-repos checks out the claimed agent's repositories on claim. Because the flag implies --mint-github-token, clones use a short-lived GitHub token, and a team admin has to enable token minting for Team Pool workers. The flag works only on any-repo workers in a named pool other than default, and the CLI exits with an error anywhere else.
The worker reuses a clean checkout of the same repository that is already in the worker directory. When the worker can't update a checkout safely, for instance because of uncommitted changes to tracked files or a rebase in progress, it clones into a new folder instead. Clones made for a claim are deleted when the claim ends. To avoid cloning a large repository on every claim, clone it into the worker directory before you start the worker.
The choice also matters when one agent needs several repositories. A worker can serve several checkouts if you pass --worker-dir once per root, up to 20 paths, but extra roots don't add repositories to a request. To start one agent with several repositories, send them to an any-repo pool whose workers run with --clone-git-repos.
On a worker with several roots, the first root is the primary repository for assignment identity and dashboard display, so the dashboard can look as if only that repo registered. Cursor treats the verbose startup logs as the source of truth: check workspacePaths and x-repository-urls there.
--clone-git-repos, --mint-github-token and --sync-dashboard-secrets assume one worker per container or OS user. Running several credential-enabled workers under the same user is unsupported.
How do requests reach the right pool?
Cursor matches requests to workers by label. A request for a repository carries repo=<owner/repo>, and a request for a named pool also carries pool=<name>. A request to an any-repo pool without a repository has no repo label. Both labels are reserved: repo comes from the worker directory's git remote and pool from --pool, so don't set them by hand. Add your own labels to a worker with --label key=value for quick tests, or from a JSON or TOML file through --labels-file (or the CURSOR_WORKER_LABELS_FILE variable) when labels live in config.
Each surface that starts agents names a pool in its own way.
- Surface
- Dashboard
- How to target a pool
- Pick a pool in the worker selector when you start a session or edit an automation
- Surface
- Slack
- How to target a pool
- Mention
@Cursorwithself_hosted=true,sh=1orpool=<name>. Team admins set a team default with@Cursor pool set <name>, and any member sets a channel default with@Cursor pool set <name> channel
- Surface
- GitHub
- How to target a pool
- Comment
@cursoragentwithself_hosted=true,sh=1orpool=<name>on an issue, pull request or review comment
- Surface
- Linear
- How to target a pool
- Mention
@Cursorwith the same options in a comment, or use issue or project labels where the parent label ispooland the child label is the pool name
| Surface | How to target a pool |
|---|---|
| Dashboard | Pick a pool in the worker selector when you start a session or edit an automation |
| Slack | Mention @Cursor with self_hosted=true, sh=1 or pool=<name>. Team admins set a team default with @Cursor pool set <name>, and any member sets a channel default with @Cursor pool set <name> channel |
| GitHub | Comment @cursoragent with self_hosted=true, sh=1 or pool=<name> on an issue, pull request or review comment |
| Linear | Mention @Cursor with the same options in a comment, or use issue or project labels where the parent label is pool and the child label is the pool name |
In Slack, an explicit pool=, worker=, machine= or self_hosted=false overrides both default pools.
Write each option as key=value. self_hosted and its short form sh accept true, t or 1 to opt in, and false, f or 0 to opt out. Anything else, such as sh with no value, stays in your prompt as text. Slack, GitHub and Linear all ignore these options inside a code block.
How do the team's self-hosted settings change routing?
The team's self-hosted settings decide what those options can do. With Allow Self-Hosted Machines off, Slack rejects an opt-in with a reply, and Linear posts an agent activity error on the issue. That error offers two ways forward: an admin turns on self-hosted workers, or you remove the hint so the run uses Cursor's managed infrastructure. On GitHub, only repo OWNER and COLLABORATOR users can route runs to self-hosted workers, which protects public repos where outside contributors can comment. Other commenters who opt in run on managed infrastructure, or are skipped when Require Self-Hosted Machines is on.
Require Self-Hosted Machines routes the team's Cloud Agent runs to self-hosted workers. When such a run names no pool or machine and no pool worker can take it, Cursor runs it on one of your own connected My Machines workers, never on a teammate's. An agent keeps the placement it started with. Once the setting is on, Cursor refuses follow-ups to the team's agents that ran on managed infrastructure and asks you to start a new agent.
Team admins can also set a Default pool in the Self-Hosted section of the Cloud AgentsAgents that run in a Cursor-managed virtual machine, check out the repo, do the work and open a pull request, then shut down, with no load on your laptop. Press Enter for the full definition. dashboard, once Allow Self-Hosted Machines is on. It applies to self-hosted runs that name no pool or machine, whether they opted in or the Require setting sent them there. The default doesn't take every such run, because Cursor routes each self-hosted run in this order.
- 1A pool or machine named in the request with
pool=<name>,worker=ormachine=always wins. - 2The default pool, when it serves the run's repository, even if another pool serves it too.
- 3Another team pool that serves the repository, if one of its workers connected in the last 30 days.
- 4The default pool, when it's an any-repo pool. It takes runs for any other repository and runs with no repository.
- 5If nothing matches, the run routes as if no default were set.
A run the default pool takes waits a limited time for that pool's workers and fails if none connects. Unlike the Require fallback above, it never moves to your My Machines workers. Slack's team and channel default pools are separate settings, and they win for @Cursor mentions.
How does a pool scale up and down?
Pools are durable. A pool stays registered and selectable after its last worker disconnects, so you can scale to zero and bring capacity back when requests arrive. Starting a worker with a new pool name creates the pool. To register one ahead of time, call POST /v0/private-workers/pools in the Cloud AgentsAgents that run in a Cursor-managed virtual machine, check out the repo, do the work and open a pull request, then shut down, with no load on your laptop. Press Enter for the full definition. API, with repoOwner, repoName and repoUrl for a repo-backed pool. GET /v0/private-workers/pools lists pools with connected and in-use worker counts, and DELETE soft-deletes a pool without affecting machines still connected to it.
Something still has to start the workers. agent worker controller starts them through a --spawn hook, which can fork a process, start a container or create a Kubernetes Pod. The controller has a default claim mode and a warm mode.
- Mode
- Claim-then-spawn (default)
- What the controller does
- Lists pending requests, watches the pending-requests stream, claims each request and runs
--spawnonce per claim - Constraints
- Works with
--session-tokenand--identity-audience
- Mode
- Warm pool (
--warm-idle <count>) - What the controller does
- Keeps
countidle workers connected in each--poolby pre-spawning unclaimed workers, and never calls claim - Constraints
- Requires
--pooland can't be combined with--all-pools. Run one warm controller per pool, because concurrent controllers can transiently over-spawn
| Mode | What the controller does | Constraints |
|---|---|---|
| Claim-then-spawn (default) | Lists pending requests, watches the pending-requests stream, claims each request and runs --spawn once per claim | Works with --session-token and --identity-audience |
Warm pool (--warm-idle <count>) | Keeps count idle workers connected in each --pool by pre-spawning unclaimed workers, and never calls claim | Requires --pool and can't be combined with --all-pools. Run one warm controller per pool, because concurrent controllers can transiently over-spawn |
The controller hands the hook environment variables, including the pool name and a worker id. The hook should start a worker with that id.
#!/usr/bin/env bash set -euo pipefail agent worker --pool "$CURSOR_POOL" --worker-id "$CURSOR_AGENT_WORKER_ID" start
On Kubernetes, start from the anysphere/k8s-workers Helm sample. It runs the controller with --spawn in your cluster and creates one worker Pod per claimed request, or keeps warm idle Pods with --warm-idle. It needs no CRD. The older Cursor Kubernetes operator and its WorkerDeployment chart are deprecated: clusters that already run the operator keep working, but new deployments should use the template. Any VM, container or bare-metal machine that can install the CLI and reach Cursor over outbound HTTPS can also run a pool worker under systemd, Docker or your own process manager.
How do you protect the machines a controller starts?
Two controller flags protect the machines the spawn hook starts, and both work only in claim mode. --session-token keeps the service account API key off those machines. --identity-audience lets the hook confirm who a run is for before it creates anything.
By default, every machine the hook starts holds the API key. With --session-token, the controller asks each claim for a session token and hands the hook that token instead, so the key stays on the controller. A session token serves one claim. It stops working when the claim is released, or when the key that minted it is deleted or expires, and its 7-day expiry is a backstop. Warm workers start before any claim exists, so a --warm-idle controller still hands the hook the API key.
With --identity-audience, the controller sends an audience and a fresh nonce with every claim. The hook receives a signed token that names the agent and its owner. The flag needs agent CLI 2026.10.14-941492e or later.
What happens to a worker's workspace between follow-ups?
Unless the pool uses hibernation, the workspace doesn't carry over to a follow-up that arrives after the machine is released. That follow-up goes back to the pool and lands on a fresh machine, which may spend its first minutes rebuilding the workspace the agent already had. Keeping every machine online while its agent sits idle avoids the rebuild, but it gets expensive.
Hibernation brings the original machine back instead. First give the pool a reconnect window: workerReadyTimeoutSeconds, set on the pool through POST /v0/private-workers/pools, controls how long Cursor waits for a claimed machine to reconnect. Its default of 0 means follow-ups reacquire a worker immediately. Then shorten --idle-release-timeout, and snapshot and stop the machine when the worker exits or the agent reports IDLE.
When a follow-up arrives, your controller sees a claimed_offline entry in the queue. Restore the snapshot and start a worker with the same CURSOR_AGENT_WORKER_ID before the window lapses. If the snapshot is gone, release the claim, and the request returns to the queue.
What does a custom controller have to do?
A custom controller does three things on the Cloud AgentsAgents that run in a Cursor-managed virtual machine, check out the repo, do the work and open a pull request, then shut down, with no load on your laptop. Press Enter for the full definition. API: it watches the request queue, claims a request, and starts a worker for it. Build one when the built-in controller doesn't fit, for example when you need your own scheduling, quotas or machine placement. Treat the list endpoint as the source of truth and the event stream as hints, because event delivery is best-effort and each new list corrects any drift.
Stream cursors expire five minutes after the list that issued them, and a stale one returns 410 Gone. List again every five minutes, with some jitter, instead of waiting for the error.
If a controller claims a request but can't start the worker, it should call the fail endpoint with a plain-text message of 500 characters or fewer. Otherwise the agent waits for a worker that never connects until the wait times out.
What does a pool need on the network, and what can you monitor?
A pool worker needs outbound HTTPS to a short list of hosts, and nothing inbound. api2.cursor.sh and api2direct.cursor.sh carry the agent session, and downloads.cursor.com serves CLI updates and the first-time Cursor Computer Use install on macOS. Artifacts upload to agent-stores.s3.us-east-1.amazonaws.com, and to cloud-agent-artifacts.s3.us-east-1.amazonaws.com when the agent's store isn't available. Workers started with --connect-workspace also download the live workspace server from cursor.blob.core.windows.net, and if that host is blocked, the live workspace can't start. Behind a proxy, set HTTPS_PROXY or https_proxy in the worker environment.
- If you block...
api2.cursor.shorapi2direct.cursor.sh- Effect
- The worker can't start or continue an agent session
- If you block...
downloads.cursor.com- Effect
- CLI updates and the first-time Computer Use install on macOS fail; a worker with both installed keeps running
- If you block...
agent-stores.s3.us-east-1.amazonaws.comandcloud-agent-artifacts.s3.us-east-1.amazonaws.com- Effect
- Artifact uploads fail, so PR embeds, dashboard previews and notification attachments that depend on them are missing; the session and other tool calls keep working
- If you block...
- A host a specific tool or integration needs
- Effect
- Only that tool or integration fails; the agent continues
| If you block... | Effect |
|---|---|
api2.cursor.sh or api2direct.cursor.sh | The worker can't start or continue an agent session |
downloads.cursor.com | CLI updates and the first-time Computer Use install on macOS fail; a worker with both installed keeps running |
agent-stores.s3.us-east-1.amazonaws.com and cloud-agent-artifacts.s3.us-east-1.amazonaws.com | Artifact uploads fail, so PR embeds, dashboard previews and notification attachments that depend on them are missing; the session and other tool calls keep working |
| A host a specific tool or integration needs | Only that tool or integration fails; the agent continues |
A wildcard rule such as *.s3.us-east-1.amazonaws.com covers both artifact hosts, but it also opens every other bucket in the region. Cursor's docs prefer an exact-host rule wherever the firewall supports one. To turn artifact uploads off, block both hosts, because blocking only the fallback host doesn't stop uploads.
To monitor a worker, start it with --management-addr, for example :8080, and it serves /healthz, /readyz and /metrics. Two gauges show its state: cursor_self_hosted_worker_connected reads 1 while the outbound connection is active, and cursor_self_hosted_worker_session_active reads 1 while a session runs on that worker. For connection trouble, watch the counters cursor_self_hosted_worker_connect_retry_total and cursor_self_hosted_worker_session_ends_total. The second one carries a reason label.
What leaves your network, and what runs on a pool worker?
The Team Pools page names two things that leave your network: file chunks the model reads during inference, and artifacts (screenshots, videos and log references) uploaded to Cursor-managed storage. Repos, build caches and secrets stay on your machines. Cursor's Self-Hosted Machines overview gives a longer list of what a worker sends during a run, and the Self-Hosted Machines article covers it.
Privacy ModeCursor's setting that guarantees code data is not used for training by Cursor or its model providers, and that an admin can enforce org-wide; data-retention terms are a separate, contractual layer. Press Enter for the full definition. settings apply to pool workers: with Privacy Mode on, none of your code is used for training. Each agent session gets its own dedicated worker, and sessions are not shared across workers. Team admins see all connected workers. Team members see only the workers assigned to them.
MCPModel Context Protocol. A standard that lets an AI agent pull in context from outside the repo, like Jira tickets or internal docs. Press Enter for the full definition. servers route by transport. A command (stdio) server starts on the worker, so it can reach private networks, internal APIs and services behind your firewall. Cursor's backend handles HTTP and SSE servers, including OAuth and session caching. If an MCP server needs private-network endpoints, configure it as stdio.
Hooks run on pool workers too. Workers load .cursor/hooks.json from the workspace they serve, and on Enterprise they also run team and enterprise-managed hooks from the dashboard. Only command-based hooks run, and IDE-only hooks such as the Tab hooks and workspaceOpen don't. sessionStart and sessionEnd fire when a session claims the worker and when that claim is released, and Cursor-managed Cloud AgentsAgents that run in a Cursor-managed virtual machine, check out the repo, do the work and open a pull request, then shut down, with no load on your laptop. Press Enter for the full definition. skip them. To add one command for either event without editing the hooks file, start a pool worker with --on-session-start or --on-session-end.
Frequently asked questions
Can multiple agents use one pool worker?
No. A pool worker serves one agent at a time, and each agent session gets its own dedicated worker. When requests wait for capacity, add workers or scale the pool.
Which API keys can start a pool worker?
Only a service account API key, or a session token minted from that key for a single claim. User, personal, team and organization API keys can't start pool workers. Personal and user keys start My Machines workers instead.
Do I need Kubernetes to run a Team Pool?
No. The anysphere/k8s-workers template is one option. Any VM, container or bare-metal machine that can install the Cursor CLI and reach Cursor over outbound HTTPS can run a pool worker under systemd, Docker or your own process manager.
What happens to a follow-up after its pool machine is released?
Without hibernation, the follow-up goes back to the pool and lands on a fresh machine, which may spend its first minutes rebuilding the workspace. With hibernation, your controller restores a snapshot of the original machine and starts a worker with the same worker id, so the agent resumes with its workspace intact.
Sources & last verified
- Cursor Docs: Self-Hosted Team Pools
- Cursor Docs: Self-Hosted Machines
- Cursor Docs: My Machines
- Cursor Docs: Choose where Cloud Agents run
- Cursor Docs: Service accounts
- Cursor Docs: Cloud Agents API endpoints
Cursor ships frequently. Facts verified against primary sources on October 28, 2026.