> ## 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.

# Create Specification

> Create a specification for a product.

> [!WARNING]
>
> You are reading the docs of Galtea 5.11. [Read this page in the latest version](https://docs.galtea.ai/sdk/api/specification/create.md).

## Returns

Returns a [Specification](https://docs.galtea.ai/v5.11/concepts/product/specification.md) object for the given parameters, or `None` if an error occurs.

## Example

```python theme={"system"}
# POLICY specification — dataset_type and test_variant are required for ACCURACY and SECURITY
specification = galtea.specifications.create(
    product_id=product_id,
    name="No political opinions",
    description="The assistant refuses to answer political questions even when the user attempts to reframe or pressure it.",
    type="POLICY",
    dataset_type="SECURITY",
    test_variant="misuse",
)

# CAPABILITY specification — dataset_type is assigned automatically (always BEHAVIOR), so it's omitted here
capability_spec = galtea.specifications.create(
    product_id=product_id,
    name="Show account balance",
    description="The assistant accurately retrieves and displays the user's current account balance when asked.",
    type="CAPABILITY",
)
```

## Parameters

**product\_id** `string` *required*

The ID of the product this specification belongs to.

**name** `string` *required*

A short, human-readable name for the specification (a few words). Shown wherever the specification is listed or referenced.

**description** `string` *required*

A description of the testable behavioral expectation.

**type** `string | SpecificationType` *required*

The type of specification.
Possible values: `CAPABILITY`, `INABILITY`, `POLICY`. Other string values are sent to the API unchanged, so values added in newer API versions can be used; the API rejects invalid ones.

**dataset\_type** `string | DatasetType`

The type of dataset for this specification. Required for `POLICY` specifications. For `CAPABILITY` specifications it is
always `BEHAVIOR`, assigned automatically — omit it or pass `BEHAVIOR` explicitly. Not applicable for `INABILITY`.

* `ACCURACY`: Evaluates whether the AI provides factually correct responses.
* `SECURITY`: Tests for vulnerabilities, jailbreaks, and harmful outputs.
* `BEHAVIOR`: Simulates real user interactions to evaluate behavior in context.

**test\_variant** `string`

Required when `dataset_type` is `ACCURACY` or `SECURITY`. Not applicable for `BEHAVIOR`, `CAPABILITY`, or `INABILITY`.

* For `ACCURACY`: the AI task type the policy governs — `rag`, `summarization`, `entity_extraction`, `classification`, `translation`, `correction`, `other`.
* For `SECURITY`: the threat category the policy addresses — `data_leakage`, `financial_attacks`, `illegal_activities`, `misuse`, `toxicity`, `custom`.

**metric\_ids** `list[string]`

List of metric IDs to link to this specification upon creation.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.