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.QUALITY(alsoACCURACY): Evaluates whether the AI provides factually correct responses.RED_TEAMING(alsoSECURITY): Tests for vulnerabilities, jailbreaks, and harmful outputs.SCENARIOS(alsoBEHAVIOR): Simulates real user interactions to evaluate behavior in context.
Required when
test_type is QUALITY or RED_TEAMING. Not applicable for SCENARIOS, CAPABILITY, or INABILITY.- For
QUALITY: the AI task type the policy governs —rag,summarization,entity_extraction,classification,translation,correction,other. - For
RED_TEAMING: 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.