Skip to main content

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​

  1. Open Guardrails under AI Gateway, or go to /ui/guardrails, click Add New Guardrail and choose Add Provider Guardrail.

  2. On Basic Info type pii-mask as 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"}}}'
  3. 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"}'
  4. 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.

ControlTypeWhat it does
Add New GuardrailDropdown buttonOpens 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.
TableTableOne row per guardrail, sorted by Created At, newest first. Sorting and paging happen in the browser.
ColumnMeaning
Guardrail IDThe guardrail's ID. Click it to open the detail view. Sortable.
NameThe guardrail name, or a dash when it has none. Sortable.
ProviderThe provider logo and display name. When the UI does not know the provider key, it shows the raw key.
ModeThe modes the guardrail runs in, separated by commas. A tag based mode shows the modes followed by (tag-based).
Default OnA 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 AtTimestamps. Sortable.
Row menuThe 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.

ProviderSteps
Spanway Content FilterBasic Info, Topics, Patterns, Keywords, Endpoint Settings (Optional)
Presidio PIIBasic Info, PII Configuration
Decision ModelBasic Info, Decision Model Configuration
Every other providerBasic 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​

ControlTypeWhat it does
Guardrail NameText, requiredThe guardrail's name. Keys, teams and policies refer to the guardrail by this name. Placeholder "Enter a name for this guardrail".
Guardrail ProviderSearchable dropdown, requiredThe 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.
ModeMulti-select, requiredWhen 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 shapeOne dropdown per selected modeEach 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 OnYes or NoSaved 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 guardrailDropdownUse 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 guardrailDropdownThe 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 scopeDropdownShown 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 requestSwitchShown 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 fieldsVariesThe 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.

ModeDescription shown in the dropdown
pre_callBefore LLM Call. Runs before the LLM call and checks the input (Recommended).
during_callDuring LLM Call. Runs in parallel with the LLM call, with the response held until the check completes.
post_callAfter LLM Call. Runs after the LLM call and checks only the output.
logging_onlyLogging Only. Only runs on logging callbacks without affecting the LLM call.
pre_mcp_callBefore MCP Tool Call. Runs before MCP tool execution and validates tool calls.
during_mcp_callDuring MCP Tool Call. Runs in parallel with MCP tool execution for monitoring.
post_mcp_callAfter MCP Tool Call. Runs after MCP tool execution and checks the tool result.
realtime_input_transcriptionNo 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.

ControlTypeWhat it does
Filter by categoryMulti-selectNarrows the entity list to the chosen PII categories.
Select All & MaskButtonSelects every entity with the action MASK.
Select All & BlockButtonSelects every entity with the action BLOCK.
Unselect AllButtonClears the selection. Disabled when nothing is selected.
Entity listCheckbox rowsColumns 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.

