Create and version golden evaluation datasets

Create org-scoped golden evaluation datasets and graded test items via /v1/eval/datasets to anchor every prompt and model release gate.

Every production AI incident should graduate into one permanent item in your golden evaluation dataset. /v1/eval/datasets keeps versioned, tenant-private test suites ready for every CI check.

Architecture & contract

Datasets are keyed by unique name inside your org. Re-posting metadata edits the dataset cleanly, while /items appends (input, expected, metadata, status) rows. Archived items remain readable for historical audits while excluded from active scoring.

Primary endpoint: POST /v1/eval/datasets · Status: shipped · Level: foundations

Run it across all four surfaces

hanzo eval datasets create --data '{"name":"checkout-guardrails-v1","description":"Critical checkout & billing edge cases"}'
hanzo eval datasets items create checkout-guardrails-v1 --data '{
  "input": {"cart_total": 1200, "coupon": "EXPIRED2024"},
  "expected": {"reject_coupon": true},
  "status": "active"
}'
hanzo eval datasets items get checkout-guardrails-v1
import { Configuration, EvalApi } from 'hanzoai';

const evalApi = new EvalApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
await evalApi.postEvalDatasets({ name: 'checkout-guardrails-v1', description: 'Critical checkout edge cases' });
await evalApi.postEvalDatasetsByNameItems('checkout-guardrails-v1', {
  input: { cart_total: 1200, coupon: 'EXPIRED2024' },
  expected: { reject_coupon: true },
  status: 'active',
});
import os
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import EvalApi

api = EvalApi(ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"])))
api.post_eval_datasets({"name": "checkout-guardrails-v1", "description": "Critical checkout edge cases"})
api.post_eval_datasets_by_name_items(
    "checkout-guardrails-v1",
    {"input": {"cart_total": 1200, "coupon": "EXPIRED2024"}, "expected": {"reject_coupon": True}, "status": "active"},
)
curl -s -X POST https://api.hanzo.ai/v1/eval/datasets \
  -H "Authorization: Bearer $HANZO_API_KEY" -H "Content-Type: application/json" \
  -d '{"name":"checkout-guardrails-v1","description":"Critical checkout edge cases"}' | jq '.'

curl -s -X POST https://api.hanzo.ai/v1/eval/datasets/checkout-guardrails-v1/items \
  -H "Authorization: Bearer $HANZO_API_KEY" -H "Content-Type: application/json" \
  -d '{"input":{"cart_total":1200,"coupon":"EXPIRED2024"},"expected":{"reject_coupon":true},"status":"active"}' | jq '.'
curl -s -X POST https://api.hanzo.ai/v1/mcp \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "eval",
      "arguments": {"op": "get_eval_datasets", "input": {}}
    }
  }'

Verify the outcome

  • Fetch GET /v1/eval/datasets/checkout-guardrails-v1/items and confirm your graded item appears with status: "active".

Production guardrails

  • Keep golden eval datasets strictly segregated from /v1/train/artifacts training splits to eliminate data leakage.

Next steps & Hanzo University

Was this page useful?
Broken link or missing step? Drop it in #docs on Discord or open a PR.
Last updated Nov 25, 2026