Returns
Returns a Specification object for the given parameters, orNone if an error occurs.
Example
Parameters
string
required
The ID of the product this specification belongs to.
string
required
A short, human-readable name for the specification (a few words). Shown wherever the specification is listed or referenced.
string
required
A description of the testable behavioral expectation.
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.string | TestType
The type of test for this specification. Required for
POLICY specifications, not applicable for CAPABILITY or 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.
string
Required when
test_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.
list[string]
List of metric IDs to link to this specification upon creation.