# Agent SDK

Agent SDK lets you define, test, evaluate, and deploy agents as code. It uses the Cursor SDK harness
that powers Bugbot, Security Review, Approval Bot, and Rollouts.

An Agent's behavior is defined in a folder of Markdown and TypeScript that combines deterministic
code with model judgment. Agent SDK makes it easy to build useful agents, with APIs to interact on
Slack, pull requests, issue trackers, Cursor, and the other places where you get work done.

After you deploy an agent, open [Deployed Agents](https://cursor.com/dashboard/deployed-agents) to
manage it.

## Get Started with your Coding Agent

Paste this prompt into your coding agent. It installs the CLI, asks what your agent is for, and
scaffolds a first project from the Markdown version of these docs.

```text
Set up my first Agent SDK project.

Read https://cursor.com/docs/agent-sdk.md first. Every page under
https://cursor.com/docs/agent-sdk/ is also available as Markdown when you
add .md to its URL.

1. Check that Node is 22.13 or newer, then run:
   npm install --global @grok/agent-sdk
2. Read the docs index that ships with the package:
   "$(npm root -g)/@grok/agent-sdk/dist/docs/llms.txt"
3. Run agent-sdk login, and wait while I finish the browser sign-in.
4. Ask me what the agent should do and where people will reach it. Then
   follow the bdk-create-agent skill at
   "$(npm root -g)/@grok/agent-sdk/skills/create-agent/SKILL.md"
   to scaffold the project with agent-sdk init.
5. Run agent-sdk validate --dir . and one agent-sdk run turn, then show me
   the reply.
```

## Why Agent SDK

Your instructions, tools, and evals are files you review, test, and version like the rest of your
code. You write the instructions and tools, and Cursor runs the model loop that calls them.

## When to use Agent SDK

|                    | Cursor Automations                            | Grok Bot                                                        | Agent SDK                                                                                          |
| ------------------ | --------------------------------------------- | --------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| **You define**     | A prompt, model, and trigger in the dashboard | Instructions, skills, and connected tools in the app            | A versioned Markdown and TypeScript project                                                        |
| **Where it runs**  | Cursor-managed                                | Cursor-managed                                                  | Cursor-managed hosting or your infrastructure                                                      |
| **Choose it when** | The job fits a schedule or event trigger      | You want to configure and talk to an agent without writing code | You want code around model judgment that your team can version control, review, test and hillclimb |

## Get started

Install `@grok/agent-sdk`, then scaffold and run a project. The package was `@cursor/bdk` before.

```bash
npm install --global @grok/agent-sdk
agent-sdk init ./my-bot
cd my-bot
agent-sdk dev
```

[Project layout](https://cursor.com/docs/agent-sdk/reference/project-layout.md) explains every folder under `bot/`.

## Next steps

- [Build your first PR reviewer agent](https://cursor.com/docs/agent-sdk/quickstart.md) step by step.
- Start from a [review or triage template](https://cursor.com/docs/agent-sdk/templates/reviews.md) or the
  [owners-policy approver](https://cursor.com/docs/agent-sdk/templates/agentic-owners.md).
- [Convert a Cursor Automation](https://cursor.com/docs/agent-sdk/guides/convert-automation.md) into an Agent SDK project.
- [Build agents with agents](https://cursor.com/docs/agent-sdk/building-with-agents.md) using a coding agent.
- Look up commands in the [CLI reference](https://cursor.com/docs/agent-sdk/reference/cli.md) and deployed-agent roles in
  [Access](https://cursor.com/docs/agent-sdk/reference/access.md).

## Architecture

Agent SDK architecture

- You bring the code and ideas: Agent as code
  - Prompts as .md or .ts
  - Deterministic code hooks
- Cursor-managed or self-hosted:
  - Source control + Issue tracker + Slack triggers
  - Model routing
  - Evals
  - MCP connections
  - Sessions · Model loops · Subagents · Tool calls
  - Secret management
  - Sandboxing
  - Deployment
  - Storage + Artifacts


---

## Sitemap

[Overview of all docs pages](/llms.txt)
