The Guardrails family contains 4 operators. Input/output filtering and cost capping.
Validates text against safety/compliance rules.
Version 1.0.0 · Semantics passthrough · Visibility advanced · Secrets OPENROUTER_API_KEY
| Field | Type | Required | Default | Description |
|---|
max_tokens | integer | no | 4096 | |
model | string | no | — | Model identifier (e.g. ‘deepseek/deepseek-r1’). |
rules | object[] | yes | — | Validation rules to apply. |
stop_sequences | string[] | no | — | |
temperature | number | no | 0.7 | |
top_p | number | no | — | |
| Port | Type | Required | Description |
|---|
input | string | yes | Input |
| Port | Type | Required | Description |
|---|
pass | boolean | no | Pass |
usage | object | no | Usage |
violations | array | no | Violations |
Compares the run’s accumulated USD spend against a hard cap. Fails or throttles when exceeded.
Version 1.0.0 · Semantics passthrough · Idempotent
| Field | Type | Required | Default | Description |
|---|
action | ”fail” | “throttle” | no | "fail" | |
current_usd | number | no | — | Explicit current spend; used when no live accumulator is wired. |
max_usd | number | yes | — | Maximum allowed spend in USD. |
| Port | Type | Required | Description |
|---|
input | any | no | Input |
| Port | Type | Required | Description |
|---|
output | object | no | Output |
Scans an input string for PII / prompt injection / jailbreak patterns and can fail, redact, or flag.
Version 1.0.0 · Semantics passthrough · Idempotent
| Field | Type | Required | Default | Description |
|---|
on_block | ”fail” | “redact” | “flag” | no | "flag" | |
rules | string[] | yes | — | Detection rule set. |
target | string | no | — | Input text to scan. Falls back to inputs.output if omitted. |
| Port | Type | Required | Description |
|---|
input | string | no | Input |
| Port | Type | Required | Description |
|---|
output | object | no | Output |
Validates an output against a JSON schema, truncates by max_tokens, and (optionally) runs an external toxicity check.
Version 1.0.0 · Semantics passthrough · Idempotent · Secrets OPENAI_API_KEY
| Field | Type | Required | Default | Description |
|---|
max_tokens | integer | no | — | Whitespace-token cap; exceeding tokens are dropped from the right. |
schema | object | no | — | Optional JSON Schema to validate the output against. |
target | string | no | — | Output to filter. Falls back to inputs.output if omitted. |
toxicity_provider | ”openai_moderation” | “none” | no | "none" | |
| Port | Type | Required | Description |
|---|
input | string | no | Input |
| Port | Type | Required | Description |
|---|
output | object | no | Output |
Every operator above is rendered from its JSON schema in /opt/glyph/schemas/operators/:
schemas/operators/guardrails.check.json
schemas/operators/guardrails.cost_cap.json
schemas/operators/guardrails.input_filter.json
schemas/operators/guardrails.output_filter.json