Home / Reference

Technical reference

Requirements#

Node.js 22 or newer (Node 20 reached end of life in April 2026). Tested on Node 22, 24 and 26 on Ubuntu, Windows and macOS in GitHub Actions.

Install and run#

# no install: run from npm
npx evalsutra doctor

# or straight from GitHub source
npx github:shahvatsalofficial/evalsutra doctor

# or install globally (your choice)
npm install -g evalsutra

# from a clone
git clone https://github.com/shahvatsalofficial/evalsutra.git
cd evalsutra
npm test
node packages/cli/evalsutra.mjs doctor

Published on npm as evalsutra (Apache-2.0, zero dependencies). The GitHub form always tracks the latest commit.

Exit codes#

CodeMeaning
0success, GO_CANDIDATE, compare PASS, audit PASS
1usage or runtime error (bad flag, unreadable file, refused overwrite)
2NO_GO, regression, trace failure, audit FAIL
3REVIEW, compare INCONCLUSIVE, trace inconclusive
4invalid evidence: bad suite, bad observations, capsule hash mismatch

Commands#

CommandPurpose
demo [--bad] [--out d]run the bundled demo suite on bundled synthetic data from any folder; --bad gives exit 2
doctorenvironment facts as JSON; states liveAgentExecution: false
init [--dir d]write starter suite.json and observations.json; refuses to overwrite
validate --suite scheck a suite; exit 4 on errors
run --suite s --observations o --out d [--runner replay] [--dry-run]evaluate; write 4 report files
compare --baseline a.json --candidate b.json [--out f]paired comparison
report --in report.json --format md|html|junitre-render a report to stdout
gate --report r.json [--policy p.json]apply a stricter policy
trace analyze --input t.json [--forbid a,b] [--allow a,b]tool trace findings
repro export --suite s --observations o --report r --out dbuild capsule
repro verify dircheck capsule hashes
audit [--out d]self-audit; writes audit-report.json/.md/.html
install --ide x --project p [--skills a,b] [--dry-run]copy skills (x: claude, cursor, codex, gemini, copilot)
uninstall --ide x --project p [--dry-run]remove unmodified EvalSutra files
list-skillsprint the 18 skill names
matrixhost compatibility matrix: verified vs unknown

Every command accepts --help. --runner other than replay returns exit 1 with not_supported.

Suite format#

{
  "schemaVersion": 1,
  "name": "my-agent-acceptance",
  "gate": { "minPassRate": 0.9, "minCoverage": 0.9 },
  "cases": [
    { "id": "factual-answer", "critical": true,
      "assertions": [{ "type": "normalized_equals", "value": "paris", "weight": 3 }] },
    { "id": "no-secret-tool",
      "assertions": [{ "type": "forbidden_tools", "tools": ["read_private_key"] }] }
  ]
}

Rules: schemaVersion must be 1; name non-empty; id matches ^[a-z0-9][a-z0-9-]*$ and is unique; weight is a positive number (default 1); thresholds are between 0 and 1; skip: true skips a case.

Observations format#

{
  "schemaVersion": 1,
  "recordedAt": "2026-11-07T00:00:00Z",
  "cases": {
    "factual-answer": { "sourceType": "actual_run", "output": "Paris", "toolCalls": [], "latencyMs": 420 }
  }
}

sourceType is optional. If absent it is recorded as unspecified and treated as acceptable. Own-property lookup is used, so a case id like constructor cannot read inherited members. [E7]

Trace format#

{ "events": [
  { "id": "e1", "type": "tool_call", "name": "run_tests", "args": {}, "ok": false },
  { "id": "e2", "type": "final", "text": "All done" }
] }

Report format (report.json, schemaVersion 2)#

FieldMeaning
kindoffline-replay-evaluation
scoringVersionscoring-v2
warningstates that no agent was executed
provenancesource, suiteDigest, observationsDigest, tool and Node versions, platform
metricscounts, coverage, passRate, criticalFailures, caseLevel.passRateCI95
thresholdsgate thresholds actually used
releaseGateNO_GO, REVIEW, GO_CANDIDATE
reportDigestSHA-256 of metrics, cases and gate (excludes timestamps)
cases[]id, status, critical, sourceType, assertions with reason codes

Digests use key-sorted JSON, so reordering keys does not change them. [R2, R3]

Policy file (gate --policy)#

{ "minPassRate": 0.9, "minCoverage": 0.9, "maxInconclusive": 0 }

Use in CI#

- run: npx evalsutra run --suite suites/mine.json --observations out/obs.json --out out/eval
- run: npx evalsutra gate --report out/eval/report.json --policy policies/default.json
- uses: actions/upload-artifact@v4
  with: { name: evalsutra-report, path: out/eval }

A non-zero exit fails the job. Exit 3 (REVIEW) is also non-zero, so missing evidence blocks the build.

Statistics#

Security helpers#

Redaction patterns: private key blocks, GitHub tokens (ghp_, gho_, ghu_, ghs_, ghr_, github_pat_), sk- style API keys, AWS access key ids, Bearer tokens. Redaction is pattern based and cannot find unknown secret formats.

Known limits#