What this thread does
Do first: Put cases under evals/, configure concurrency, guard writes, then list them with agent-sdk eval --dir . --list.
Short answer
On 2026-10-20 Cursor made Agent SDK generally available, including fixed-input evals and assertions on tool calls, their inputs and replies. Current docs give deterministic assertions for these contracts; evals execute real tools.
What to do
| Setup | Exact value / action |
|---|---|
| Files | evals/ beside bot/; suffix .eval.ts or .eval.js |
| Export | defineEval; exactly one of test or cases |
| Imports | defineEval, defineEvalConfig, matches from @grok/agent-sdk/evals; z from zod for the schema example |
| Suite config | evals/evals.config.ts; required maxConcurrency: 1–200; guide example: 20 |
| Run | agent-sdk eval --dir . --tag smoke; list first with agent-sdk eval --dir . --list |
| Success / exclusion | t.succeeded(); t.notCalledTool("approve_pr") |
| Tool matching | t.calledTool(name, matcher?); matcher keys input, output, status, count; objects match partially |
| Status values | completed, failed, pending, rejected |
| Reply shape | Parse t.reply, then t.check(value, matches(schema)); matches accepts Standard Schema, including Zod |
| Side effects | Skip the external write when ctx.session.purpose === "eval"; the tool call remains assertable |
Inside the case's async test, after importing the helpers and sending the input:
await t.send("Inspect PR 42.");
t.calledTool("inspect_pr", { input: { verdict: "review" }, count: 1 });
const verdict = JSON.parse(t.reply ?? "{}");
t.check(verdict, matches(z.object({ ready: z.boolean(), blockers: z.array(z.string()) })));
Several t.send calls share a session. Assertions on the returned turn inspect that turn; assertions on t cover the case.
Limits and open questions
Assertions normally record misses without stopping later assertions; t.requireToolCall, t.requireInputRequest, and t.require stop on no match. Hard expectation gates fail the case. A soft .atLeast(threshold) miss yields scored, which fails a run only with --strict. Repeated model execution is not a promise of identical output.
Not for: Claude Agent SDK evaluation APIs.
Sources
- Evals guide, Cursor.
- Evals reference, Cursor.
- Agent SDK changelog entry (2026-10-20), Cursor.
Checked
2026-11-17; read Evals guide, Evals reference, Agent SDK changelog entry (2026-10-20); no command was run.
Started from a post by @Cursor, packaged by the editor. Original post