Interface: IRuleErrorReport
Defined in: internal/guardrails/types.ts:341
Everything the Guardrails know about one failed rule. Written for the developer, so nothing is held back; the caller of the
gateway gets only issue.
Handed to IGuardrailsConfig.onRuleError by the Guardrails, once per failed rule, right after the failure became the issue.
Properties
at
at:
Date
Defined in: internal/guardrails/types.ts:375
When the failure was recorded.
durationMs
durationMs:
number
Defined in: internal/guardrails/types.ts:373
Time from the start of the rule to the failure.
error?
optionalerror?:unknown
Defined in: internal/guardrails/types.ts:355
The error as the rule threw it, untouched; undefined when the rule timed out.
evidence
evidence:
IInputEvidence|IOutputEvidence
Defined in: internal/guardrails/types.ts:363
What the rule was checking: an IInputEvidence on the INPUT stage, an IOutputEvidence on the OUTPUT stage.
failure
failure:
ERuleFailure
Defined in: internal/guardrails/types.ts:353
How the rule failed.
issue
issue:
IIssue
Defined in: internal/guardrails/types.ts:361
The ERROR issue rule_error the caller got for this failure.
The key into the rest of the record: the response's
issuesand the annotated judge trace entries carry it (D73).
ruleName
ruleName:
string
Defined in: internal/guardrails/types.ts:351
The rule's name, as on issue.ruleName.
stage
stage:
ERuleStage
Defined in: internal/guardrails/types.ts:349
Which check the rule belongs to; it tells which evidence evidence is.
tenantId
tenantId:
string
Defined in: internal/guardrails/types.ts:343
Tenant of the call.
threadId?
optionalthreadId?:string
Defined in: internal/guardrails/types.ts:347
Thread of the call; undefined for the input check of a call that creates a new thread (it does not exist yet).
timeoutMs
timeoutMs:
number
Defined in: internal/guardrails/types.ts:371
The timeout the rule ran under, its own or the default.
traceIds
traceIds:
string[]
Defined in: internal/guardrails/types.ts:369
The trace entries of the judge calls this rule made before it failed (kind GUARDRAIL_JUDGE).
A judge that answered out of shape: the entry holds the request and the model's answer.
userContext
userContext:
IUserContext
Defined in: internal/guardrails/types.ts:345
Who was calling.