Getting started

How do I build an AI coding agent?

View as Markdown

You can build a coding agent from three parts: a model, a set of tools, and a harness that runs them in a loop. While you can write it yourself to better understand how agents work, use the Grok Build SDK to build on the same runtime that powers Grok Build.

What is a coding agent made of?

Every coding agent needs a harness, which combines the model the user selects, the tools the agent can access, and the instructions the user provides to achieve a goal. From there, the agent works autonomously, using those tools to read and write files, search the code, or look up information on the web to create working software. The Agents chapter of Learn covers the building blocks.

Can I build an agent without coding?

Yes. If you want to automate work or repeat a workflow without managing code, use Automations. You pick a model, provide instructions, and run your agent on a schedule or from events in GitHub, Slack, Linear, and more.

How do I build a coding agent with the Grok Build SDK?

The Grok Build SDK lets you launch agents with the same harness, runtime, and models that power Grok Build. Install it, create an agent, send it a prompt, and stream the results. You build custom workflows on top of Grok Build's agent instead of rebuilding the agent stack yourself.

TypeScript

import { Agent } from "@cursor/sdk";

const agent = await Agent.create({
  apiKey: process.env.CURSOR_API_KEY,
  model: { id: "composer-2.5" },
  local: { cwd: process.cwd() },
});

const run = await agent.send("Summarize what this repository does");

for await (const event of run.stream()) {
  console.log(event);
}

What can I build with the Grok Build SDK?

You can run agents on your machine or on Grok Build's cloud against a dedicated VM, with any frontier model. Teams kick off agents from CI/CD to summarize changes and fix failures, build internal tools, and embed an agent experience inside their own products. See the TypeScript and Python SDK docs to start, the SDK Bridge for other languages, or explore the cookbook of examples.


Last updated: November 24, 2026