Ensure complex business guidelines
Policy example to ensure complex business guidelines using rubric rule
The rubric
rule is a powerful tool for enforcing complex business guidelines in AI-generated content. It allows you to define specific criteria or requirements that the AI’s output must meet. This rule is particularly useful when you need to ensure that the AI’s responses adhere to detailed company policies, brand guidelines, or specific formatting requirements.
Here’s a brief explanation of how the rubric
rule works:
- You define a set of criteria or guidelines in the
value
field of the rule. - The AI’s output is evaluated against these criteria.
- The
threshold
determines how strictly the criteria are enforced. - The rule can be set to
pass
orfail
based on whether you want to ensure compliance or detect non-compliance.
For example, in the policy provided below, the rubric
rule is used to enforce a guideline for greeting customers based on the time of day. This ensures that the AI always uses the appropriate greeting, maintaining a consistent and time-appropriate tone in customer interactions.
By using the rubric
rule, you can create highly customized policies that reflect your specific business needs and ensure that the AI’s responses always align with your company’s standards and practices.
To ensure complex guidelines, you can use the rule rubric
, for more details, see our Rules Catalog.
Rule structure:
- type:
rubric
- expected:
fail or pass
- value:
your criteria, one or many
- threshold:
0.9
means the tolerance to the criteria
Policy
- id:
unique policy id
- definition:
short description
- rules:
list of rules
- target:
input
,output
orboth
- where to check
Create the policy
Here is an example of policy to detect injection:
Next steps
- Create the policy by using the application endpoint
- Call the Evaluate API with the messages and policy id
greetings
- The API output would be a
status
being fail or pass, and the list of policy violations. You could check if the policy idgreetings
is there.