Welcome to Portkey Forum

Home
Members
mattbert
m
mattbert
Offline, last seen 7 days ago
Joined February 13, 2025
Hi everyone! I'm testing out guardrails, and am running into a problem where my guardrails are not triggered when added to the "after_request_hooks" in a config. The same guardrails are triggered when using a config that adds them to "before_request_hooks". For example, a simple regex guardrail that should fail validation if "wolf" is in the content:

This config triggers the guardrail with the user question: "Is the wolf the ancestor of the dog":
{
"retry": {
"attempts": 3
},
"before_request_hooks": [
{
"id": "pg-no-wolf-guardrail"
}
]
}

but this config does not trigger the guardrail if the LLM responds to a question with an answer that includes the word "wolf":
{
"retry": {
"attempts": 3
},
"after_request_hooks": [
{
"id": "pg-no-wolf-guardrail"
}
]
}

Are after_request guardrails not available in the free plan, or am I doing something wrong?

Thanks.
13 comments
m
s