ControlTypeWhat it does
TypeDropdownAirline (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 inputThe 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 inputAirline type only. Countries, cities or airports used for disambiguation.
CompetitorsTag inputGeneric type only. The competitor names to detect.
Competitor comparison policyDropdownRefuse (block request) (default) or Reframe (suggest alternative).
Possible competitor comparison policyDropdownRefuse (block request) or Reframe (suggest alternative to backend LLM) (default).
Confidence thresholdsThree number inputsHigh, 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.

ControlTypeWhat it does
Judge ModelSearchable dropdown, requiredThe model on this proxy that grades the request (pre_call, during_call) or the response (post_call).
Minimum Score to PassNumber, 0 to 100Default 80. When the weighted average of the criterion scores falls below it, the guardrail triggers.
On FailureDropdownBlock (return 422) (default) or Log only.
Evaluation CriteriaListEach 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.

ControlTypeWhat it does
Decision ModelSearchable dropdown, requiredA 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.
QuestionsListEach 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.
TestText box and Run testScores 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.

ControlTypeWhat it does
Add RuleButtonAdds a rule with a generated ID and the decision Allow.
Rule IDTextThe rule's unique ID.
Tool Name (optional)TextA regular expression matched against the tool name.
Tool Type (optional)TextA regular expression matched against the tool type.
DecisionDropdownAllow or Deny.
Restrict tool arguments (optional)ButtonAdds 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.
RemoveButtonRemoves the rule.
Default actionDropdownWhat happens when no rule matches. Deny by default.
On disallowed actionDropdownBlock (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 areaThe 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.

FieldRequiredInputDefaultWhat it sets
presidio_analyzer_api_baseNoTextPresidio analyzer base URL.
presidio_anonymizer_api_baseNoTextPresidio anonymizer base URL.
presidio_filter_scopeNoDropdown input, output, bothWhere the checks apply.
output_parse_piiNoTrue or FalseRestore the original text in the response.
presidio_languageNoTextenLanguage code used for analysis.

Bedrock Guardrail​

Modes pre_call, post_call, during_call, pre_mcp_call, during_mcp_call.

FieldRequiredInputDefaultWhat it sets
guardrailIdentifierNoTextThe AWS Bedrock guardrail ID. Needed unless inline checks are used.
guardrailVersionNoTextThe guardrail version, such as DRAFT or a number.
disable_exception_on_blockNoTrue or FalsefalseDo not raise an error on a block.
aws_region_nameNoTextAWS region of the guardrail.
aws_access_key_idNoSecret textAWS access key ID.
aws_secret_access_keyNoSecret textAWS secret access key.
aws_session_tokenNoSecret textSession token for temporary credentials.
aws_session_name, aws_profile_name, aws_role_nameNoTextSession name, credentials profile and role to assume.
aws_web_identity_tokenNoSecret textWeb identity token for role assumption.
aws_sts_endpoint, aws_external_id, aws_bedrock_runtime_endpointNoTextSTS endpoint, external ID for the role trust policy, and Bedrock runtime endpoint.
checksNoGroupInline 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_thresholdNoNumber0.5Block when the severity or confidence reaches this value. Empty means detect only.
chunk_budget_charsNoNumber25000Batch size used when AWS rejects a request as too large.
contextual_grounding_from_messagesNoTrue or FalsefalseSend system and user messages as the grounding source and query.
streaming_buffer_until_moderatedNoTrue or FalsetrueHold streamed chunks until the end of stream scan passes.
streaming_sampling_rateNoNumber5Scan the accumulated response every Nth chunk when not buffering.
streaming_end_of_stream_onlyNoTrue or FalsefalseSkip sampling and scan once at the end of the stream.
streaming_buffer_release_on_scanNoTrue or FalsefalseRelease buffered chunks after each passing sampled scan.

Lakera​

Modes pre_call, during_call, post_call.

FieldRequiredInputDefaultWhat it sets
api_keyNoSecret textLakera API key.
api_baseNoTextLakera API base URL.
project_idNoTextLakera project ID.
payload, breakdown, dev_infoNoTrue or FalsetrueInclude the payload, breakdown and developer info in the response.
metadataNoJSONExtra request metadata.
on_flaggedNoDropdown block, monitor, inject_system_messageblockBlock, only log, or inject an advisory system message.
advisory_system_messageNoTextTemplate for inject_system_message. Must contain {reason}.

Hide Secrets​

Mode pre_call. Needs a Spanway Enterprise license on the proxy.

FieldRequiredInputDefaultWhat it sets
detect_secrets_configNoJSONSecret detection plugins and filters that replace the bundled set.

Block Code Execution​

Modes pre_call, post_call, during_call.

FieldRequiredInputDefaultWhat it sets
blocked_languagesNoMulti-select of 13 languagesLanguages to block. Empty blocks all fenced code.
actionNoDropdown block, maskblockRaise an error, or replace the code block with a placeholder.
confidence_thresholdNoSlider 0 to 10.5Act only at or above this detection confidence.
detect_execution_intentNoTrue or FalsetrueBlock only when the user intends to run the code.

OpenAI Moderation​

Modes pre_call, during_call, post_call.

FieldRequiredInputDefaultWhat it sets
modelNoDropdown omni-moderation-latest, text-moderation-latestomni-moderation-latestModeration model. The omni model supports images.
api_keyNoSecret textOpenAI API key, else OPENAI_API_KEY.
api_baseNoTexthttps://api.openai.com/v1API base URL.
streaming_end_of_stream_onlyNoTrue or FalsefalseModerate once at the end of the stream.
streaming_sampling_rateNoNumber5Moderate every Nth streamed chunk.

Azure Content Safety Prompt Shield​

Modes pre_call, during_call.

FieldRequiredInputDefaultWhat it sets
api_keyNoSecret textAzure Content Safety API key.
api_baseNoTextAzure Content Safety base URL.
api_versionNoText2024-09-01API version.
cost_tierNoTextfree or paid, used for cost tracking.
price_per_1000_text_recordsNoNumberUSD 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 parameterRequiredInputWhat it sets
severity_thresholdNoNumberSeverity threshold across all categories.
severity_threshold_by_categoryNoPer category values for Hate, SelfHarm, Sexual, ViolenceSeverity threshold per category.
categoriesNoMulti-select Hate, SelfHarm, Sexual, ViolenceCategories to scan.
blocklistNamesNoTextBlocklist names to scan.
haltOnBlocklistHitNoTrue or FalseStop on a blocklist hit.
outputTypeNoDropdown FourSeverityLevels, EightSeverityLevelsSeverity scale returned.

Google Cloud Model Armor​

Modes pre_call, during_call, post_call, pre_mcp_call, during_mcp_call, logging_only.

FieldRequiredInputDefaultWhat it sets
template_idNoTextModel Armor template ID.
project_idNoTextGoogle Cloud project ID.
locationNoTextRegion, such as us-central1.
credentialsNoSecret textPath to a credentials JSON file, or the JSON itself.
api_endpointNoTextCustom Model Armor endpoint.
fail_on_errorNoTrue or FalsetrueFail the request when Model Armor errors.
sanitize_error_detailNoTrue or FalsetrueLeave 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 parameterRequiredInputDefaultWhat it sets
additional_provider_specific_paramsNoTextExtra parameters sent with each guardrail request.
unreachable_fallbackNoDropdown fail_closed, fail_openfail_closedWhat to do when the endpoint cannot be reached.
fail_on_errorNoTrue or FalsetrueBlock on any guardrail error.
streaming_end_of_stream_onlyNoTrue or FalseRun once at the end of the stream.
streaming_sampling_rateNoNumberRun every Nth chunk, default 5.
streaming_transform_modeNoDropdown block_only, incremental_diffStream text rewrites as diffs, chat only.

Qostodian Nexus​

Modes pre_call, post_call, during_call.

FieldRequiredInputWhat it sets
api_baseNoTextNexus 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.

ProviderModesOther fields
AliceAllNone. Falls back to ALICE_API_KEY and ALICE_API_BASE.
Aporia AIduring_call, post_callNone. Falls back to APORIA_API_KEY and APORIA_API_BASE.
AIM Guardrailpre_call, during_call, post_callinspect_embeddings (True or False, default false) sends /embeddings input as user messages.
Cato Networks Guardrailpre_call, during_call, post_callinspect_embeddings as above.
LLM Shield Proxypre_call, post_callNone.
Vigil Guardpre_call, post_callNone.
Onyx Guardrailpre_call, during_call, post_calltimeout (Number).
PromptGuardpre_call, post_callblock_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.

FieldRequiredInputDefaultWhat it sets
akto_base_urlNoTextAkto guardrail API base URL.
akto_api_keyNoSecret textAkto API key.
akto_account_id, akto_vxlan_idNoTextAccount ID and VXLAN ID.
context_sourceNoDropdown ENDPOINT, AGENTICAkto context, AGENTIC when empty.
akto_metadataNoJSONJSON sent to Akto.
guardrail_timeout, file_guardrail_timeoutNoNumberTimeouts in seconds for text and file checks.
unreachable_fallbackNoDropdown fail_closed, fail_openfail_closedBlock or allow when Akto is unreachable.
Optional streaming_sampling_rateNoNumberCheck the stream every Nth chunk.

Microsoft Agent 365​

Mode pre_mcp_call.

FieldRequiredInputDefaultWhat it sets
tenant_id, client_idNoTextEntra tenant and gateway app client ID for the On-Behalf-Of exchange.
client_secretNoSecret textGateway app secret.
unreachable_fallbackNoDropdown fail_closed, fail_openfail_closedBlock 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.

FieldRequiredInputDefaultWhat it sets
judge_modelYesTextThe model on this gateway that judges each write. Every checked write costs one short call to it.
on_mismatchNoDropdown block, require_approval, logblockStop a doubtful write, send it to the approvals queue, or only record it while you try the guardrail out.
declared_purposeNoTextWhat the agents behind this guardrail are for, used when an agent has no description of its own.
write_verbsNoText, comma separatedsend, post, delete, update and twenty moreWords 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_namesNoText, comma separatedTools that are always checked whatever their names say.
judge_timeout_secondsNoNumber10How long to wait for the judge before blocking the write.
max_context_charsNoNumber2000The most characters of the request, the purpose and the arguments sent to the judge, each.
max_judge_output_tokensNoNumber100The 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 parameterInputDefaultWhat it sets
inspection_typeDropdown chat, mcpchatInspect chat or MCP tool calls. One per guardrail.
inspect_pathTextOverride the inspection endpoint path.
enabled_rulesTextExplicit rules, otherwise the key's console policies apply.
integration_profile_id, integration_profile_version, integration_tenant_id, integration_typeTextAdvanced integration settings.
on_flagged_actionTextblockblock raises an error, monitor logs and continues.
fallback_on_errorDropdown allow, blockblockBehavior when the API is unavailable.
timeoutNumber10.0API 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 parameterInputWhat it sets
target_compression_ratioNumberFraction to remove, or a value above 1 for an N times reduction.
coarseTrue or FalseParagraph level compression instead of token level.
min_chars_to_compressNumberSkip shorter messages, 500 when empty.
compress_tool_outputs, compress_system, compress_history, compress_last_userTrue or FalseWhich message kinds are compressed.
enable_retrievalTrue or FalseAdd a retrieval tool for compressed originals.
max_bytes_per_callNumberCap on stored originals per call.
allow_bypass_headerTrue or FalseHonor the x-compresr-bypass header. Off when empty.
dynamic, dynamic_min_ratio, dynamic_max_ratioTrue or False, NumberLet the service pick the ratio within bounds.
compression_paramsTextExtra 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.

FieldInputDefaultWhat it sets
api_key, api_baseSecret text, TextAPI key and base URL.
profile_nameTextSecurity profile name. Optional if the key is linked to one.
app_nameTextApp name shown in AIRS analytics.
mask_on_blockTrue or FalsefalseLegacy flag that turns on request and response masking.
mask_request_content, mask_response_contentTrue or FalsefalseSend masked content instead of blocking.
fallback_on_errorDropdown block, allowblockBehavior when the API is unavailable.
timeoutNumber10.0API timeout in seconds.
experimental_use_latest_role_message_onlyTrue or FalseScan 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 parameterInputDefaultWhat it sets
timeout, max_retries, initial_backoff, max_backoffNumber5.0, 2, 0.1, 2.0Timeout and retry behavior.
unreachable_fallbackDropdown fail_open, fail_closedfail_closedBehavior when unreachable after retries.
fail_on_errorTrue or FalsetrueBlock on any guardrail error.
max_payload_bytesNumber524288Maximum payload size.
api_versionDropdown v1, v3API version, otherwise chosen from the key prefix.
agent_ref, clientTextv3 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_hintDropdown anthropic.messages, openai.chatv3 format tie breaker.
custom_headers, metadataTextExtra headers and default metadata.
verboseTrue or FalsefalseLog 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".

ControlTypeWhat it does
Guardrail NameText, requiredPlaceholder "e.g., block-pii-custom".
Mode (can select multiple)Multi-selectpre_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 scopeDropdownShown when logging_only is selected, with the same choices as the main form.
Continue observing the response after a flagged requestSwitchSame as the main form.
TemplateDropdownEmpty 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 OnSwitchOn 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 shapeOne dropdown per modeThe same streaming choices as the main form.
Python LogicCode editorThe code. It runs in a restricted environment with no imports. Tab inserts four spaces.
Available PrimitivesSide panelGroups 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 TemplateButtonOpens the Spanway support page in a new tab.
CancelButtonCloses the dialog. Your code is not kept, even though the footer says changes are auto-saved to a local draft.
Save Guardrail or Update GuardrailButtonSaves. 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.

ControlWhat it does
Guardrail NameRequired.
Default OnYes or No.
Request shapeOne dropdown per existing mode.
Skip system messages in guardrail, Skip tool messages in guardrailThe same three choices as on create. Choosing Use global default clears the stored value.
Logging only scope, Continue observing the response after a flagged requestShown when logging_only is a mode.
PII ProtectionPresidio guardrails only. The same entity picker as on create.
Content filter editorContent filter guardrails only. The same categories, competitor intent, patterns and keywords editors, with a warning while there are unsaved changes.
Provider SettingsThe 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 InformationA JSON text area for the guardrail's guardrail_info. Invalid JSON makes the save fail.
Cancel, Save ChangesSave 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.

SectionWhat it holds
Spanway Content FilterBuilt 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 ModelDecision model presets.
Third-party guardrailsThird-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.

ControlTypeWhat it does
Input TextText areaThe text to test. Enter submits and Shift plus Enter adds a new line.
Copy InputButtonCopies the input.
Metadata (optional)Text areaA 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 guardrailsButtonCalls /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."

BadgeMeaning
Pending ReviewSubmitted and waiting for an admin.
ActiveApproved and in use.
RejectedRejected 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.

FieldRules
TeamRequired.
Guardrail NameRequired.
ModePre Call (default), Post Call or During Call.
API Base URLRequired 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​

StateWhat you see and what to do
No guardrailsThe 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 loadThe 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 guardrailDelete 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 loadThe error text in red, or "Failed to load submissions".

Differences by role and license​

RoleWhat 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 ViewerOnly 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 seeWhat it meansFix
"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 InfoThe name, provider or mode is empty.Fill them in.
403 naming guardrails when attaching to a key or teamSetting 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 policyA 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.