Guardrails page
The Guardrails page is where you create and manage the guardrails that screen requests, responses and MCP tool calls on the gateway. Open it at /ui/guardrails. It sits under AI Gateway in the left nav as Guardrails, between Skills and Policies.
The nav item has no role list, so every signed in role sees it. For roles that are not admins, the Internal User Page Visibility setting on the Admin Settings page still applies, and the item is hidden when that list is set and does not include it. The page has no guard of its own. What you see inside depends on your session role. A proxy admin (session role Admin) gets four tabs, Guardrail Garden, Guardrails, Test Playground and Submitted Guardrails, and the page opens on Guardrails. Every other role, including Admin Viewer, Org Admin, Internal User and Internal Viewer, gets only the Submitted Guardrails tab. No license feature is checked by the page. One provider, Hide Secrets, needs a Spanway Enterprise license on the proxy. The form does not show a lock for it, so without a license Create Guardrail fails with the 403 license message and nothing is stored.
On the backend, creating, updating and deleting a guardrail, testing custom code, and approving or rejecting a team submission all require the proxy_admin role. A view only admin sees only the Submitted Guardrails tab, without the approval buttons, and the gateway refuses those requests for that role too.
A real-world scenario
A hospital's chat app must never send patient names or phone numbers to a model provider. The admin creates a Presidio PII guardrail that masks them before every call, tests it on a sample sentence, and attaches it to the clinical team so every key of the team is covered.
Steps
-
Open Guardrails under AI Gateway, or go to
/ui/guardrails, click Add New Guardrail and choose Add Provider Guardrail. -
On Basic Info type
pii-maskas Guardrail Name, pick Presidio PII under Guardrail Provider, pick the pre call mode, then click Next, choose the entities to mask on PII Configuration, and click Create Guardrail. The same with the API:curl -X POST http://localhost:4000/guardrails \-H "Authorization: Bearer $SPANWAY_MASTER_KEY" -H "Content-Type: application/json" \-d '{"guardrail": {"guardrail_name": "pii-mask", "spanway_params": {"guardrail": "presidio", "mode": "pre_call"}}}' -
Test it on a sentence without calling a model.
curl -X POST http://localhost:4000/guardrails/apply_guardrail \-H "Authorization: Bearer $SPANWAY_MASTER_KEY" -H "Content-Type: application/json" \-d '{"guardrail_name": "pii-mask", "text": "Call Jane Doe at 555-0100"}' -
Attach it to the team on the team's Settings tab on Teams, as in the guardrails quick start.
Expected result
"Guardrail created successfully" shows, the test returns the sentence with the name and number masked, and the team's requests reach the model with the same masking.
Guardrails tab
This tab lists every guardrail the proxy knows about, both the ones stored in the database and the ones defined in the proxy config file.
| Control | Type | What it does |
|---|---|---|
| Add New Guardrail | Dropdown button | Opens a menu with Add Provider Guardrail (the Create guardrail dialog) and Create Custom Code Guardrail (the custom code editor). Disabled until the session token is loaded. If a guardrail detail view is open, it closes first. |
| Table | Table | One row per guardrail, sorted by Created At, newest first. Sorting and paging happen in the browser. |
| Column | Meaning |
|---|---|
| Guardrail ID | The guardrail's ID. Click it to open the detail view. Sortable. |
| Name | The guardrail name, or a dash when it has none. Sortable. |
| Provider | The provider logo and display name. When the UI does not know the provider key, it shows the raw key. |
| Mode | The modes the guardrail runs in, separated by commas. A tag based mode shows the modes followed by (tag-based). |
| Default On | A Default On or Default Off badge. A guardrail that is default on runs on every request without being attached to a key or team. |
| Created At, Updated At | Timestamps. Sortable. |
| Row menu | The menu has one item, Delete. It is disabled for guardrails defined in the config file, with the hint "Config guardrails are defined in the config file and cannot be deleted from the dashboard." |
The detail view's URL carries the guardrail ID as the guardrail query parameter, so you can link to it and the browser back button closes it.
Delete Guardrail dialog
Choosing Delete opens a confirmation dialog titled Delete Guardrail. It asks whether you are sure you want to delete the named guardrail, warns "This action cannot be undone.", and lists the Name, ID, Provider, Mode and Default On values. Delete removes the guardrail from the database and from the running proxy immediately. There is no undo. The dialog does not check whether keys, teams or policies still refer to the guardrail by name. Cancel closes the dialog without changes.
Create guardrail dialog
Add Provider Guardrail, and Create Guardrail on a Guardrail Garden card, open the Create guardrail dialog. It is a vertical stepper. Clicking outside the dialog does not close it. Closing it with Cancel or the close button in the header discards everything you entered. A finished step shows a check mark and an Edit link, and clicking its title takes you back to it.
The steps depend on the provider you pick.
| Provider | Steps |
|---|---|
| Spanway Content Filter | Basic Info, Topics, Patterns, Keywords, Endpoint Settings (Optional) |
| Presidio PII | Basic Info, PII Configuration |
| Decision Model | Basic Info, Decision Model Configuration |
| Every other provider | Basic Info, Provider Configuration |
The bottom bar has Cancel, Previous (from the second step on), Next, and Create Guardrail on the last step. Next on Basic Info checks that the name, provider and mode are filled. Create Guardrail shows "Guardrail created successfully" and refreshes the list, or "Failed to create guardrail" with the server's message.
When the dialog opens, the UI loads the guardrail settings, the per provider fields, the list of models and the model hub. If the settings or fields fail to load, it shows "Failed to load guardrail configuration".
Basic Info step
| Control | Type | What it does |
|---|---|---|
| Guardrail Name | Text, required | The guardrail's name. Keys, teams and policies refer to the guardrail by this name. Placeholder "Enter a name for this guardrail". |
| Guardrail Provider | Searchable dropdown, required | The provider. Each option shows the provider logo when the UI has one. Typing filters by label. Decision Model also matches searches such as "prompt injection" and "jailbreak". Changing the provider clears provider specific values, PII selections, content filter selections, tool rules and decision questions, and drops modes the new provider does not support. |
| Mode | Multi-select, required | When the check runs: pre_call before the model sees the prompt, post_call on the reply, during_call beside the model call, logging_only after the reply for the logs. The options are the modes the selected provider supports, or every mode when the proxy reports no list for that provider. Defaults to pre_call. Picking Spanway LLM as a Judge sets it to post_call. |
| Request shape | One dropdown per selected mode | Each is labelled with the mode name followed by "applies to". Choose Streaming and non-streaming (default), Streaming only or Non-streaming only. Only non default choices are saved. |
| Always On | Yes or No | Saved as default_on. Yes runs this check on every request from every key, which is the simple way to protect everyone at once. No, the default, runs it only where you attach it to a key, team or policy, or where a request names it. |
| Skip system messages in guardrail | Dropdown | Use global default (default), Yes to leave system prompts out of what this guardrail checks, which saves cost when the system prompt is your own trusted text, or No to check them too. The model always receives the full messages. Applies to guardrails that read OpenAI chat and Anthropic messages. Use global default follows spanway_settings.skip_system_message_in_guardrail, which is off unless an admin turned it on. |
| Skip tool messages in guardrail | Dropdown | The same three choices for tool results. Yes saves cost when tools return large trusted data, No also catches harmful text a tool returned. Use global default follows spanway_settings.skip_tool_message_in_guardrail, which is off by default. |
| Logging only scope | Dropdown | Shown only when logging_only is a selected mode. Default (request and response), Input only (request) or Output only (response). Providers that cannot scan one direction only offer just the default. Observe only scans never block. pre_call and post_call on the same guardrail still block. |
| Continue observing the response after a flagged request | Switch | Shown with Logging only scope. When on, a flagged or failing request scan is logged and the response is still scanned. Disabled when the scope is input only or output only. |
| Provider fields | Varies | The top level fields of the selected provider, described in the provider reference below. Not shown for Spanway Content Filter, Spanway LLM as a Judge, Decision Model and the tool permission guardrail, which have their own steps. |
The available modes are these.
| Mode | Description shown in the dropdown |
|---|---|
pre_call | Before LLM Call. Runs before the LLM call and checks the input (Recommended). |
during_call | During LLM Call. Runs in parallel with the LLM call, with the response held until the check completes. |
post_call | After LLM Call. Runs after the LLM call and checks only the output. |
logging_only | Logging Only. Only runs on logging callbacks without affecting the LLM call. |
pre_mcp_call | Before MCP Tool Call. Runs before MCP tool execution and validates tool calls. |
during_mcp_call | During MCP Tool Call. Runs in parallel with MCP tool execution for monitoring. |
post_mcp_call | After MCP Tool Call. Runs after MCP tool execution and checks the tool result. |
realtime_input_transcription | No description. Only offered for providers that support it, such as Spanway Content Filter. |
Provider Configuration step
For most providers this step shows Optional Parameters, one card per field from the provider's optional parameter group. Each card shows the field name, its description, and an input chosen by the field type. A dictionary field with a fixed set of keys shows Select category to configure, which adds one value input per key you pick, each with a Remove button. When the provider has no optional parameters, the step is empty and you can go straight to Create Guardrail.
For the tool permission guardrail, Spanway LLM as a Judge and Decision Model, the step shows the dedicated editors described below.
PII Configuration step (Presidio PII)
The step is titled Configure PII Protection and shows how many entity types are selected.
| Control | Type | What it does |
|---|---|---|
| Filter by category | Multi-select | Narrows the entity list to the chosen PII categories. |
| Select All & Mask | Button | Selects every entity with the action MASK. |
| Select All & Block | Button | Selects every entity with the action BLOCK. |
| Unselect All | Button | Clears the selection. Disabled when nothing is selected. |
| Entity list | Checkbox rows | Columns PII Type and Action. Each row shows the entity name and its category badge. The Action dropdown (MASK or BLOCK) is enabled once the entity is selected and defaults to MASK. |
Next is refused with "Please select at least one PII entity to continue" until at least one entity is selected. The Presidio analyzer and anonymizer base URLs, if needed, are entered on the Basic Info step.
Content filter steps (Spanway Content Filter)
Topics holds two cards.
Blocked topics lets you pick content categories that are blocked with keyword and semantic analysis. Choose a category in Select a content category and click Add. Before you add it, a preview box shows the category's YAML or JSON definition, or "Unable to load category content" if it cannot be fetched. Added categories appear in a table with columns Category, Action (Block or Mask), Severity Threshold (High, Medium or Low, default Medium) and a Remove button. Each added category can be expanded to view its content. With nothing added, the card says "No blocked topics selected. Add topics to detect and block harmful content."
Competitor Intent Filter is off by default. Turning its switch on shows these fields.
| Control | Type | What it does |
|---|---|---|
| Type | Dropdown | Airline (load competitors from the brand list) (default) or Generic (specify competitors manually). The brand list comes from GET /guardrails/ui/competitor_brands, which serves a short fictional sample list unless the SPANWAY_COMPETITOR_BRANDS_FILE environment variable on the gateway names your own list in the same format. |
| Your Brand (brand_self) | Tag input | The names and codes users use for your brand. With the airline type you can pick a brand from the list, which adds all its name variants and excludes it from competitors, or type a custom term. Required for the filter to be saved. |
| Locations (optional) | Tag input | Airline type only. Countries, cities or airports used for disambiguation. |
| Competitors | Tag input | Generic type only. The competitor names to detect. |
| Competitor comparison policy | Dropdown | Refuse (block request) (default) or Reframe (suggest alternative). |
| Possible competitor comparison policy | Dropdown | Refuse (block request) or Reframe (suggest alternative to backend LLM) (default). |
| Confidence thresholds | Three number inputs | High, Medium and Low, each between 0 and 1 in steps of 0.05, with defaults 0.7, 0.45 and 0.3. At or above High the request is treated as a full competitor comparison. At or above Medium it is a possible comparison. At or above Low it is only logged. Below Low nothing happens. |
Patterns shows Pattern Detection. Add prebuilt pattern opens a dialog with Pattern type (a searchable list of prebuilt patterns) and Action (Block or Mask, default Block). Add custom regex opens Add custom regex pattern with Pattern name, Regex pattern and Action. Both name and regex are required. Added patterns are listed with columns for the type (Prebuilt or Custom), Pattern name, Regex pattern, Action and a remove button. With none added the table says "No patterns added."
Keywords shows Blocked Keywords. Add keyword opens Add blocked keyword with Keyword (required), Action (Block or Mask, default Block) and Description (optional). The table lists Keyword, Action and Description. Upload YAML file accepts a .yaml or .yml file and has the proxy validate it. It shows "File uploaded successfully" or "Validation failed" with the reason. The keywords in a valid file are added to the Blocked Keywords table with their action and description, after any keywords already listed.
Endpoint Settings (Optional) configures a call type. The only Call type is /v1/realtime. Picking it shows a collapsible /v1/realtime settings section with End session after X violations (a number of at least 1, empty means never), On violation (Warn, where the bot speaks the message and the session continues, or End session, where the bot speaks the message and the connection closes) and Message the user hears (falls back to the default violation message when empty).
Create Guardrail is refused with "Please configure at least one content filter setting (category, pattern, keyword, or competitor intent)" when nothing is configured.
Spanway LLM as a Judge
The Provider Configuration step shows these fields.
| Control | Type | What it does |
|---|---|---|
| Judge Model | Searchable dropdown, required | The model on this proxy that grades the request (pre_call, during_call) or the response (post_call). |
| Minimum Score to Pass | Number, 0 to 100 | Default 80. When the weighted average of the criterion scores falls below it, the guardrail triggers. |
| On Failure | Dropdown | Block (return 422) (default) or Log only. |
| Evaluation Criteria | List | Each criterion has a name, a weight in percent and a description of what to check, all required. Add Criterion adds one. The trash button removes one. A line under the list shows Weights total and turns green when the weights add up to 100. |
Create Guardrail is refused with "Add at least one evaluation criterion" or "Criterion weights must sum to 100% (currently N%)".
Decision Model
The Decision Model Configuration step shows these fields.
| Control | Type | What it does |
|---|---|---|
| Decision Model | Searchable dropdown, required | A decisions model on this proxy that scores every question. Only model groups in decisions or evaluation mode from a supported decisions provider are listed. When there are none, a No decision models yet notice links to Add a model. |
| Questions | List | Each question has a Name, the question text, an action (Block or Log only, default Block) and a probability threshold slider from 0 to 1 (default 0.7). Add question adds one. A question whose probability reaches its threshold blocks the call, or is recorded when set to Log only. |
| Test | Text box and Run test | Scores a sample input against the current model and questions with a real call to /v1/decisions, which the decisions provider bills. Ctrl or Cmd plus Enter runs it. Results are listed newest first with a Block or Pass badge per run and one badge per question showing its score. A run whose model or questions changed afterwards says to run it again. |
Next and Create Guardrail are refused with "Add at least one question", "Give every question a name and a question, or remove it" or "Each question needs a different name".
Tool permission rules
The tool permission guardrail is listed as Spanway Tool Permission Guardrail. Its configuration step is a rules editor.
| Control | Type | What it does |
|---|---|---|
| Add Rule | Button | Adds a rule with a generated ID and the decision Allow. |
| Rule ID | Text | The rule's unique ID. |
| Tool Name (optional) | Text | A regular expression matched against the tool name. |
| Tool Type (optional) | Text | A regular expression matched against the tool type. |
| Decision | Dropdown | Allow or Deny. |
| Restrict tool arguments (optional) | Button | Adds argument constraints. Each constraint is a dot or array path into the arguments and a regular expression. Add another constraint adds more, and the trash button removes one. |
| Remove | Button | Removes the rule. |
| Default action | Dropdown | What happens when no rule matches. Deny by default. |
| On disallowed action | Dropdown | Block (default) returns an error when a forbidden tool is invoked. Rewrite strips the tool call and lets the rest of the response continue. |
| Violation message (optional) | Text area | The message returned when a tool is blocked. |
Rules are checked in order. Create Guardrail is refused with "Add at least one tool permission rule" when the list is empty.
Provider reference
Apart from the dedicated editors above, the fields come from the proxy at /guardrails/ui/provider_specific_params, so the form always matches the providers your proxy build supports. Each field is labelled with its parameter name and has a help icon whose tooltip is the description, which is also the placeholder. A field is required only when the table says so. Only fields with a value are sent. Secret fields are password inputs, masked as you type, when the field name contains password, passwd, secret, key, token, credential, authorization or cookie. Many providers fall back to an environment variable on the proxy when a field is left empty, and the tables note the variable.
The input types work like this. Text is a single line input. Number is a numeric input. True or False is a dropdown. Dropdown and Multi-select offer fixed options. JSON is a text area that must hold a JSON object and is checked when you leave it. Slider runs between the field's minimum and maximum. A list field (shown as Text below) has no list editor and takes a single line of text.
Fields listed under "Optional parameters" appear on the Provider Configuration step. All other fields appear on Basic Info.
Presidio PII
Modes pre_call, during_call, post_call, logging_only, pre_mcp_call, post_mcp_call.
| Field | Required | Input | Default | What it sets |
|---|---|---|---|---|
presidio_analyzer_api_base | No | Text | Presidio analyzer base URL. | |
presidio_anonymizer_api_base | No | Text | Presidio anonymizer base URL. | |
presidio_filter_scope | No | Dropdown input, output, both | Where the checks apply. | |
output_parse_pii | No | True or False | Restore the original text in the response. | |
presidio_language | No | Text | en | Language code used for analysis. |
Bedrock Guardrail
Modes pre_call, post_call, during_call, pre_mcp_call, during_mcp_call.
| Field | Required | Input | Default | What it sets |
|---|---|---|---|---|
guardrailIdentifier | No | Text | The AWS Bedrock guardrail ID. Needed unless inline checks are used. | |
guardrailVersion | No | Text | The guardrail version, such as DRAFT or a number. | |
disable_exception_on_block | No | True or False | false | Do not raise an error on a block. |
aws_region_name | No | Text | AWS region of the guardrail. | |
aws_access_key_id | No | Secret text | AWS access key ID. | |
aws_secret_access_key | No | Secret text | AWS secret access key. | |
aws_session_token | No | Secret text | Session token for temporary credentials. | |
aws_session_name, aws_profile_name, aws_role_name | No | Text | Session name, credentials profile and role to assume. | |
aws_web_identity_token | No | Secret text | Web identity token for role assumption. | |
aws_sts_endpoint, aws_external_id, aws_bedrock_runtime_endpoint | No | Text | STS endpoint, external ID for the role trust policy, and Bedrock runtime endpoint. | |
checks | No | Group | Inline content filter, prompt attack and sensitive information categories. The form shows these sub fields but does not send them, so set inline checks in the config file. | |
content_filter_threshold, prompt_attack_threshold, pii_confidence_threshold | No | Number | 0.5 | Block when the severity or confidence reaches this value. Empty means detect only. |
chunk_budget_chars | No | Number | 25000 | Batch size used when AWS rejects a request as too large. |
contextual_grounding_from_messages | No | True or False | false | Send system and user messages as the grounding source and query. |
streaming_buffer_until_moderated | No | True or False | true | Hold streamed chunks until the end of stream scan passes. |
streaming_sampling_rate | No | Number | 5 | Scan the accumulated response every Nth chunk when not buffering. |
streaming_end_of_stream_only | No | True or False | false | Skip sampling and scan once at the end of the stream. |
streaming_buffer_release_on_scan | No | True or False | false | Release buffered chunks after each passing sampled scan. |
Lakera
Modes pre_call, during_call, post_call.
| Field | Required | Input | Default | What it sets |
|---|---|---|---|---|
api_key | No | Secret text | Lakera API key. | |
api_base | No | Text | Lakera API base URL. | |
project_id | No | Text | Lakera project ID. | |
payload, breakdown, dev_info | No | True or False | true | Include the payload, breakdown and developer info in the response. |
metadata | No | JSON | Extra request metadata. | |
on_flagged | No | Dropdown block, monitor, inject_system_message | block | Block, only log, or inject an advisory system message. |
advisory_system_message | No | Text | Template for inject_system_message. Must contain {reason}. |
Hide Secrets
Mode pre_call. Needs a Spanway Enterprise license on the proxy.
| Field | Required | Input | Default | What it sets |
|---|---|---|---|---|
detect_secrets_config | No | JSON | Secret detection plugins and filters that replace the bundled set. |
Block Code Execution
Modes pre_call, post_call, during_call.
| Field | Required | Input | Default | What it sets |
|---|---|---|---|---|
blocked_languages | No | Multi-select of 13 languages | Languages to block. Empty blocks all fenced code. | |
action | No | Dropdown block, mask | block | Raise an error, or replace the code block with a placeholder. |
confidence_threshold | No | Slider 0 to 1 | 0.5 | Act only at or above this detection confidence. |
detect_execution_intent | No | True or False | true | Block only when the user intends to run the code. |
OpenAI Moderation
Modes pre_call, during_call, post_call.
| Field | Required | Input | Default | What it sets |
|---|---|---|---|---|
model | No | Dropdown omni-moderation-latest, text-moderation-latest | omni-moderation-latest | Moderation model. The omni model supports images. |
api_key | No | Secret text | OpenAI API key, else OPENAI_API_KEY. | |
api_base | No | Text | https://api.openai.com/v1 | API base URL. |
streaming_end_of_stream_only | No | True or False | false | Moderate once at the end of the stream. |
streaming_sampling_rate | No | Number | 5 | Moderate every Nth streamed chunk. |
Azure Content Safety Prompt Shield
Modes pre_call, during_call.
| Field | Required | Input | Default | What it sets |
|---|---|---|---|---|
api_key | No | Secret text | Azure Content Safety API key. | |
api_base | No | Text | Azure Content Safety base URL. | |
api_version | No | Text | 2024-09-01 | API version. |
cost_tier | No | Text | free or paid, used for cost tracking. | |
price_per_1000_text_records | No | Number | USD per 1,000 text records, used for the cost estimate. |
Azure Content Safety Text Moderation
Modes pre_call, post_call. Same api_key, api_base and api_version fields as Prompt Shield.
| Optional parameter | Required | Input | What it sets |
|---|---|---|---|
severity_threshold | No | Number | Severity threshold across all categories. |
severity_threshold_by_category | No | Per category values for Hate, SelfHarm, Sexual, Violence | Severity threshold per category. |
categories | No | Multi-select Hate, SelfHarm, Sexual, Violence | Categories to scan. |
blocklistNames | No | Text | Blocklist names to scan. |
haltOnBlocklistHit | No | True or False | Stop on a blocklist hit. |
outputType | No | Dropdown FourSeverityLevels, EightSeverityLevels | Severity scale returned. |
Google Cloud Model Armor
Modes pre_call, during_call, post_call, pre_mcp_call, during_mcp_call, logging_only.
| Field | Required | Input | Default | What it sets |
|---|---|---|---|---|
template_id | No | Text | Model Armor template ID. | |
project_id | No | Text | Google Cloud project ID. | |
location | No | Text | Region, such as us-central1. | |
credentials | No | Secret text | Path to a credentials JSON file, or the JSON itself. | |
api_endpoint | No | Text | Custom Model Armor endpoint. | |
fail_on_error | No | True or False | true | Fail the request when Model Armor errors. |
sanitize_error_detail | No | True or False | true | Leave the raw Model Armor response out of errors and logs. |
Generic Guardrail API
Modes pre_call, post_call, during_call. The form has no field for the endpoint URL, key or headers, so set those in the config file or through a team submission.
| Optional parameter | Required | Input | Default | What it sets |
|---|---|---|---|---|
additional_provider_specific_params | No | Text | Extra parameters sent with each guardrail request. | |
unreachable_fallback | No | Dropdown fail_closed, fail_open | fail_closed | What to do when the endpoint cannot be reached. |
fail_on_error | No | True or False | true | Block on any guardrail error. |
streaming_end_of_stream_only | No | True or False | Run once at the end of the stream. | |
streaming_sampling_rate | No | Number | Run every Nth chunk, default 5. | |
streaming_transform_mode | No | Dropdown block_only, incremental_diff | Stream text rewrites as diffs, chat only. |
Qostodian Nexus
Modes pre_call, post_call, during_call.
| Field | Required | Input | What it sets |
|---|---|---|---|
api_base | No | Text | Nexus base URL, else the environment variable, else http://nexus:8800. |
Third-party providers with an API key and base URL only
These providers show api_key (secret text) and api_base (text), plus the fields listed.
| Provider | Modes | Other fields |
|---|---|---|
| Alice | All | None. Falls back to ALICE_API_KEY and ALICE_API_BASE. |
| Aporia AI | during_call, post_call | None. Falls back to APORIA_API_KEY and APORIA_API_BASE. |
| AIM Guardrail | pre_call, during_call, post_call | inspect_embeddings (True or False, default false) sends /embeddings input as user messages. |
| Cato Networks Guardrail | pre_call, during_call, post_call | inspect_embeddings as above. |
| LLM Shield Proxy | pre_call, post_call | None. |
| Vigil Guard | pre_call, post_call | None. |
| Onyx Guardrail | pre_call, during_call, post_call | timeout (Number). |
| PromptGuard | pre_call, post_call | block_on_error (True or False) blocks when the API is unreachable. |
Akto
Modes pre_call, post_call, pre_mcp_call, post_mcp_call, logging_only.
| Field | Required | Input | Default | What it sets |
|---|---|---|---|---|
akto_base_url | No | Text | Akto guardrail API base URL. | |
akto_api_key | No | Secret text | Akto API key. | |
akto_account_id, akto_vxlan_id | No | Text | Account ID and VXLAN ID. | |
context_source | No | Dropdown ENDPOINT, AGENTIC | Akto context, AGENTIC when empty. | |
akto_metadata | No | JSON | JSON sent to Akto. | |
guardrail_timeout, file_guardrail_timeout | No | Number | Timeouts in seconds for text and file checks. | |
unreachable_fallback | No | Dropdown fail_closed, fail_open | fail_closed | Block or allow when Akto is unreachable. |
Optional streaming_sampling_rate | No | Number | Check the stream every Nth chunk. |
Microsoft Agent 365
Mode pre_mcp_call.
| Field | Required | Input | Default | What it sets |
|---|---|---|---|---|
tenant_id, client_id | No | Text | Entra tenant and gateway app client ID for the On-Behalf-Of exchange. | |
client_secret | No | Secret text | Gateway app secret. | |
unreachable_fallback | No | Dropdown fail_closed, fail_open | fail_closed | Block with a 503, or allow, when Agent 365 cannot be reached. |
Write Action Alignment (MCP)
Mode pre_mcp_call. Checks an agent's send, post, delete and update tool calls against what the user asked and what the agent is for, see write action alignment.
| Field | Required | Input | Default | What it sets |
|---|---|---|---|---|
judge_model | Yes | Text | The model on this gateway that judges each write. Every checked write costs one short call to it. | |
on_mismatch | No | Dropdown block, require_approval, log | block | Stop a doubtful write, send it to the approvals queue, or only record it while you try the guardrail out. |
declared_purpose | No | Text | What the agents behind this guardrail are for, used when an agent has no description of its own. | |
write_verbs | No | Text, comma separated | send, post, delete, update and twenty more | Words in a tool name that make it a write, used only when the gateway does not know whether the tool is read only. Every tool that is not marked read only is checked. |
tool_names | No | Text, comma separated | Tools that are always checked whatever their names say. | |
judge_timeout_seconds | No | Number | 10 | How long to wait for the judge before blocking the write. |
max_context_chars | No | Number | 2000 | The most characters of the request, the purpose and the arguments sent to the judge, each. |
max_judge_output_tokens | No | Number | 100 | The most tokens the judge may write per check. |
Cisco AI Defense
Modes pre_call, during_call, post_call, logging_only, pre_mcp_call, during_mcp_call. Fields api_key and api_base (regional URL, default US).
| Optional parameter | Input | Default | What it sets |
|---|---|---|---|
inspection_type | Dropdown chat, mcp | chat | Inspect chat or MCP tool calls. One per guardrail. |
inspect_path | Text | Override the inspection endpoint path. | |
enabled_rules | Text | Explicit rules, otherwise the key's console policies apply. | |
integration_profile_id, integration_profile_version, integration_tenant_id, integration_type | Text | Advanced integration settings. | |
on_flagged_action | Text | block | block raises an error, monitor logs and continues. |
fallback_on_error | Dropdown allow, block | block | Behavior when the API is unavailable. |
timeout | Number | 10.0 | API timeout in seconds. |
Compresr (context compression)
All modes. Fields api_key, api_base, model (Text, latte_v2 when empty) and unreachable_fallback (Dropdown, default fail_closed, where fail_open forwards the request uncompressed).
| Optional parameter | Input | What it sets |
|---|---|---|
target_compression_ratio | Number | Fraction to remove, or a value above 1 for an N times reduction. |
coarse | True or False | Paragraph level compression instead of token level. |
min_chars_to_compress | Number | Skip shorter messages, 500 when empty. |
compress_tool_outputs, compress_system, compress_history, compress_last_user | True or False | Which message kinds are compressed. |
enable_retrieval | True or False | Add a retrieval tool for compressed originals. |
max_bytes_per_call | Number | Cap on stored originals per call. |
allow_bypass_header | True or False | Honor the x-compresr-bypass header. Off when empty. |
dynamic, dynamic_min_ratio, dynamic_max_ratio | True or False, Number | Let the service pick the ratio within bounds. |
compression_params | Text | Extra parameters passed to the service. |
CrowdStrike AIDR Guardrail
Modes pre_call, post_call. Fields api_key, api_base, and fail_on_error (True or False, default true, false fails open). Optional parameters streaming_buffer_until_moderated, streaming_buffer_release_on_scan, streaming_end_of_stream_only (True or False) and streaming_sampling_rate (Number).
DeepKeep AI Firewall
All modes. Fields api_key, api_base and deepkeep_firewall_id (Text). Optional unreachable_fallback (Text, default fail_closed).
DynamoAI Guardrails
Modes pre_call, post_call, during_call. Fields api_key, api_base, policy_ids (Text), model_id (Text) and guardrail_name (Text, the name used in logs).
EnkryptAI
Modes pre_call, post_call, during_call. Fields api_key, api_base, policy_name, deployment_name (Text), detectors (JSON) and block_on_violation (True or False, default true).
Guardrails AI
Modes post_call, pre_call, logging_only. Fields api_base (Text), guard_name (Text, needed by the guardrail even though the form does not require it) and guardrails_ai_api_input_format (Dropdown inputs, llmOutput, default llmOutput).
Headroom
Modes pre_call, post_call. Only pre_call compresses, a post_call Headroom guardrail does nothing because answers are never compressed. Fields api_base, api_key, model (Text), unreachable_fallback (Dropdown, default fail_closed, so every request is refused with a 502 while Headroom is down, pick fail_open to send them uncompressed instead) and ccr_retrieval (True or False, default true). See Headroom. The form also shows a plain text field named optional_params, which you can leave empty.
Hiddenlayer Guardrail
Modes pre_call, post_call. Fields api_base, api_id (client ID), api_key (client secret) and version (Number, default 2).
IBM Guardrails Detector
Modes pre_call, post_call, during_call. Fields auth_token (secret text), base_url, detector_id, is_detector_server (True or False, default true) and verify_ssl (True or False, default true). Optional parameters detector_params and extra_headers (Text), score_threshold (Number) and block_on_detection (True or False, default true).
Javelin Guardrails
Mode pre_call. Fields guard_name (Text, needed by the guardrail), api_version (Text, default v1), metadata (JSON), application (Text) and config (JSON). The form has no API key or base URL field.
Lasso Guardrail
Modes pre_call, during_call, post_call. Fields api_key and api_base. Optional parameters user_id and conversation_id (Text).
MCP End User Permission
Mode pre_call. No fields. The form shows "No configuration fields available for this provider."
Noma Security and Noma Security v2
Noma Security has modes pre_call, during_call, post_call, pre_mcp_call and fields use_v2 (True or False, default false), api_key, api_base and application_id. Noma Security v2 adds during_mcp_call and has api_key, api_base, application_id, gateway_name (Text), monitor_mode and block_failures (True or False).
Ovalix Guardrail
Modes pre_call, post_call. Fields tracker_api_base, tracker_api_key (secret), application_id, pre_checkpoint_id and post_checkpoint_id.
Pangea Guardrail
Modes pre_call, post_call. Fields api_key and api_base. Optional parameters pangea_input_recipe and pangea_output_recipe (Text).
PANW Prisma AIRS
All modes except realtime_input_transcription.
| Field | Input | Default | What it sets |
|---|---|---|---|
api_key, api_base | Secret text, Text | API key and base URL. | |
profile_name | Text | Security profile name. Optional if the key is linked to one. | |
app_name | Text | App name shown in AIRS analytics. | |
mask_on_block | True or False | false | Legacy flag that turns on request and response masking. |
mask_request_content, mask_response_content | True or False | false | Send masked content instead of blocking. |
fallback_on_error | Dropdown block, allow | block | Behavior when the API is unavailable. |
timeout | Number | 10.0 | API timeout in seconds. |
experimental_use_latest_role_message_only | True or False | Scan only the latest user or developer message. |
Pillar Guardrail
Modes pre_call, during_call, post_call, pre_mcp_call, during_mcp_call. Fields api_key and api_base. Optional parameters on_flagged_action (Text, default monitor), async_mode, persist_session, include_scanners (default true), include_evidence (default true) as True or False, fallback_on_error (Text) and timeout (Number).
Prompt Security
Modes pre_call, during_call, post_call. Fields api_key, api_base, file_sanitization_fail_open (True or False, default true), block_on_file_modify (True or False, default true) and streaming_transform_mode (Dropdown block_only, incremental_diff).
Qualifire
Modes pre_call, during_call, post_call. Fields api_key, api_base, evaluation_id (Text), the True or False checks prompt_injections, hallucinations_check, grounding_check, pii_check, content_moderation_check and tool_selection_quality_check, assertions (Text) and on_flagged (Dropdown block, monitor, default block).
RepelloAI Argus
Modes pre_call, post_call. Fields api_key, api_base, asset_id (Text, needed by the guardrail) and unreachable_fallback (Dropdown, default fail_closed). The form also shows a plain text field named optional_params, which you can leave empty.
Singulr
All modes. Fields singulr_api_key (secret), singulr_api_base, singulr_application_id, singulr_guardrail_id and block_on_error (True or False).
Straiker
Modes pre_call, post_call. api_key is required (secret text). api_base defaults to https://api.prod.straiker.ai and default_app to Spanway Gateway.
| Optional parameter | Input | Default | What it sets |
|---|---|---|---|
timeout, max_retries, initial_backoff, max_backoff | Number | 5.0, 2, 0.1, 2.0 | Timeout and retry behavior. |
unreachable_fallback | Dropdown fail_open, fail_closed | fail_closed | Behavior when unreachable after retries. |
fail_on_error | True or False | true | Block on any guardrail error. |
max_payload_bytes | Number | 524288 | Maximum payload size. |
api_version | Dropdown v1, v3 | API version, otherwise chosen from the key prefix. | |
agent_ref, client | Text | v3 routing hints. agent_ref names one application when the gateway fronts several, and client names the calling client. When client is empty, a request from Claude Code, whose User-Agent starts with claude-cli/ or claude-code/, is sent as client claude and agent Claude (Spanway). | |
format_hint | Dropdown anthropic.messages, openai.chat | v3 format tie breaker. | |
custom_headers, metadata | Text | Extra headers and default metadata. | |
verbose | True or False | false | Log payloads. |
TypeSafe (Jev) Compaction
All modes. Fields api_key, api_base, model (Text) and unreachable_fallback (Dropdown, default fail_open). Optional parameters relevance_threshold, min_chars_to_evaluate and max_result_chars_in_state (Number).
XecGuard
Modes pre_call, during_call, post_call, logging_only. Fields api_key, api_base, xecguard_model (Text), policy_names (Multi-select of six default policies), block_on_error (True or False) and grounding_strictness (Dropdown BALANCED, STRICT).
Zscaler AI Guard
Modes pre_call, post_call. Fields api_key, api_base, policy_id (Number), send_user_api_key_alias, send_user_api_key_user_id, send_user_api_key_team_id (True or False, default false) and timeout (Number).
CustomCode
The provider list also shows CustomCode, with a required single line custom_code field and a timeout field (default 30 seconds). Use Create Custom Code Guardrail instead, which gives you a full editor and a test runner.
Custom code guardrail editor
Create Custom Code Guardrail, and Edit Code on a custom code guardrail, open this dialog. It is titled Create Custom Guardrail or Edit Custom Guardrail, with the subtitle "Define custom logic using Python-like syntax".
| Control | Type | What it does |
|---|---|---|
| Guardrail Name | Text, required | Placeholder "e.g., block-pii-custom". |
| Mode (can select multiple) | Multi-select | pre_call (Request), post_call (Response), during_call (Parallel), logging_only, pre_mcp_call and during_mcp_call. post_mcp_call is not offered, because custom code cannot run after a tool call. Hover the label for what each mode checks. Defaults to pre_call. A guardrail with a tag based mode shows Mode (tag-scoped, read-only) with the modes in a disabled field instead. |
| Logging only scope | Dropdown | Shown when logging_only is selected, with the same choices as the main form. |
| Continue observing the response after a flagged request | Switch | Same as the main form. |
| Template | Dropdown | Empty Template, Block SSN, Redact Emails, Block SQL Injection, Validate JSON and External API Check (async). Picking one replaces the code. The menu also links to Custom code guardrail docs. |
| Default On | Switch | On runs this check on every request from every key. Off, the default, runs it only where you attach it to a key, team or policy, or where a request names it. Hover the label for the same text. The code's own time limit, timeout (30 seconds by default), cannot be set here, set it with PATCH /guardrails/{guardrail_id}. |
| Request shape | One dropdown per mode | The same streaming choices as the main form. |
| Python Logic | Code editor | The code. It runs in a restricted environment with no imports. Tab inserts four spaces. |
| Available Primitives | Side panel | Groups Return Values, HTTP Requests (async), Regex Functions, JSON Functions, URL Functions, Code Detection and Text Utilities. Clicking a function copies it to the clipboard. |
| Contribute Template | Button | Opens the Spanway support page in a new tab. |
| Cancel | Button | Closes the dialog. Your code is not kept, even though the footer says changes are auto-saved to a local draft. |
| Save Guardrail or Update Guardrail | Button | Saves. Disabled until a name is entered. Refused with "Please enter custom code" when the editor is empty. |
The code returns one of allow(), block(reason), flag(reason, metadata={}) or modify(texts=[], images=[], tool_calls=[]).
Test Your Guardrail
This collapsible section runs your code on the proxy without saving it. Test Input (JSON) holds the input, and Load example fills it with a Pre-call, Pre MCP or Post-call sample. A legend lists the input fields texts, images, tools, tool_calls, structured_messages and model. Run Test sends the code and input to /guardrails/test_custom_code, treating the input as a request when a request mode is selected and as a response otherwise. The result shows Allowed, Blocked with the reason, Modified with the first changed text, or the error and whether it was a compilation or execution error. "Invalid test input JSON" means the input does not parse.
Guardrail detail view
Clicking a guardrail ID opens its detail view. Back to Guardrails returns to the list. The header shows the name, the ID and a copy button. "Guardrail not found" appears when the ID does not exist.
Overview tab
Cards show the Provider, the Mode with a Default On or Default Off badge, the logging only scope and continue setting when logging_only is a mode, the request shape when it is not the default, and Created At with Last Updated. Depending on the provider, the tab also shows the PII entities and their actions, the tool permission rules (read only), the custom code with an Edit Code button for admins on database guardrails, or the content filter Content Categories, Pattern Detection and Blocked Keywords.
Settings tab
Only admins see this tab. It is titled Guardrail Settings. A guardrail from the config file shows an info icon with "Guardrail is defined in the config file and cannot be edited." and no edit button. Otherwise the read only summary has an Edit Settings button, or Edit Code for custom code guardrails.
Editing shows these controls.
| Control | What it does |
|---|---|
| Guardrail Name | Required. |
| Default On | Yes or No. |
| Request shape | One dropdown per existing mode. |
| Skip system messages in guardrail, Skip tool messages in guardrail | The same three choices as on create. Choosing Use global default clears the stored value. |
| Logging only scope, Continue observing the response after a flagged request | Shown when logging_only is a mode. |
| PII Protection | Presidio guardrails only. The same entity picker as on create. |
| Content filter editor | Content filter guardrails only. The same categories, competitor intent, patterns and keywords editors, with a warning while there are unsaved changes. |
| Provider Settings | The provider fields and optional parameters, filled with the current values, or the tool permission rules editor. Stored secrets come back masked and are only sent again if you change them, and the proxy keeps the stored value for any field that still holds its masked form, so a masked value is never saved as the secret. Clearing a field removes the stored value. If you change a destination field such as api_base, enter the secret again in the same save. Otherwise the proxy refuses the update with "Re-enter the secret to use it with the new destination", so a stored secret is never sent to a new address. |
| Guardrail Information | A JSON text area for the guardrail's guardrail_info. Invalid JSON makes the save fail. |
| Cancel, Save Changes | Save Changes sends only the fields that changed. With no changes it shows "No changes detected". |
The modes and the provider cannot be changed here. The judge criteria of Spanway LLM as a Judge and the model and questions of Decision Model are shown read only. To change those, create a new guardrail and delete the old one.
Guardrail Garden tab
The garden is a catalogue of ready made guardrails. Search guardrails filters cards by name, description and tag. It has three sections.
| Section | What it holds |
|---|---|
| Spanway Content Filter | Built in content categories, pattern matching, keyword blocking, code execution blocking, write action alignment for MCP tool calls and competitor name blocking. Ten cards show at first, and Show all (N) reveals the rest. |
| Decision Model | Decision model presets. |
| Third-party guardrails | Third-party providers. |
Clicking a card opens its detail page with Overview and, when the card has evaluation data, Eval Results. The overview lists properties such as Provider, Subcategory, Cost, External Dependencies and Latency, plus the card's Guardrail ID, Type and Tags. Create Guardrail opens the Create guardrail dialog prefilled from the card, for example with the provider, a suggested name, the mode and the content category. Nothing is created until you finish the dialog.
Test Playground tab
The playground runs guardrails against text you type. The tab is disabled until the session token is loaded.
The left panel lists every guardrail with its type and mode, a Search guardrails... box, and a "N of M selected" count. Click guardrails to select them. Until you select one, the right panel says Select Guardrails to Test.
| Control | Type | What it does |
|---|---|---|
| Input Text | Text area | The text to test. Enter submits and Shift plus Enter adds a new line. |
| Copy Input | Button | Copies the input. |
| Metadata (optional) | Text area | A JSON object passed to the guardrail as request_data['metadata']. Shows "Metadata must be a JSON object" or "Invalid JSON" when it does not parse. |
| Test N guardrails | Button | Calls /guardrails/apply_guardrail once per selected guardrail. Disabled while the input is empty. |
The calls are real. Partner guardrails reach their provider and may be billed. Results lists each guardrail with its latency in milliseconds, the Output Text with a character count and a Copy button, or an error card with the guardrail name, latency and error message for each call that failed.
Submitted Guardrails tab
This tab is the review queue for guardrails that teams submit. Each submission is a Generic Guardrail API guardrail that points at a team's own service. Proxy admins see every submission. Other users see the submissions of teams they belong to.
Four counters show Total Submitted, Pending Review, Active and Rejected. Search guardrails... searches names and descriptions, and the status filter offers All Status, Pending Review, Active and Rejected.
Each card shows the team, a status badge, the name, description, endpoint, model and submission date, Runs on every request (Yes or No), a Review button (which opens the detail panel and changes to Close), and for pending submissions Approve and Reject buttons. Static headers expands the headers sent with every call. With nothing to show the list says "No guardrails match your filters."
| Badge | Meaning |
|---|---|
| Pending Review | Submitted and waiting for an admin. |
| Active | Approved and in use. |
| Rejected | Rejected by an admin. |
Detail panel
The panel shows Endpoint and Method, a What approving turns on box with the mode, whether the guardrail runs on every request and the masked API key it sends to the team's service, Static headers, Forward client headers (client request headers passed through, such as x-request-id) and Equivalent config, the same guardrail as a top level guardrails: config file snippet with default_on and the masked key. The caller's own Spanway key is never sent to the team's service. Header values come back from the proxy masked, including credential values nested inside a header. Proxy admins can add headers with Add and remove them, and each change is saved at once. A header that still shows its masked value keeps the stored value. The Test Endpoint button does nothing yet.
Approve or Reject
Approve and Reject open a confirmation. Approving makes the guardrail active and starts it. It checks a team's requests only once you attach it to that team, under Teams, Edit, Guardrails, or with a policy attachment. Rejecting marks it rejected. A submission that asks to run on every request, or whose parameters reference a gateway environment variable with os.environ/, is refused at submit and again at approve. Neither can be undone from this tab.
Submit Guardrail for Review
Add Guardrail opens this dialog, which notes that the guardrail goes to admin review before it becomes active.
| Field | Rules |
|---|---|
| Team | Required. |
| Guardrail Name | Required. |
| Mode | Pre Call (default), Post Call or During Call. |
| API Base URL | Required and must be a valid URL. |
| Additional spanway_params (optional) | Must be a JSON object if filled. |
| Guardrail Info (optional) | Must be valid JSON if filled. |
Submit for Review shows "Guardrail submitted for review". The proxy refuses the submission when you are not a member of the chosen team.
Guardrails on team pages
The team detail page has a Guardrails Settings card built from the same data. It lists the Global guardrails that run for the team (default on guardrails the team has not opted out of), or Bypassed for this team when the team's guardrail kill switch is on, and the Team-specific guardrails the team opts into. Either list says None configured when empty, and the card says No guardrails configured when both are empty. Guardrail pickers on keys, teams and agents list guardrails by name, and a disabled picker shows "Setting guardrails is a premium feature."
Empty, error and disabled states
| State | What you see and what to do |
|---|---|
| No guardrails | The table shows No guardrails yet with "Add a guardrail to start filtering requests and responses." Use Add New Guardrail or the garden. |
| List fails to load | The table stays empty and the error is only written to the browser console. Reload the page and check that you are signed in as an admin. |
| Settings fail to load in the dialog | "Failed to load guardrail configuration". The provider list falls back to Presidio PII, Bedrock Guardrail and Lakera. |
| Provider fields fail to load | "Failed to load provider parameters" in place of the fields. |
| Detail fails to load | "Failed to load guardrail information" and then "Guardrail not found". |
| Config file guardrail | Delete is disabled and the Settings tab cannot edit it. Change it in the config file. |
| Save refused | "Failed to update guardrail" or "Failed to create guardrail". This is what a view only admin sees on every save. |
| Submissions fail to load | The error text in red, or "Failed to load submissions". |
Differences by role and license
| Role | What changes |
|---|---|
Admin (proxy_admin) | All four tabs. Can create, edit, delete, test custom code, run the playground, approve and reject submissions, and change submission headers. |
Admin Viewer (proxy_admin_viewer) | Only Submitted Guardrails, under the view-only banner. Approve, Reject and the header editors are hidden. The proxy refuses every create, update, delete, custom code test and approval for this role. |
| Org Admin, Internal User, Internal Viewer | Only Submitted Guardrails. Can submit guardrails for teams they belong to and see their teams' submissions. Approve, Reject and the header editors are hidden. |
The page itself checks no license. Hide Secrets needs a Spanway Enterprise license on the proxy. Attaching guardrails to keys and teams is licensed separately, as described on the Virtual Keys and Teams pages.
Errors
| What you see | What it means | Fix |
|---|---|---|
| "Failed to load guardrail configuration" | The dialog could not load the guardrail settings. | Reload, and check that you are a proxy admin. |
| Next stays on Basic Info | The name, provider or mode is empty. | Fill them in. |
403 naming guardrails when attaching to a key or team | Setting guardrails on keys and teams needs the guardrails license feature. | Add the feature, or use a gateway wide guardrail with default_on. |
A request fails with Violated guardrail policy | A guardrail blocked the request. | This is the guardrail working, see the request on Logs. |
Failed to create guardrail with ... needs a Spanway enterprise license. | Hide Secrets on a gateway without a license. Nothing was stored. | Add a license. |
Submit fails with spanway_params.default_on cannot be set on a team submission ... or ... cannot reference a gateway environment variable on a team submission ... | A team submission tried to run everywhere or read a gateway secret. | Leave Always On out, and send the team's own key as a literal value. |
Audit and logs
Every change on this page writes an audit row on Spanway_GuardrailsTable with who made it and the value before and after, secrets redacted: creating, editing and deleting a guardrail, a team submission (with the submitted parameters) and its approval or rejection. A refused change writes no row. The gateway log lines for these actions are listed on guardrails, custom code guardrails and the generic guardrail API.