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.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new GuardrailCapability(policies): GuardrailCapability;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
Returns
Section titled “Returns”GuardrailCapability
Methods
Section titled “Methods”filterInput()
Section titled “filterInput()”filterInput(_text): object;Evaluate whether an input text is permitted by this guardrail.
Returns { allowed: true } until a processor is wired in.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
Returns
Section titled “Returns”object
allowed
Section titled “allowed”allowed: boolean;reason?
Section titled “reason?”optional reason?: string;filterOutput()
Section titled “filterOutput()”filterOutput(_text): object;Evaluate whether an output text is permitted and optionally modify it.
Returns { allowed: true } until a processor is wired in.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
Returns
Section titled “Returns”object
allowed
Section titled “allowed”allowed: boolean;modified?
Section titled “modified?”optional modified?: string;getPromptSections()
Section titled “getPromptSections()”getPromptSections(): CapabilityPromptSection[];What does this capability contribute to the system prompt?
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”getTools()
Section titled “getTools()”getTools(): ToolDeclaration<unknown, unknown>[];What tools does this capability expose for the current state?
Returns
Section titled “Returns”ToolDeclaration<unknown, unknown>[]
Implementation of
Section titled “Implementation of”processToolResult()
Section titled “processToolResult()”processToolResult( _toolName, _args, _result): CapabilityAction | null;A tool was called and executed. Does this capability handle the result?
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
|
|
|
|
|
Returns
Section titled “Returns”CapabilityAction | null
An action telling the host what to do, or null if this capability doesn’t handle this tool.