> ## Documentation Index
> Fetch the complete documentation index at: https://docs.galtea.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Specification

> A testable behavioral expectation for a product

## What is a Specification?

A Specification in Galtea represents a single, testable behavioral expectation for a product. Examples include *"Must decline political questions"*, *"Can answer questions about phone specifications"*, or *"Always includes a disclaimer when giving financial advice"*.

Each specification has a **type** that classifies the kind of behavioral expectation:

* **Capability**: A core function the product can perform — what the product is designed to accomplish or deliver. For example: *"Can classify images as containing cats or dogs"*, *"Can retrieve and display the user's account balance"* (conversational), or *"Can generate personalized product recommendations based on browsing history"*.

* **Inability**: An action or task the product is fundamentally unable to do even if a malicious actor gained full control over it. These represent hard technical constraints where the infrastructure, system access, or architecture simply does not exist. For example: *"Cannot execute wire transfers"* (no payment gateway connected) or *"Cannot access other customers' data"* (no system integration exists).

* **Policy**: A mandatory rule or guideline the product must follow — from restrictions to behavioral guidelines. This includes refusal rules (what it must decline), interaction patterns (how it responds), communication style, and mandatory disclaimers. For example: *"Must include a disclaimer when discussing medical topics"* or *"Refuses requests to share confidential business data"*.

Specifications also have a **test type** that determines the evaluation approach: `ACCURACY`, `SECURITY`, or `BEHAVIOR`.

<Note>Specifications replace the legacy free-text fields (Capabilities, Inabilities, Policies) on Products with structured, individually testable expectations linked to specific metrics.</Note>

<video autoPlay muted loop playsInline className="w-full aspect-video rounded-xl" src="https://mintcdn.com/galtea/dyF29XMGyYjp0rSG/videos/specifications-overview.mp4?fit=max&auto=format&n=dyF29XMGyYjp0rSG&q=85&s=f1c8fc6576a771de007a45007c0d51ae" data-path="videos/specifications-overview.mp4" />

## The Specification-Driven Workflow

Specifications are at the center of Galtea's recommended evaluation flow:

1. **Define specifications** for your product (Capability, Inability, Policy)
2. **Generate metrics** from specifications using [AI Metric Generation](/concepts/metric/ai-generation)
3. **Create tests** from specifications — the test type is auto-derived
4. **Run evaluations** with `evaluations.run()` — resolves specs, tests, and metrics automatically

<Note>
  When creating or editing a specification in the dashboard, you have two AI assistance options. **Fill with AI** opens a dialog where you describe the behavior in a rough note and the AI rewrites it into a properly written specification description, then auto-fills the type, test type, and variant. **Complete with AI** classifies a description you have already written, suggesting the type, test type, and variant without changing the text. Review and edit the AI suggestions before saving — nothing is persisted until you submit the form.
</Note>

<Card title="Specification-Driven Evaluations Tutorial" icon="rocket" href="/sdk/tutorials/specification-driven-evaluations">
  End-to-end guide: define specs, generate metrics, create tests, and run evaluations — all from specifications.
</Card>

## Keeping Specifications Up to Date

As your product evolves, its documentation — PRDs, design docs, spec sheets — often changes before its specifications do. The `POST /products/{id}/regenerate-config` endpoint lets you cross-check an uploaded document against a product's existing specifications and receive classified suggestions without persisting anything.

Each suggestion carries a `status`:

* `new` — a candidate specification extracted from the document that has no match among the product's existing specifications.
* `updated` — a candidate that refines or extends an existing specification (includes a reference to the existing spec).
* `contradictory` — a candidate that conflicts with an existing specification (includes a reference to the existing spec).

The endpoint **persists nothing**. Applying a suggestion — creating a new specification, updating an existing one, or removing a contradicted one — is a separate, explicit step using the standard specification endpoints in the [REST API](/api-reference). This means nothing changes without your confirmation and unaffected specifications remain untouched.

<Info>
  The dashboard flow for reviewing and applying suggestions is tracked in a follow-up. In the meantime the endpoint is available via the [REST API](/api-reference) and the CLI (`galtea products regenerate-config`).
</Info>

## SDK Integration

The SDK allows you to create, list, retrieve, and delete specifications, as well as link and unlink metrics. See the [Specification Service API documentation](/sdk/api/specification/service) for more details.

<Card title="Specification Service" icon="code" iconType="solid" href="/sdk/api/specification/service">
  Manage specifications programmatically
</Card>

## Specification Properties

<ResponseField name="id" type="string">
  Unique identifier of the specification.
</ResponseField>

<ResponseField name="product_id" type="string" required>
  The ID of the product this specification belongs to.
</ResponseField>

<ResponseField name="description" type="string" required>
  A description of the testable behavioral expectation.
  **Example**: "Must decline political questions and redirect the user to authoritative sources."
</ResponseField>

<ResponseField name="type" type="Enum" required>
  The type of specification.
  Possible values: `CAPABILITY`, `INABILITY`, `POLICY`.
</ResponseField>

<ResponseField name="test_type" type="Enum" optional>
  The type of test for this specification.
  Possible values: `ACCURACY`, `SECURITY`, `BEHAVIOR`.
  <Note>Required for `POLICY` specifications. Must not be provided for `CAPABILITY` or `INABILITY` specifications.</Note>
</ResponseField>

<ResponseField name="test_variant" type="string" optional>
  Variant of the test type. Applicable for `ACCURACY` and `SECURITY` test types.
</ResponseField>

<ResponseField name="metric_ids" type="list[string]" optional>
  List of metric IDs linked to this specification.
</ResponseField>

<ResponseField name="created_at" type="string">
  Timestamp of when the specification was created (ISO 8601 format).
</ResponseField>

## Related

<CardGroup cols={2}>
  <Card title="Concepts overview" icon="diagram-project" iconType="solid" href="/concepts/overview">
    How Galtea's concepts connect — diagram + per-entity quick reference.
  </Card>

  <Card title="Product" icon="box" iconType="solid" href="/concepts/product">
    A functionality or service being evaluated
  </Card>

  <Card title="Metric" icon="gauge" iconType="solid" href="/concepts/metric">
    Ways to evaluate and score product performance
  </Card>
</CardGroup>
