Skip to main content

Interface: IInputRule

Defined in: internal/guardrails/types.ts:213

One rule on the prompt, before the model call.

Properties​

name​

name: string

Defined in: internal/guardrails/types.ts:215

Machine name, e.g. "moderation"; stamped on its issues as ruleName.


timeoutMs?​

optional timeoutMs?: number

Defined in: internal/guardrails/types.ts:217

Overrides IGuardrailsConfig.ruleTimeoutMs for this rule.

Methods​

check()​

check(args): Promise<IIssue[]>

Defined in: internal/guardrails/types.ts:223

Returns issues; empty array = pass. The app's rules run in parallel. A throw, or no answer within the timeout, becomes the ERROR issue rule_error (the error is logged on the server and reported to IGuardrailsConfig.onRuleError). abortSignal is aborted at the timeout.

Parameters​

args​
abortSignal​

AbortSignal

evidence​

IInputEvidence

judge​

TInputJudgeHandler

Asks a model, for rules that classify (moderation, topic scope).

Returns​

Promise<IIssue[]>