Guide
Cursor SDK Agents Guide
The Cursor SDK lets you build your own agent apps in TypeScript or Python, running locally or in the cloud. Its June 2026 update added custom tools, local auto-review, JSONL and custom stores, nested subagents and request IDs, plus reliability fixes for local and cloud agent apps.

On this page
- What changed in the June 2026 SDK update?
- How should a team build an SDK agent?
- What should a team watch out for?
- Who can use the SDK, and how far does it reach?
- Should I use the Python SDK or the TypeScript SDK?
- Which API key should an SDK agent carry?
- Does the local runtime keep code away from hosted models?
- Which SDK version do I need to pin?
- When is the SDK the wrong choice?
What changed in the June 2026 SDK update?
Most of the update controls what an SDK agent can reach and how you inspect a run afterwards: custom tools, auto-review, durable stores and request IDs. The table gives the option and API names for each.
- Release fact
- Custom tools
- What to know
local.customToolsexposes your functions through the built-incustom-user-toolsMCPModel 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. server.
- Release fact
- Auto-review
- What to know
local.autoReviewsends local tool calls through a classifier instead of bypassing review.
- Release fact
- Stores
- What to know
- SQLite, JSONL or a custom
LocalAgentStorecan hold durable agent state.
- Release fact
- Nested subagents
- What to know
- Subagents can see custom tools, and subagents can nest for delegated work.
- Release fact
- Request IDs
- What to know
- Run metadata can carry request IDs for support and debugging, and the update also fixed reliability issues for local and cloud agent apps.
| Release fact | What to know |
|---|---|
| Custom tools | local.customTools exposes your functions through the built-in custom-user-tools 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. server. |
| Auto-review | local.autoReview sends local tool calls through a classifier instead of bypassing review. |
| Stores | SQLite, JSONL or a custom LocalAgentStore can hold durable agent state. |
| Nested subagents | Subagents can see custom tools, and subagents can nest for delegated work. |
| Request IDs | Run metadata can carry request IDs for support and debugging, and the update also fixed reliability issues for local and cloud agent apps. |
As of October 28, 2026, unless a row gives a later date. The sources are listed at the end of this page.
This exact topic is a hands-on Lesson: SDK quickstart in typescript and python — about 7 minutes, free to read.
Rather do it than read about it? Run 11 interactive Cursor walkthroughs in a simulated editor. Free, no account needed.
How should a team build an SDK agent?
Cursor's release notes and announcements say what changed. They don't say how a team should act on it. The steps below are our suggested order, and the next section lists what to watch out for along the way.
- 1Define one SDK agent job with explicit input, output and owner.
- 2Expose only the product functions the job needs as custom tools.
- 3Choose SQLite, JSONL or a custom store based on your audit and retention needs.
- 4Use auto-review and request IDs so headless runs stay inspectable.
What should a team watch out for?
Each item below is either a fact about the release, such as its beta status or plan access, or our advice for using it safely. Plan around each one, and recheck the facts when Cursor ships an update.
- Validate custom-tool inputs as if the model were an untrusted caller, because the model decides what arguments each tool receives.
- Don't store secrets or full transcripts when a summary is enough.
- Use auto-review as a gate, not as proof that a human review is unnecessary.
Who can use the SDK, and how far does it reach?
You don't need an enterprise license to use the Agent SDKA programmatic interface for running Cursor agents from your own scripts, services or CI, locally or in the cloud. Press Enter for the full definition., and generally not even a seat. Anyone, personal or enterprise, can generate a Cursor API key, and that key is what you embed to run an SDK agent.
For enterprise teams it depends on the contract, but usage generally draws from the team's pooled usage. Confirm the details with your account manager.
Agents that don't write code
The SDK is an agent you program, so it can run jobs that never touch code, in finance, legal, support, design or security. One example is a security-questionnaire app. You upload the questionnaire, and it starts a cloud agent that does a first pass using the company's security docs, privacy policies and trust-center content.
Chaining agents and custom UIs
A prototype software factory from Cursor's field-engineering sessions. It chains specialized agents into an assembly line: plan, then design, then build, then review, with clean handoffs between stages.
Embed the SDK under your own interface. One example is a Kanban board that shows the status of many cloud agents, with custom dashboards, reports and alerting on top.
Should I use the Python SDK or the TypeScript SDK?
Use the language of the system that calls the agent. Cursor documents Python and TypeScript SDKs against the same agent runtime, so the bigger decision is where the runtime goes: local files, Cursor-hosted cloud or a self-hosted cloud pool.
- SDK/runtime choice
- Python SDK
- Use it when
- A data, infra or internal-tools service already runs in Python and wants sync, async or streamed agent calls.
- SDK/runtime choice
- TypeScript SDK
- Use it when
- A Node app, CI bot, dashboard or product workflow needs to call Cursor's agent from TypeScript.
- SDK/runtime choice
- Local runtime
- Use it when
- The caller has a working tree on disk, and the job is a dev script or CI check.
- SDK/runtime choice
- Cursor-hosted cloud
- Use it when
- The caller shouldn't keep the repo locally, many agents need to run in parallel, or the run must survive a disconnect.
- SDK/runtime choice
- Self-hosted cloud
- Use it when
- You need the same cloud-agent shape, but code, secrets or build artifacts must stay in your environment.
| SDK/runtime choice | Use it when |
|---|---|
| Python SDK | A data, infra or internal-tools service already runs in Python and wants sync, async or streamed agent calls. |
| TypeScript SDK | A Node app, CI bot, dashboard or product workflow needs to call Cursor's agent from TypeScript. |
| Local runtime | The caller has a working tree on disk, and the job is a dev script or CI check. |
| Cursor-hosted cloud | The caller shouldn't keep the repo locally, many agents need to run in parallel, or the run must survive a disconnect. |
| Self-hosted cloud | You need the same cloud-agent shape, but code, secrets or build artifacts must stay in your environment. |
Pick the SDK by the caller's language, and the runtime by where code and artifacts are allowed to live.
Which API key should an SDK agent carry?
Decide before you write the agent, because the key decides whose budget each run spends. User API keys and service-account keys both work for local and cloud runs. A user key bills to that person's plan. A service-account key, created in team settings on the Enterprise plan, bills to the team that owns it. Team Admin API keys are not supported yet.
So treat the key as a budget decision. Reuse whichever key was nearest, and a nightly job can spend one engineer's allowance for a month. Nobody notices until that engineer runs out in the middle of an afternoon.
SDK spend shows up under the SDK tag in the team usage dashboard. It follows the same pricing, request pools and 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. rules as a run started from the editor, so a script that iterates over a hundred files competes with your developers for the same pool. Set the spend limit before that script runs. Neither key needs a new seat: a user key runs on its owner's plan, and a service account doesn't consume a seat license. So nobody has to ask for a license before a script starts spending.
Does the local runtime keep code away from hosted models?
No. In Cursor's SDK docs, local describes where the agent loop and filesystem access run, not where the model runs. All inference goes through Cursor's hosted models in both local and cloud modes. The docs give the point its own heading: "Local means local agent loop, not local model."
This matters most to the people least likely to read the SDK docs. If a security reviewer has written down that no code leaves your infrastructure for inference, the local runtime does not meet that rule. Picking local because the name sounded right is a mistake that tends to surface late in a review instead of early in the design.
The self-hosted cloud option decides where code, secrets and build artifacts live. Inference still calls out to external model providers there, just as the desktop app calls a provider API. So a private worker gives you a guarantee about storage and adds nothing about inference.
The runtime choice gets easier once you stop treating it as a privacy control. Local suits a caller that already has the working tree. Pick cloud when the caller shouldn't keep the repo, or when runs must survive a disconnect. The SDK reference covers the rest of the mechanics.
Which SDK version do I need to pin?
Pin the version that shipped the capability you rely on.
Start with the package names. The npm package is @cursor/sdk, with the leading @, and it requires Node.js 22.13 or later. The bare cursor/sdk does not exist. The Python package on PyPI needs Python 3.10 or later.
Per-run token counts are the clearest case. They have existed since 1.0.22 in TypeScript and 1.0.23 in Python, so any cost-attribution script you write has that as its floor. Bun support arrived in stages too: a clean import in 1.0.20, running agents in 1.0.21, and no stalled streams in 1.0.23.
Since 1.0.24, the npm and PyPI packages ship from the same release and share a version number, so Python no longer trails TypeScript. Check the registry for the current version instead of copying one from a docs page. Then pin it exactly, because a note that Bun works doesn't tell you which release made it work.
When is the SDK the wrong choice?
When a schedule or an event that Cursor already triggers on can start the job. An automation then covers it with no code for you to own. Automation triggers include cron, a GitHub event, a Slack message, a Linear issue, a PagerDuty incident and a webhook carrying any payload you like. The webhook trigger alone covers many jobs that would otherwise need an SDK script.
The SDK earns its place when the caller is your own software. You want a run's events inside your own interface, its state in your own store, or an agent that something in your product starts. That is where we draw the line, and the line moves as Cursor adds triggers.
Frequently asked questions
Who is this guide for?
AI engineers and platform teams who build internal tools, CI agents or product workflows on the Cursor SDK.
What should I do next?
Check the release facts above against the Cursor sources at the end of this page, then work through the steps in order.
Do I need a Cursor seat to use the Agent SDK?
Generally no. Anyone can generate a Cursor API key without an enterprise license or even a seat. On enterprise contracts, SDK usage typically draws from the team's pooled usage, but it depends on the contract, so confirm with your account manager.
Does the SDK's local runtime keep code away from hosted models?
No. Local describes where the agent loop and filesystem access run, not where the model runs. In both local and cloud modes, inference goes through Cursor's hosted models, so the local runtime doesn't meet a rule that no code leaves your infrastructure for inference.
When should I use an automation instead of the SDK?
When the job runs on a schedule or on an event Cursor already triggers on, such as a GitHub event, a Slack message or a webhook. An automation covers that with no code for you to own. Use the SDK when your own software is the caller and you want the run's events, state or trigger inside your product.
Sources & last verified
- Cursor changelog: SDK custom stores, tools and auto-review
- Cursor Python SDK
- Cursor TypeScript SDK
- Cursor docs: SDK Bridge
- Cursor CLI overview
- Cursor changelog
- Cursor docs: SDK release notes
- Cursor docs: Service accounts
- Cursor docs: Automations
Cursor ships frequently. Facts verified against primary sources on October 28, 2026.