Skip to content

Cursor Agent SDK: Agents as Code, Evals and Deployment Explained

AINewss Editorial Team

The Cursor Agent SDK lets you define an agent as a folder of code, test it with evals, and deploy it to Cursor or your own infrastructure. This guide covers the init commands, folder layout, event channels, replay-based eval workflow, and how it differs from the TypeScript Cursor SDK.

View 2 references
0 views 0 likes

Allow the functional cookie to save your likes. Privacy details

A code folder containing agent instructions, tools and channels connected to pull request events and an evaluation dashboard.

What is the Cursor Agent SDK?

The Cursor Agent SDK is a generally available toolkit for defining an agent as a folder of code, testing it with evals, and deploying it to Cursor or your own infrastructure. It was announced on October 20, 2026 in the official Cursor changelog.

Rather than a library you wire into an application, the Agent SDK treats a project directory as the agent: prompts, tools, skills, MCP connections, and message channels all live as files that can be validated and versioned.

How do you create and run an agent with the Cursor Agent SDK?

You start with npx @cursor/agent-sdk init ./my-bot, then run agent-sdk dev to start the bot locally with a playground for debugging. Passing --template begins from a security reviewer, an owners-policy approver, a PR autofixer, or a Linear or Jira triager.

A typical first session is to scaffold from a template, inspect the generated files with agent-sdk info, and run agent-sdk validate before connecting any real event source. That keeps mistakes local until the agent behaves as expected in the playground.

What does an agent project folder contain?

An agent project has a defined layout. instructions.md is the prompt, each file in tools/ is one typed action the model can call, skills/ holds procedures loaded on demand, mcp-connections/ adds tools from MCP servers, and channels/ defines where the bot receives and sends messages.

agent-sdk validate checks the project structure and agent-sdk info prints what was discovered. Because the whole agent is files, reviews and rollbacks use the same git workflow as application code rather than a separate prompt-management system.

Which event channels can wake a Cursor Agent SDK bot?

Agents wake on pull request, comment, and CI events from GitHub, GitLab, and Bitbucket; on mentions and direct messages in Slack; on webhooks from any provider; and on a cron schedule. GitHub events are pulled through your Cursor account, so no public webhook URL is needed.

Each conversation keeps its own session with a complete record of every message and tool call. A follow-up question in a pull request or Slack thread resumes the same session, which is what makes an event-driven bot feel like a continuous collaborator.

How do evals work in the Cursor Agent SDK?

An eval sends a fixed message to the bot and asserts on its behavior: which tools ran, with what inputs, and what shape the reply took. You can run agent-sdk eval locally or in CI, so behavior changes can be caught before deployment.

For GitHub-driven bots, agent-sdk github replay pr-url`` converts a real pull request into signed webhook payloads and delivers them to the bot without waiting for a push. Adding --dry-run --fixtures-dir fixtures/ saves those payloads as reusable eval fixtures.

Where can you deploy a Cursor Agent SDK agent?

Running agent-sdk deploy from the project directory builds the agent, assigns it a URL, and starts it on Cursor's infrastructure. Secrets and integrations are managed from the dashboard, while logs, evals, and the playground remain consistent with the local workflow.

The changelog also says agents can be deployed to your own infrastructure. That option matters for teams with data-residency rules or existing deployment pipelines that cannot send tool execution to a hosted runtime.

Cursor Agent SDK vs Cursor SDK: what is the difference?

Cursor has also published a separate TypeScript package, @cursor/sdk, announced as a public beta for building programmatic agents from a few lines of TypeScript code. The two products share Cursor's agent runtime but address different workflows: a library call inside your own service versus a versioned, deployable bot project.

The TypeScript SDK announcement describes Agent.create, streaming runs, cloud VMs, and models such as Composer 2.5. The Agent SDK instead packages an agent as a folder with channels and evals, so choose it when you want a deployable bot rather than a library call inside your own service.

What are the limits of the Cursor Agent SDK?

The Agent SDK is tied to Cursor's ecosystem: deployment, secrets, and GitHub event access through your Cursor account are all part of the value proposition and also a dependency. The channel list is specific, so unusual event sources are likely to need a generic webhook or cron workaround.

Evals assert on tool use and reply shape, which is stronger than eyeballing a demo but still not a guarantee of correctness on open-ended tasks. Test against real pull requests and real Slack threads before granting an agent write access.

Frequently asked questions about the Cursor Agent SDK

These questions cover how the Cursor Agent SDK is used in practice: whether it is stable, what it costs to adopt, how it handles secrets, and whether it can run outside Cursor. The answers are drawn from the official announcement and the separate SDK release notes.

Is the Cursor Agent SDK generally available?

Yes. The October 20, 2026 changelog says the Agent SDK is generally available today. That is different from the separate TypeScript @cursor/sdk, which was announced as a public beta.

Do I need a Cursor account to use it?

For GitHub event channels and hosted deployment, yes: the changelog says GitHub events pull through your Cursor account, and secrets are managed in the dashboard. Self-hosted deployment may reduce that dependency, but the documented path is Cursor-centric.

What templates are available at init?

The --template flag offers a security reviewer, an owners-policy approver, a PR autofixer, and a Linear or Jira triager. These are starting points meant to be edited as files in the project, not fixed products.

Can I test a GitHub bot without pushing a commit?

Yes. Use agent-sdk github replay pr-url`` to turn a real pull request into signed webhook payloads and send them to the bot. Add --dry-run --fixtures-dir fixtures/ to keep the payloads as eval fixtures for later use.

References

  1. Agent SDK - Cursor Changelogcursor.com
  2. Build programmatic agents with the Cursor SDKcursor.com