Get All Policy Templates
Endpoint: GEThttps://guardrails.aporia.com/api/v1/policies
Headers:
Content-Type:application/jsonAuthorization:Bearer+ Your copied Aporia API key
list. each object in the list contains the following fields:
string
required
The policy type.
string
required
The policy category.
string
required
The policy default_name.
string
required
Description of the policy.
Get Specific Policy Template
Endpoint: GEThttps://guardrails.aporia.com/api/v1/policies/{template_type}
Headers:
Content-Type:application/jsonAuthorization:Bearer+ Your copied Aporia API key
string
required
The type identifier of the policy template to retrieve.
string
required
The policy type.
string
required
The policy category.
string
required
The policy default name.
string
required
Description of the policy.
Create Custom Policy
Endpoint: POSThttps://guardrails.aporia.com/api/v1/policies/custom_policy
Headers:
Content-Type:application/jsonAuthorization:Bearer+ Your copied Aporia API key
string
required
The name of the custom policy.
string
required
The target of the policy - either
prompt or response.CustomPolicyConditionConfig
required
There are 2 configuration modes for custom policy - For advanced mode, the following parameters must be passed:
simple and advanced, each with it’s own condition config.For simple mode, the following parameters must be passed:- evaluation_instructions - Instructions that define how the policy should evaluate inputs.
- modality - Defines whether instructions trigger a violation if they evaluate to
TRUEorFALSE.
- system_prompt - The system prompt that will be passed to the LLM
- top_p - Top-P sampling probability, between 0 and 1. Defaults to 1.
- temperature - Sampling temperature to use, between 0 and 2. Defaults to 1.
- modality - Defines whether instructions trigger a violation if they evaluate to
TRUEorFALSE.
string
required
The custom policy type identifier.
string
required
The policy category, typically ‘custom’ for user-defined policies.
string
required
The default name for the policy template, as provided in the request.
string
required
A description of the policy based on the evaluation instructions.
Edit Custom Policy
Endpoint: PUThttps://guardrails.aporia.com/api/v1/policies/custom_policy/{custom_policy_type}
Headers:
Content-Type:application/jsonAuthorization:Bearer+ Your copied Aporia API key
string
required
The custom policy type identifier to update. Returned from
Create Custom Policy endpoint.string
required
The name of the custom policy.
string
required
The target of the policy - either
prompt or response.CustomPolicyConditionConfig
required
There are 2 configuration modes for custom policy - For advanced mode, the following parameters must be passed:
simple and advanced, each with it’s own condition config.For simple mode, the following parameters must be passed:- evaluation_instructions - Instructions that define how the policy should evaluate inputs.
- modality - Defines whether instructions trigger a violation if they evaluate to
TRUEorFALSE.
- system_prompt - The system prompt that will be passed to the LLM
- top_p - Top-P sampling probability, between 0 and 1. Defaults to 1.
- temperature - Sampling temperature to use, between 0 and 2. Defaults to 1.
- modality - Defines whether instructions trigger a violation if they evaluate to
TRUEorFALSE.
string
required
The custom policy type identifier.
string
required
The policy category, typically ‘custom’ for user-defined policies.
string
required
The default name for the policy template.
string
required
Updated description of the policy based on the new evaluation instructions.
Delete Custom Policy
Endpoint: DELETEhttps://guardrails.aporia.com/api/v1/policies/custom_policy/{custom_policy_type}
Headers:
Content-Type:application/jsonAuthorization:Bearer+ Your copied Aporia API key
string
required
The custom policy type identifier to delete. Returned from
Create Custom Policy endpoint.200 OK
Create policies for multiple projects
Endpoint: PUThttps://guardrails.aporia.com/api/v1/policies/
Headers:
Content-Type:application/jsonAuthorization:Bearer+ Your copied Aporia API key
list[UUID]
required
The project ids to create the policies in
list[Policies]
required
A list of policies to create. List of policies, each Policy has the following attributes:
policy_type (string), priority (int), condition (dict), action (dict).