Usage
Empty output detection
The gate considersctx.output empty if it is any of the following:
undefinedornull- A string containing only whitespace (or an empty string)
- An empty array (
[]) - An object with no own keys (
{})
false, 0, or a non-empty string — is treated as non-empty.
AI refusal phrase detection
The gate scans every string inctx.output for phrases that indicate the model is declining to fulfill the request rather than producing useful output. The following patterns are matched case-insensitively:
The gate returns
passed: false on the first match it finds. It does not enumerate all matching phrases.
What a failure looks like
Configuration
boolean
Fail evaluations where
ctx.output is empty, whitespace-only, an empty array, or an empty object. Defaults to true.boolean
Fail evaluations where any string in
ctx.output matches a known AI refusal or disclaimer phrase. Defaults to true.string
Override the gate name recorded in results. Defaults to
"content".