List of Guardrail Checks
Each Guardrail Check has a specific purpose, it's own parameters, supported hooks, and sources.
Partner Guardrails
Portkey has partnered with leading AI Guardrails companies Patronus AI, Aporia, and Pillar to bring their Guardrails frameworks on to the Portkey Gateway and make them available for Portkey's worldwide users.
Bring Your Own Guardrail
We have built Guardrails in a very modular way, and support bringing your own Guardrail using a custom webhook! Learn more here.
Portkey's Default Guardrail Checks
Along with the partner Guardrails, there are also deterministic as well as LLM-based Guardrails supported natively by Portkey.
Check out their details below:
Check Name | Description | Parameters | Supported Hooks |
---|---|---|---|
Regex Match | Check if the request or response text matches a regex pattern. | rule: |
|
Sentence Count | Checks if the content contains a certain number of sentences. Ranges allowed. | minSentences: |
|
Word Count | Checks if the content contains a certain number of words. Ranges allowed. | minWords: |
|
Character Count | Checks if the content contains a certain number of characters. Ranges allowed. | minCharacters: |
|
JSON Schema | Check if the response JSON matches a JSON schema. | schema: |
|
JSON Keys | Check if the response JSON contains any, all or none of the mentioned keys. | keys: |
|
Contains | Checks if the content contains any, all or none of the words or phrases. | words: |
|
Valid URLs | Checks if all the URLs mentioned in the content are valid | onlyDNS: |
|
Contains Code | Checks if the content contains code of format SQL, Python, TypeScript, etc. | format: |
|
Webhook | Makes a webhook request for custom guardrails | webhookURL: |
|
Moderate Content ( | Checks if the content passes the mentioned content moderation checks. | categories: |
|
Check Language
( | Checks if the response content is in the mentioned language. | language: |
|
Detect PII
( | Detects Personally Identifiable Information (PII) in the content. | categories: |
|
Detect Gibberish
( | Detects if the content is gibberish. |
|
|
Contribute Your Guardrail
We actively welcome Guardrail platforms to integrate their APIs with Portkey Gateway and let Portkey Gateway users use your Guardrail with Portkey's fast & reliable AI Gateway.
Last updated