Skip to main content
sphynx-sh is the TypeScript package for defining and running evals for coding agents. Suites, mocks and validators live in your repository next to the code they test.

Prerequisites

Add a harness connection, then create an API key with evals:write and evals:read under Settings > API keys.
Save harness credentials in Sphynx, never in eval definitions. Hosted sandboxes and mocks need no keys of their own.

Install

Define a suite

Create smoke.eval.ts:

Run it

The CLI compiles the file on your machine, including imported fixtures and validators, and starts a batch. Each trial runs in its own hosted sandbox. The GitHub Action runs the same command, and you can also start a batch from your own code.

Vocabulary

  • Suite: a system prompt and shared setup for many cases. It needs an id, and its name defaults to the id.
  • Case: one eval. It needs an id, and its name defaults to the id. It sets up a scenario and checks the result with validate. A case gets a new version when its definition changes.
  • Variant: the harness, model and sandbox, plus an optional profile, a case runs on.
  • Run: one case on one variant. It holds the trials.
  • Trial: one attempt, in its own sandbox. A run’s pass rate is taken across its trials.
  • Batch: the runs started together. Starting evals creates a batch.
The suite above has one case, one variant and three trials, so its batch holds one run with three trials. Two cases on three variants with three trials each would be six runs and 18 trials.

Package exports

Definitions are plain objects and handlers are ordinary functions. Mock inputs use Standard Schema for types and runtime checks (the examples use Zod). You don’t need Effect or a separate model client.

Write cases

Add sources, preparation and typed validators.

Mock dependencies

Give agents typed MCP servers, CLIs and HTTP APIs.