Cursor Introduces a TypeScript SDK for building Sandboxed VM programming agents, Suagents, Hooks, and token-based values.

Cursor, an AI-powered code editor, is opening up the underlying technology behind its coding agents to developers everywhere. The Cursor team has announced a public beta of Cursor SDK — a TypeScript library that gives developers access to the same runtime, frameworks, and models that power the Cursor desktop application, CLI, and web interface.
This marks a significant shift in the way AI coding tools are positioned: not just as interactive assistants sitting next to developers, but as usable infrastructure that organizations can plug into their existing systems.
From Interactive Tool to Programmable Infrastructure
If you’ve used Cursor before, you know it as an IDE where you interact with an agent in real time – asking it to write tasks, fix bugs, or explain code. The Ccursor SDK changes the access model. Instead of a developer sitting at a keyboard, an agent can now be invoked programmatically: from a CI/CD pipeline trigger, a backend service, or embedded directly within another product.
Think of it this way: previously, you had to be “inside” the Cursor to use its agents. Now, you can call those same agents anywhere in your stack with a few lines of TypeScript.
Startup is a single command:
From there, you create a Agent for example, submit a function, then broadcast the response back – all in TypeScript. Here’s a small example from the Cursor declaration:
import { Agent } from "@cursor/sdk";
const agent = await Agent.create({
apiKey: process.env.CURSOR_API_KEY!,
model: { id: "composer-2" },
local: { cwd: process.cwd() },
});
const run = await agent.send("Summarize what this repository does");
for await (const event of run.stream()) {
console.log(event);
}
I Agent.create() the phone accepts the apiKeya model field (where you specify which model should work), and a local or cloud the configuration depends on where you want the execution to take place.
Why Building Your Agent Stack Is Hard
Before diving into what the SDK has to offer, it’s worth understanding the problem it solves. Building fast, reliable, and efficient coding agents that work securely against your data requires a reasonable engineering effort: secure sandboxing, robust state and session management, environment setup, and context management. And when a new model goes live, dev teams often have to completely rework their agents to take advantage of it. The Cursor SDK eliminates this complexity so teams can focus on building useful agents instead of maintaining the underlying infrastructure.
Agent Harness: What “Equal Time to Work” Really Means
SDK agents use the same harness that powers Cursor products. ‘Harness’ here refers to the full set of supporting infrastructure that enables the agent to function beyond the LLM wire itself. In the case of Cursor, that includes:
Smart content management – Codebase indexing, semantic search, and quick grep so agents can find the correct code context before generating responses. This is important because LLMs are only as good as the content they receive; Incorrect retrieval leads to misleading or irrelevant results.
MCP servers – Agents introduced with the SDK can connect to external tools and data sources stdio or HTTP, with a .cursor/mcp.json config or pass inline to the API call. MCP (Model Context Protocol) is an open standard for wiring tools for agent runtimes.
Skills – Agents automatically take on behavioral meanings that are usable in a .cursor/skills/ directory in the repository.
Hooks – A .cursor/hooks.json file allows you to view, manage, and extend the agent loop in cloud, self-hosted, and local runtimes – useful for logging, monitoring, or custom tuning.
Subagents – The main agent can delegate sub-tasks to named subagents with their own instructions and models by using them Agent tool, which enables multi-agent workflows without custom orchestration code.
Cloud Deployment: Persistent, Sandboxed, and Continuous
One of the most effective features of the SDK is cloud execution. When configured to run in the Cursor cloud, each agent gets its own dedicated VM with strong sandboxing, a local clone of the target cursor, and a fully configured development environment. Importantly, the agent continues to run even if the host machine is not connected to the Internet – the developer can reconnect and broadcast the conversation later.
Cloud Agents include the Cursor Agents Window and web application, so that work started programmatically with the SDK can be tested or captured manually within the Cursor interface. When an agent finishes, they can open a PR, push a branch, or attach demos and screenshots – making them suitable for asynchronous, unattended workflows:
const agent = await Agent.create({
apiKey: process.env.CURSOR_API_KEY!,
model: { id: "gpt-5.5" },
cloud: {
repos: [{ url: " startingRef: "main" }],
autoCreatePR: true,
},
});
const run = await agent.send("Fix the auth token expiry bug");
console.log(`Started ${run.id}`);
// ...check back in later, from anywhere:
const result = await (
await Agent.getRun(run.id, { runtime: "cloud", agentId: run.agentId })
).wait();
console.log(result.git?.branches[0]?.prUrl);
For dev teams with security needs, the SDK also supports self-hosted staffing, where both the code and functionality of the tools reside within the organization’s own network.
Adaptable Model and Composer 2
The SDK exposes every model supported in Cursor. Changing models is a single field change in model parameter, which allows teams to move tasks to the best model for a given combination of cost and capacity. His own Composer 2 – defined as a specialized coding model that achieves borderline performance at a fraction of the cost of general-purpose models – is set as the default recommendation for many coding agent tasks.
Getting started
To speed up adoption, Cursor has published a public cookbook repository on GitHub with four initial projects: a small quickstart (a Node.js example that creates a local agent, sends a single message, and broadcasts a response), a web-based modeling tool for designing new projects in a cloud environment with a sandbox, an agent that automatically opens a board, a PR that automatically opens a PR board. a lightweight CLI agent for spawning Cursor agents from the terminal.
The cursor also took out ia SDK cursor plugin in the Cursor Marketplace to help developers start building directly within the editor.
Key Takeaways
- Ccursor SDK is now in public beta – Cursor released TypeScript SDK (
npm install @cursor/sdk) that gives developers access to the same runtime, strings, and models that power Cursor’s desktop application, CLI, and web interface. - It eliminates the hard parts of code building agents – Teams no longer have to engineer secure sandboxing, robust state and session management, environment settings, and context management from scratch – and they won’t have to rework the hipping agent every time a new model arrives.
- Works locally or in the Cursor cloud — Agents can run on a developer’s local machine for rapid replication, in the Cursor cloud against a dedicated VM with strong sandboxing, or on self-hosted staff for teams with strict network security needs.
- Complete harnesses are included out of the box – SDK agents inherit Cursor’s complete infrastructure: intelligent content management (codebase indexing, semantic search, fast grep), MCP server support, Skills, Hooks, and Subagents – the same stack that powers Cursor’s own products.
Check it out A cookbook again Technical details. Also, feel free to follow us Twitter and don’t forget to join our 130k+ ML SubReddit and Subscribe to Our newspaper. Wait! are you on telegram? now you can join us on telegram too.
Need to work with us on developing your GitHub Repo OR Hug Face Page OR Product Release OR Webinar etc.? contact us

Michal Sutter is a data science expert with a Master of Science in Data Science from the University of Padova. With a strong foundation in statistical analysis, machine learning, and data engineering, Michal excels at turning complex data sets into actionable insights.


