Cursor's Agent SDK Lets Developers Build and Version Bots Like Code

Cursor's new Agent SDK turns custom bots into versioned repos of Markdown prompts and TypeScript tools, with built-in evals and flexible hosting.

·
·
·
  • Cursor released the Agent SDK for defining bots as Markdown prompts and TypeScript tools in your repo.
  • Same harness powers Bugbot, Security Review, Approval Bot, and Rollouts internally at Cursor.
  • Deploy to Cursor-managed hosting or run the agent process on your own infrastructure.
  • Built-in evals as regular TypeScript let you gate agent changes like unit tests.
  • Templates ship for PR reviewers, security scanners, owners-policy approvers, and issue triagers.
  • Package is @grok/agent-sdk, billed on standard token-based consumption pricing.

Cursor has released an Agent SDK for building agents from source-controlled Markdown and TypeScript files. Developers define instructions, tools, triggers, and evaluations in a repository, while Cursor’s harness manages the model loop that selects actions, calls tools, and processes results. Cursor says the same system powers Bugbot, Security Review, and the Approval Bot.

Agents become versioned projects

An Agent SDK project stores the bot’s prompt, tools, skills, subagents, event channels, and tests in a directory that teams can review and version with the rest of an application. The system prompt lives in instructions.md, each typed tool gets a TypeScript file, and channels can start sessions from pull requests, CI runs, Slack messages, or webhooks.

Running agent-sdk init creates a project with this structure:

perl
my-bot/
├── bot/
│   ├── agent.ts            # model and harness configuration
│   ├── instructions.md     # system prompt
│   ├── tools/              # typed tools
│   ├── skills/             # procedures loaded on demand
│   ├── subagents/          # delegated workers
│   ├── channels/           # GitHub, Slack, and webhook triggers
│   └── hooks/              # session event observers
└── evals/                  # regression checks

One layer above @cursor/sdk

Cursor also offers @cursor/sdk, a lower-level TypeScript package for calling the agent used by its IDE, CLI, and web app. The Agent SDK adds a prescribed project structure and manages sessions, model loops, sandboxing, deployment, triggers, and artifact storage.

Option Developer controls Best fit
@cursor/sdk Agent calls and application orchestration Embedding Cursor’s agent in an existing TypeScript service or script
Agent SDK Prompts, tools, triggers, subagents, and evals Deployable bots maintained as standalone, versioned projects

Teams can deploy agents to Cursor’s hosted infrastructure or run the process on their own hardware. The harness also provides model routing, Model Context Protocol connections, secret management, and evaluations. Organizations with residency or egress requirements should still verify where model requests, tool outputs, and stored artifacts travel.

Evals live beside the bot

Evaluations and unit tests use TypeScript and live in the project’s evals/ directory. Teams can run them in CI, compare behavior after prompt or tool changes, and block deployments when defined checks fail. This layout gives agent changes the same review, regression-testing, and rollback path as application code.

Repository workflows come first

The bundled templates focus on recurring engineering and operations tasks:

  • GitHub pull-request reviewers that inspect diffs and leave inline comments
  • Security scanners that run on every push
  • Ownership-policy approvers that gate merges by file path
  • Issue triagers that label and route Linear or Jira tickets
  • Scheduled quality reviewers that scan repositories on a cron schedule

Cursor’s product guidance assigns prompt-and-trigger jobs to Automations, interactive agents inside Cursor to Grok Bot, and versioned projects with custom code, integrations, tests, or deployment requirements to the Agent SDK.

Beta APIs require guardrails

The package is published as @grok/agent-sdk after being renamed from @cursor/bdk. Cursor’s underlying TypeScript SDK remains in public beta, and its documentation warns that APIs may change before general availability. Teams adopting it now should pin package versions and review release notes before upgrades.

Usage follows Cursor’s token-based consumption pricing, so frequent triggers and large evaluation suites can raise costs. Useful controls include limiting changed files, capping model turns, selecting smaller models for routine checks, and running full eval suites only before deployment.

The project layout and CLI assume Node.js and TypeScript. Teams that define tools in Python can use a community wrapper for the lower-level SDK, but the Agent SDK does not provide the same native Python project structure.

Agent operations join the code lifecycle

Storing instructions, tools, triggers, and evaluations in a repository gives teams an auditable path from pull request to deployment. Code review records prompt changes, CI measures regressions, version control supports rollback, and ownership rules govern who can modify an agent. For teams that have outgrown Cursor Automations or other prompt-and-trigger workflows, the Agent SDK provides more control over integrations, testing, execution, and hosting.

Trending
  • No trending articles

Comments

avatar

Next Reads