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:
Response JSON Example:
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
Create Custom Policy
Endpoint: POSThttps://guardrails.aporia.com/api/v1/policies/custom_policy
Headers:
Content-Type:application/jsonAuthorization:Bearer+ Your copied Aporia API key
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.
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
The custom policy type identifier to update. Returned from
Create Custom Policy endpoint.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.
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
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