Returns
Returns a Specification object for the given parameters, orNone if an error occurs.
Example
Parameters
The ID of the product this specification belongs to.
A description of the testable behavioral expectation.
The type of specification.
Possible values:
CAPABILITY, INABILITY, POLICY.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.
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 of metric IDs to link to this specification upon creation.