Overview
The specification-driven flow works like this:- Define specifications — describe what your product should do, cannot do, and must follow
- Generate or link metrics — AI generates judge prompts from your specs, or you link existing metrics
- Create datasets from specs — dataset type is auto-derived from the specification
Prerequisites
- A product with a description (created via dashboard or SDK)
- A version to evaluate
- The Galtea SDK installed and configured
Step 1: Define Specifications
Specifications represent testable behavioral expectations. There are three types:- Capability — what the product can do (e.g., “Can explain investment concepts”)
- Inability — what the product cannot do due to hard technical limits (e.g., “Cannot execute transactions”)
- Policy — rules the product must follow (e.g., “Must refuse personalized investment advice”)
Policy specifications require a
dataset_type (ACCURACY, SECURITY, or BEHAVIOR) that determines how the spec is evaluated. Capability specifications always get the BEHAVIOR dataset type, assigned automatically — you never choose it. Inability specs do not have a dataset type.Step 2: Generate or Link Metrics
Metrics define how each specification is scored. You have two options:Option A: AI-Generated Metrics (Recommended)
From the dashboard, open your product, pick Specifications in the sidebar, open the dropdown on a specification, and click Generate Metrics. The AI creates judge prompts and evaluation parameters tailored to each spec. See AI Metric Generation for the full workflow.Option B: Manual Metric Creation and Linking
Create a metric with a custom judge prompt and link it to a specification:Step 3: Create Datasets from Specifications
Datasets can be created from specifications in two ways:Option A: AI-Generated Dataset Configurations (Dashboard)
From the dashboard, open your product, pick Specifications in the sidebar, select the Policy and Capability specifications you want to generate datasets for, and use the bulk actions menu to click Create Datasets. The system will suggest dataset configurations — including name, type, variants, strategies, and max test cases — all auto-derived from your specifications. Review each candidate, edit if needed, and save.The bulk Create Datasets action covers Policy specifications with a
SECURITY or BEHAVIOR dataset type, and every Capability specification (always BEHAVIOR). An ACCURACY specification is generated one at a time instead, because its questions and their known-correct answers are built from a knowledge base file you provide: use Setup for evaluation on the specification’s row, which asks you for that file. The system uses the specification’s description as context — for Security datasets it becomes the custom_variant_description, and for Behavior datasets it shapes the scenario generation.Option B: SDK — Create Dataset with Specification ID
Passspecification_id instead of type — the dataset type and variant are auto-derived:
Step 4: Run the Evaluation
With specifications, their metrics, and their datasets in place,galtea.evaluations.run() runs everything in one call. Pass your agent and it resolves each specification’s datasets and metrics, runs the agent on every test case, and submits the results for scoring — no manual per-test-case loop.
specifications.get_datasets():
Next Steps
Per-Test-Case Control
Drive each test case yourself when you need to choose the output and metrics per case.
AI Metric Generation
Automatically generate metrics from your specifications using AI.