Learning resourcesReviewed · Anysphere

Cursor Agent SDK deployment guide

This guide helps developers deploy Cursor Agent SDK agents, but managed hosting stores their repository and agent data even with Privacy Mode. It covers deployment from Git, self-hosting, secrets, network access and persistent state.

Researched 13 Nov 2026

In short.

This deployment guide is for developers operating Cursor Agent SDK agents, but managed hosting stores repository and agent data even with Privacy Mode. It explains deployment from pushed Git references, stable service URLs, secrets, outbound network permissions, session inspection and state persistence. Self-hosting requires Node 22.13 or newer and responsibility for authentication, TLS, backups and scheduling. Pricing, SDK release compatibility and operational performance are not established by the page.

Researched and written by an AI model and checked by a second AI model. How it works

Coverage is the complete captured documentation page at [https://cursor.com/docs/agent-sdk/deployment.md], including its privacy restrictions, network-policy rules, credential precautions and self-hosting requirements. Linked peer-agent, connection, channel, webhook, dashboard and sitemap pages are outside scope and were not assessed. The page supplies no licence notice, pricing schedule or release-specific compatibility evidence. All commands and operational claims remain untested.

The overview

identity

Deploy an Agent SDK project is a Cursor documentation page at [https://cursor.com/docs/agent-sdk/deployment.md]. It teaches two deployment paths: a service on Cursor-managed hosting and a self-hosted server for developers who need their own network or process controls.

The resource is an operational guide for an existing Agent SDK project. It does not provide a complete agent implementation or a downloadable deployment package.

assessment

The guide is useful once a developer has an agent project ready to deploy. Its strongest details concern practical failure conditions: uncommitted changes do not ship, team policy can reject required network hosts, hosted secrets arrive after modules load, and ordinary disk writes can disappear.

It provides enough detail to plan deployment and inspection, but does not cover installation or billing, and leaves several referenced interfaces (peer agents, connections, route responses, webhooks) to linked pages. Successful deployment, reliability, performance and security enforcement have not been independently verified.

users

The main audience is developers moving an Agent SDK project into a running service. The examples assume familiarity with Git, shell commands, environment variables and HTTP; the configuration example uses TypeScript.

Team administrators may need to resolve enforced privacy settings or outbound network restrictions. Self-hosting also requires someone able to operate authentication, persistent storage, backups and scheduling. Beginners can follow the deployment sequence, but this page alone does not explain how to build their first agent.

capabilities

The managed path builds a pushed Git reference, starts the agent and returns a service URL. Developers can specify the repository, reference, project path and deployment slug, then manage the service through the Deployed Agents dashboard.

The page also describes connecting deployed peers, declaring outbound hosts and secret names, submitting work through sessions or custom routes, inspecting events and logs, rotating alias tokens, and checking rollouts. Self-hosting can serve every agent under a directory from one process.

Using it

requirements

Managed deployment requires a committed and pushed Git reference, CLI login and project validation. The page uses the agent-sdk command and imports defineAgent from @grok/agent-sdk in its TypeScript example, but supplies no installation command or SDK version. The @grok scope does not match the Cursor product name, and the page does not confirm the correct package name or identify its publisher. Check Cursor's own installation documentation for the correct package name before installing anything.

The setting named Privacy Mode permits managed hosting while retaining deployment-data storage and applying the usual Privacy Mode handling to model requests. Privacy Mode (Legacy) blocks deployment, hosted sessions and eval runs. Team policy must also permit the required outbound hosts.

Self-hosting requires Node 22.13 or newer; the page explicitly excludes Bun. Its server example supplies CURSOR_API_KEY, a bearer token and a persistent state directory.

mechanism

Managed deployment builds the pushed reference rather than the working directory. Redeploying the same slug updates that deployment. Custom routes use a stable alias URL authenticated by X-Agent-Alias-Token; the first deployment prints that token once, and deployment rotate-token replaces it.

Outbound access depends on the agent's hosting.egressDomains and team policy. Even a team setting that allows all network access leaves the agent restricted to its declared list. Team lists cannot remove the platform base, which includes Cursor's API and the npm registry. The effective allowed hosts appear under egress.effective in agent-sdk deploy --json.

Hosts must be lowercase names without schemes or paths; ports are allowed only for raw TCP. A team wildcard includes its apex domain, while an agent wildcard excludes it. A raw TCP host needs a team CIDR:port entry that covers every public IPv4 address it resolves to. The page specifically requires coverage for ports 5432 and 6432 for PlanetScale Postgres hosts under restricted egress.

setup

For managed hosting, commit and push the intended reference, then run agent-sdk login, agent-sdk validate and agent-sdk deploy in the project. Deployment waits for the agent to run and prints its URL. The --repo, --ref, --path and --slug options select a different source or deployment identity.

Declare outbound hosts and secret names in hosting configuration. agent-sdk info --dir . includes declarations contributed by mounted extensions. After deployment, agent-sdk secret set weather-agent WEATHER_API_KEY accepts the value through a hidden prompt; the next task uses it without redeployment. Commit names only, avoid CURSOR_ names, and do not pass NAME=VALUE.

Read hosted secrets inside the handler, tool or callback that needs them because they arrive after module loading. MCP credentials use a ${NAME} template. SCM channels use named-secret references; validation rejects literal credentials or getters, and Cursor hosting rejects badly signed deliveries before they reach the agent.

example

The page illustrates submitting a forecast request with agent-sdk session create --slug weather-agent --message "Forecast for Paris" --wait. It then shows inspecting the resulting session with session get, requesting the events view, and reading production logs. These commands assume an existing agent capable of handling the request; the page does not implement a weather tool.

A separate example posts a ticket to /v1/channels/tickets/ticket on the stable alias URL using the alias token header. Checking session list confirms whether work started. The custom route's implementation and response contract are not explained on this page.

Assessment & evidence

limitations

Sessions, ctx.host.kv and ctx.host.files are documented to survive restarts and redeployments. Other files written to disk can disappear. Each redeployment replaces watched repositories, so every --cursor-events-repo value must be supplied again or watching falls back to the GitHub source repository.

A running deployment retains the egress policy from its last successful deployment. Without --wait, session creation returns before the session exists and supplies no sessionId yet. A long turn can remain running without logs for several minutes; increasing event counts indicate continuing work.

The first deployment exposes the alias token only once, and deployment --json output can include access headers. A publicEndpoint is intended only for a webhook provider that cannot send the token and whose signature the channel verifies. Detailed webhook and response behavior is delegated to linked pages.

reasoning

Based on the documented responsibilities, managed hosting is a practical fit when repository storage is acceptable, the privacy setting permits deployment, and required external services fit team egress policy. Its deployment, secrets and inspection commands address common service-operation needs.

Self-hosting fits a need for custom network or process controls when an operator can provide secure access and persistent storage. These suitability judgments are inferences from the page's requirements; there is no measured comparison of reliability, speed or cost.

alternatives

The page's explicit alternatives are Cursor-managed hosting and self-hosting the same Agent SDK project. Managed hosting supplies the deployment service and hosted interfaces. Self-hosting places server access, state storage and scheduling under the operator's control.

The page does not compare other agent SDKs, hosting vendors or deployment platforms. Their compatibility, features and costs cannot be assessed from this evidence.

evidence

The evidence consists of the complete documentation page at [https://cursor.com/docs/agent-sdk/deployment.md]. It includes deployment commands, privacy and egress tables, secret-handling guidance, session examples, state guarantees and self-hosting precautions.

These are documented behaviors rather than observed results. No commands, deployments, code examples or requests were executed. Deployment success, end-to-end behavior, security enforcement and performance remain unverified.

Access & freshness

costs

The page gives no hosting prices, model usage rates, included allowances, storage charges or paid-plan requirements. The cost of either deployment path is unknown.

Self-hosting requires an operated server and backed-up persistent storage, but the page provides no amounts or total-cost comparison. It does not establish that managed hosting or model requests are free.

rights

The page does not state the licence or contractual terms governing the SDK, reuse of its code examples or redistribution of the documentation. Those permissions are unknown from this evidence.

Managed hosting explicitly stores repository and agent data, including when Privacy Mode is enabled. The page does not establish retention periods, deletion procedures, data ownership terms or contractual confidentiality obligations.

freshness

The page was captured on 13 November 2026 at 16:49:43.109 UTC. Its text provides no publication date, last-updated date or SDK/CLI release number.

Node 22.13 or newer is the stated self-hosting requirement. Compatibility with a particular installed SDK release and changes after capture are unknown.

actions

For managed hosting, confirm that repository storage and the privacy setting are acceptable, identify required hosts and secrets, and resolve team-policy restrictions. Push the intended reference, validate, deploy, set secret values through hidden prompts, and submit a session with --wait. Inspect events and logs, check the rollout, and verify required state and repository watches after redeployment.

For self-hosting, use the required Node runtime, keep state on a backed-up persistent volume outside the repository, and place TLS or an authenticating proxy in front of the server. Keep bearer authentication unless the proxy authenticates every caller, and enable schedules in only one process per project. A container binding to 0.0.0.0 needs an authenticating network boundary.

Obtain current pricing, applicable usage terms and instructions matching the installed SDK release before committing to ongoing operation.

Evidence for this report

selected-page.txtselected · checked 2026-11-13