default plugin ships with the AI Gateway and requires no additional credentials or configuration. Reference each function by the ID default.<functionId>.
beforeRequestHook run on the input (place in input_guardrails). Hooks listed as afterRequestHook run on the output (place in output_guardrails). Some functions support both.Text matching
default.regexMatch — Regex Match
default.regexMatch — Regex Match
beforeRequestHook, afterRequestHooktrue, the verdict is inverted — passes when the pattern does not match.default.contains — Contains
default.contains — Contains
default.endsWith — Ends With
default.endsWith — Ends With
beforeRequestHook, afterRequestHooktrue, the verdict is inverted — passes when the content does not end with the suffix.default.alluppercase — Uppercase Check
default.alluppercase — Uppercase Check
beforeRequestHook, afterRequestHooktrue, the verdict is inverted — passes when content is not all uppercase.default.alllowercase — Lowercase Check
default.alllowercase — Lowercase Check
beforeRequestHook, afterRequestHooktrue, the verdict is inverted — passes when content is not all lowercase.Length checks
default.wordCount — Word Count
default.wordCount — Word Count
beforeRequestHook, afterRequestHooktrue, the verdict is inverted — passes when the count is outside the range.default.sentenceCount — Sentence Count
default.sentenceCount — Sentence Count
beforeRequestHook, afterRequestHooktrue, the verdict is inverted — passes when the count is outside the range.default.characterCount — Character Count
default.characterCount — Character Count
beforeRequestHook, afterRequestHooktrue, the verdict is inverted — passes when the count is outside the range.JSON validation
default.jsonSchema — JSON Schema
default.jsonSchema — JSON Schema
afterRequestHooktrue, the verdict is inverted — passes when the schema does not match.default.jsonKeys — JSON Keys
default.jsonKeys — JSON Keys
URL and code checks
default.validUrls — Valid URLs
default.validUrls — Valid URLs
afterRequestHooktrue, only checks that each URL’s domain resolves via DNS (much faster than full HTTP checks).true, the verdict is inverted — passes when URLs are not all valid.default.containsCode — Contains Code
default.containsCode — Contains Code
afterRequestHookSQL, Python, TypeScript, JavaScript, Java, C#, C++, C, Ruby, PHP, Swift, Kotlin, Go, Rust, Scala, R, Perl, Shell, HTML, CSS, XML, JSON, YAML, Markdown, Dockerfile.true, the verdict is inverted — passes when code is not present.Request and model controls
default.allowedRequestTypes — Allowed Request Types
default.allowedRequestTypes — Allowed Request Types
beforeRequestHookblockedTypes, blocked types take precedence. Can also be specified in request metadata as supported_endpoints.Possible values: complete, chatComplete, embed, rerank, moderate, stream-complete, stream-chatComplete, stream-messages, proxy, imageGenerate, createSpeech, createTranscription, createTranslation, realtime, uploadFile, listFiles, retrieveFile, deleteFile, retrieveFileContent, createBatch, retrieveBatch, cancelBatch, listBatches, getBatchOutput, listFinetunes, createFinetune, retrieveFinetune, cancelFinetune, createModelResponse, getModelResponse, deleteModelResponse, listResponseInputItems, messages.allowedTypes. Can also be specified in request metadata as blocked_endpoints.default.modelwhitelist — Allowed Models
default.modelwhitelist — Allowed Models
beforeRequestHookgpt-4o, llama-3-70b, mixtral-8x7b.true, any model in the list is blocked instead of allowed.default.modelRules — Model Rules
default.modelRules — Model Rules
beforeRequestHookdefaults defines the fallback allowed model list. metadata maps metadata key-value pairs to specific model lists.true, any model resolved by the rules is blocked instead of allowed.Security and authentication
default.jwt — JWT Validation
default.jwt — JWT Validation
beforeRequestHookAuthorization).exp and iat claims.1d, 2h, 30m).default.requiredMetadataKeys — Required Metadata Keys
default.requiredMetadataKeys — Required Metadata Keys
user_id and session_id.Supported hooks: beforeRequestHookall, any, or none.Webhooks and logging
default.webhook — Webhook
default.webhook — Webhook
verdict boolean.Supported hooks: beforeRequestHook, afterRequestHookhttps://webhook.site/guardrail.default.log — Log
default.log — Log
true as the verdict — this function never blocks traffic.Supported hooks: afterRequestHookhttps://logging.site/collector.Response quality
default.notNull — Not Null
default.notNull — Not Null
afterRequestHooktrue, the verdict is inverted — passes when the content is null or empty.Transformers
Transformers mutate the request or response rather than returning a pass/fail verdict. They run inbeforeRequestHook and modify the prompt before it reaches the LLM.
default.addPrefix — Add Prefix
default.addPrefix — Add Prefix
beforeRequestHook"Please respond helpfully and accurately to the following: ".user, system, or assistant.true, prepends the prefix to the existing message content. When false, inserts a new message with only the prefix text.