Skip to content

GuardrailCapability

Injects policy text into the system prompt as ‘policy’ sections. Optionally filters input/output text — currently a passthrough placeholder that future processor integration can populate.

new GuardrailCapability(policies): GuardrailCapability;
Parameter Type

policies

string[]

GuardrailCapability

filterInput(_text): object;

Evaluate whether an input text is permitted by this guardrail. Returns { allowed: true } until a processor is wired in.

Parameter Type

_text

string

object

allowed: boolean;
optional reason?: string;

filterOutput(_text): object;

Evaluate whether an output text is permitted and optionally modify it. Returns { allowed: true } until a processor is wired in.

Parameter Type

_text

string

object

allowed: boolean;
optional modified?: string;

getPromptSections(): CapabilityPromptSection[];

What does this capability contribute to the system prompt?

CapabilityPromptSection[]

Capability.getPromptSections


getTools(): ToolDeclaration<unknown, unknown>[];

What tools does this capability expose for the current state?

ToolDeclaration<unknown, unknown>[]

Capability.getTools


processToolResult(
_toolName,
_args,
_result): CapabilityAction | null;

A tool was called and executed. Does this capability handle the result?

Parameter Type

_toolName

string

_args

unknown

_result

unknown

CapabilityAction | null

An action telling the host what to do, or null if this capability doesn’t handle this tool.

Capability.processToolResult