Skip to content

Caveman Agent SDK· Open sourceAgent SDK & Harness v4

Evals, 30 Fail-Closed Graders, Session Protocol, and Recipes

Grade agent outputs offline with @caveman-ai/evals (30 fail-closed graders), inspect Session Protocol v1 schemas in @caveman-ai/protocol, and run the 5 starter recipes.

@caveman-ai/evals (MIT) and @caveman-ai/protocol (MIT) ship open-source contracts and graders that run identically offline in CI and on Caveman Cloud.

30 fail-closed graders (@caveman-ai/evals)#

Install the TypeScript grader package (or caveman-evals for Python parity):

npm install @caveman-ai/evals

Every grader fails closed on missing fields, schema mismatches, or invalid targets. Categories include:

  • Deterministic text & JSON checks: exact_match, contains, regex, json_schema, json_path, forbidden substring checks.
  • Agent tool-call checks: tool_called, ordered tool assertions, argument validation, cost_threshold, latency and token bounds.
  • Metric & retrieval graders: BLEU, ROUGE, localization F1.
  • Webhook & rubric judges: SSRF-pinned webhook graders and bias-guarded LLM rubric judges.

Session Protocol v1 (@caveman-ai/protocol)#

@caveman-ai/protocol exports the canonical types and JSON Schemas shared across Harness v4, Caveman Code, and Caveman Cloud:

  • SessionEvent and UserEvent wire envelopes
  • Headless exit codes 0..6
  • agent-build.schema.json (deterministic AGENT.md -> agent.json manifest)
  • eval-file.schema.json (one-file *.eval.json CI suites)
  • grader-registry.json (canonical grader option schemas)

React hooks & external framework adapters#

  • @caveman-ai/react: React hooks for streaming SessionEvent timelines and interactive Caveman Gate approval dialogs.
  • @caveman-ai/adapter-kit: Interfaces for adapting external agent runtimes onto the Caveman Session Protocol.

Five verified starter recipes#

Every recipe under examples/basics/ in caveman-ai/agent-sdk is a standalone 30 to 65 line TypeScript file verified offline in CI:

#RecipeWhat it teaches
0101-hello-agent.tsdefineAgent(), tool(), and runInProcess() with zero boilerplate
0202-tools-and-gates.tsFail-closed Caveman Gate approval policies (approve vs deny) on sensitive tools
0303-harness-v4-session.tsDirect Harness v4 (HarnessSession, appLoadoutFor, LocalEnv, toHarnessTool, beforeCall hooks)
0404-deterministic-build.tsCompiling an agent definition into a byte-stable AGENT.md + SHA-256 manifest
0505-evals-and-graders.tsGrading agent runs locally with @caveman-ai/evals (contains, tool_called, cost_threshold)

Next: gate pull requests on Caveman Cloud with Evals & CI Gates.

Esc

Start here