Skip to main content

LLM Gateway Policies

Govern data, tools, models, identity, spend and quality on every model call.

Two decision points per call

The document is evaluated twice for a single model call.

Your application
Model request
on request
Access
Identity
Tools
Models
Routing
Limits
Budgets
Token savings
Data scan
Model provider
Upstream call
on response
Data scan
Hallucination
QuilrAI

Controls that shape the outbound call run on request. Controls that judge what came back run on response. Data inspection runs on both: on request it catches what your users send, on response it catches what the model returns.

What you can match on

ConditionMatches
ApplicationThe gateway application. This is how a policy is scoped to one app, and the condition the automatic conversion always writes.
Application method typeAPI surface in use: chat, responses, assistants, embeddings, rerank, tts, stt, bedrock, vertex, sdk_check.
User emailThe identified caller.
Smart groupsThe caller's Quilr Smart Groups, the gateway's own runtime groups. These are distinct from console access-control groups and are matched ignoring case.
Requested modelThe model the caller asked for.
Tool name, tags, argumentsThe tool call under evaluation, its tags, and its individual argument values.
Request metadataYour own metadata sent on the call: environment, cost centre, ticket ID, anything you pass.
Data foundDetections by exact catalog name, with is any of, is all of or is none of, and an optional occurrence threshold.

The twelve control surfaces

Every setting belongs to exactly one card, and the workspace is those twelve cards. Monitor, redact and block are settings inside a card, never separate cards.

SurfaceStageWhat it controls
Data & Adversarial Risksrequest, responsePII, PHI, financial data, secrets, prompt injection, jailbreaks, custom detections. Actions: monitor, partial-redact, redact, block.
Guardian AgentrequestDependency security checks, latest-version suggestions, task-adherence enforcement with a sensitivity and a nudge or block action.
Hallucination ProtectionresponseScores responses and enforces above a confidence threshold between 0 and 1.
Gateway AccessrequestAllow or deny the whole model request by application, person, group, model or metadata.
Identity & Network TrustrequestRequire an identified caller and a conversation ID; restrict traffic to approved CIDR ranges.
Tool ControlsrequestAllow or deny tool calls on name, type, tags, risk or annotations, independently of data handling.
Allowed ModelsrequestThe models matching traffic may use.
Routing Groups & FallbacksrequestWeighted routing groups and ordered provider fallback chains.
Budgets & Usage LimitsrequestSpend and usage allowances by metric, grouped per user, application or model, over calendar, rolling or lifetime periods.
Rate, Token & Timeout LimitsrequestConcurrency, request rate, token ceilings and timeouts, application-wide and per model.
Token SavingsrequestJSON compression, HTML and Markdown to text, text compression before the provider call.
Prompt Store EnforcementrequestRequire matching requests to use an approved system prompt.

Protecting data

Block secrets everywhere

block_request_secretsrequest

runs on requestpriority 900

Whendata foundis any ofAuth & Secrets
Then
Sensitive data actionblock
Risk levelcritical

No scope condition, so it covers every request the gateway sees. A high priority keeps it above narrower, more permissive rules.

Redact personal data in responses

redact_response_personal_dataresponse

runs on responsepriority 750

WhenApplication method typeis any ofchatresponsesassistants+4
anddata foundis any ofPersonally Identifiable Information (PII)
Then
Sensitive data actionredact
Risk levelhigh

Use partial-redact instead to mask only part of a value, the usual choice for financial data where the last four digits still need to be readable.

Introduce a detection safely

monitor_selected_request_datarequest

runs on requestpriority 200

WhenApplication method typeis any ofchatresponsesassistantssdk_check
anddata foundis any ofEmail AddressPhone Number
Then
Sensitive data actionmonitor
Risk levellow

Publish on monitor, read a week of activity, then raise it. A low priority keeps it clear of real enforcement rules.

Stop prompt attacks at ingress

block_prompt_attacks_at_ingressrequest

runs on requestpriority 1000

Whendata foundis any ofPrompt Injection TechniquesJailbreak Techniques
Then
Sensitive data actionblock
Risk levelvery_critical

Adversarial detections are ordinary data types, so prompt-attack defence has the same shape as secrets defence.

Several data types, several actions

A configuration on the Data & Adversarial Risks card holds as many data rules as you need. Each rule picks its own data types and its own action; they all share the configuration's scope and priority. Add data rule adds another.

support_copilot_data_actionsrequest

runs on requestpriority 700

Data rule 1
WhenApplicationisSupport Copilot
anddata foundis any ofAadhaar Number / VID
Then
Sensitive data actionredact
Risk levelhigh
Data rule 2
WhenApplicationisSupport Copilot
anddata foundis any ofName
Then
Sensitive data actionmonitor
Data rule 3
WhenApplicationisSupport Copilot
anddata foundis any ofAuth & Secrets
Then
Sensitive data actionblock
Risk levelcritical

One request carrying an Aadhaar number, a customer name and an API key has the Aadhaar redacted, the name left alone but recorded, and the whole call refused because of the key. Adding a rule copies the scope from the rule above it, so you only pick the data types and the action.

Actions are scoped to the data each rule selected

redact and partial-redact rewrite only the findings their own data found condition selected. The Aadhaar rule redacts Aadhaar numbers; it does not touch the name beside them. A monitor rule leaves its own findings alone and cannot suppress another rule's redaction.

A finding that no rule selects is left unchanged. Where two rules select the same finding, the higher policy priority wins, and at equal priority the more restrictive action wins. Rules inside one configuration share a priority, so they never compete with each other.

Block is a decision about the call

block stops the whole request rather than stripping the finding out of it. redact, partial-redact and monitor all operate finding by finding.

Use separate configurations instead when the rules need different scopes or priorities, for example one for an application and another for a Smart Group exception. Rules that share a scope belong in one configuration.

Governing tool calls

Tool Controls decides whether a call may proceed at all, separately from what data it carries, so an agent keeps its read tools while losing its dangerous ones.

deny_public_repository_creationrequest

runs on requestpriority 950

WhenTool nameiscreate_repository
andTool arguments . visibilityispublic
andany of the following
WhenTool arguments . owner_typeisorganization
orTool tagshas entrywrite
Then
Tool call accessdeny
Risk levelhigh
block_secrets_in_tool_argumentsrequest

runs on requestpriority 925

WhenApplication method typeis any ofchatresponses
andTool nameis set
anddata foundis any ofAuth & Secrets
Then
Sensitive data actionblock
Risk levelcritical

is set is a presence test needing no value. It narrows the rule to calls carrying a tool invocation, leaving ordinary chat traffic alone.

Denying access

Gateway Access rejects the whole call before any model is contacted: no tokens spent, no provider round trip, and the data rules never run because the request never proceeds.

Deny a person completely

deny_offboarded_usersrequest

runs on requestpriority 1000

WhenUser emailis any ofj.doe@acme.comr.patel@acme.com
Then
Request accessdeny
Risk levelcritical

One condition, no application scope, so these people are refused on every gateway application, every model and every method. Use this shape while a leaver's credentials are still being revoked upstream.

Deny a group for particular models

deny_frontier_models_to_internsrequest

runs on requestpriority 800

WhenSmart groupsincludes (ignoring case)Interns
andRequested modelis any ofclaude-opus-4gpt-4.1o3
Then
Request accessdeny
Risk levelmedium

Interns keep full gateway access and are refused only when they reach for an expensive frontier model. Swap the group row for User email is any of to do the same for one person.

The allow-list alternative

restrict_interns_to_small_modelsrequest

runs on requestpriority 700

WhenSmart groupsincludes (ignoring case)Interns
Then
Allowed modelsgpt-4.1-miniclaude-haiku-4.5

Same intent, opposite construction. The card above denies three named models and must be edited every time a new frontier model appears; this one names the two models Interns may use, so anything new is excluded by default. Prefer this shape unless you specifically need the denial recorded as a blocked call.

Everyone except

finance_copilot_platform_team_onlyrequest

runs on requestpriority 850

WhenApplicationisFinance Copilot
andSmart groupsdoes not include (ignoring case)Finance Platform
Then
Request accessdeny
Risk levelhigh

A negated membership test turns one rule into a default-deny for an application. Anybody outside Finance Platform is refused, and new joiners are covered the moment they are added to the group.

Choosing how to stop a call

To stop a callUseWhat the caller sees
Refuse it outrightGateway Access denyRejected before any provider is contacted. No tokens, no cost, counted as a blocked call.
Narrow the choiceAllowed ModelsOnly the listed models are available. Anything new is excluded until you add it.
Stop one toolTool Controls denyThe call proceeds; that tool invocation does not.
Stop the contentSensitive data action blockStopped only when a detection fires. The same person's clean requests still run.

Runtime, routing and limits

Several cards can contribute to one configuration, giving a whole operating profile in a single sentence.

secure_coding_routesrequest

runs on requestpriority 700

WhenApplication method typeis any ofchatresponses
andRequested modelmatches pattern*code*
Then
Guardiantrue
Dependency security checktrue
Latest version suggestionstrue
Task adherence sensitivityhigh
Task adherence actionblock
Allowed modelsquilr-code-largequilr-code-fast
Concurrency limit20
Tokens per request100,000
Timeout90s

matches pattern with *code* covers any model whose name contains "code", so a newly released coding model inherits the whole profile with no policy change.

govern_production_gateway_accessrequest

runs on requestpriority 850

WhenRequest metadata . environmentisproduction
andApplication method typeis any ofchatresponsesembeddings+4
Then
Require identitytrue
Require conversation IDtrue
Allowed source IP ranges10.0.0.0/82001:db8:1200::/48
Allowed modelsgpt-4.1claude-sonnet-4
Routing groupproduction-safe
Rate limit600 per minute
Input token limit2,000,000 per hour
Per-model limits2 models
gpt-4.1 concurrency 20, 300 per minute, total tokens 128,000, timeout 90sclaude-sonnet-4 concurrency 20, 300 per minute, total tokens 128,000, timeout 90s

Keyed on your own request metadata, so production gets a perimeter that development never sees: no separate application, no duplicated settings.

Budgets and spend

Budgets are a structured setting, so the card opens a form rather than a single value. Each budget in the list applies independently.

FieldOptions
MeasureSpend (USD), Requests, Input tokens, Output tokens, Total tokens
LimitBudget limit in USD for spend, otherwise a usage limit
Budget periodCalendar or rolling (hour, day, week, month, year), or Lifetime with no reset
Reset timezoneCalendar periods only. Calendar weeks start Monday.
Separate budget for eachEmpty for one shared budget, or per User email, application or model. Multiple fields create an allowance per combination.
Budget IDThe key usage is tracked against
support_copilot_budgetsrequest

runs on requestpriority 500

WhenApplicationisSupport Copilot
Then
Named usage quotas2 budgets
Budget 1 Spend (USD), 500, Calendar month, Asia/Kolkata, separate for each User email, id support_user_monthly_usdBudget 2 Total tokens, 10,000,000, Rolling week, shared across matching traffic, id support_team_weekly_tokens
Token pricing2 models
gpt-4.1 input $2.50 per 1M tokens, output $10.00 per 1M tokensclaude-sonnet-4 input $3.00 per 1M tokens, output $15.00 per 1M tokens

Budget 1 gives every person their own 500 USD monthly allowance; Budget 2 caps the whole application at 10M tokens a rolling week. Both must hold, so an individual staying under budget can still be stopped by the team cap.

The Budget ID matters

Usage is tracked against the ID. Keep it when changing the amount and recorded usage carries over. Changing the measure, period, timezone or grouping after publishing needs a new unique ID and starts a fresh count.

Spend budgets need model prices

Spend budgets require input and output prices in USD per 1 million tokens for every matching provider and model. Requests without a matching price are blocked. Set prices once under Settings, Models.

Token savings and Prompt Store

compress_document_ingestionrequest

runs on requestpriority 300

WhenApplicationisDoc Ingestion Pipeline
andApplication method typeis any ofchatresponses
Then
JSON compressiontrue
HTML to texttrue
Markdown to texttrue
Text compressiontrue

Savings show up as tokens saved in the activity view, so you can prove the reduction rather than assume it. See Token Saving for the cross-product guide.

require_approved_system_promptsrequest

runs on requestpriority 600

WhenRequest metadata . environmentisproduction
andApplication method typeis any ofchatresponses
Then
Require Prompt Store system prompttrue

Production traffic must use a reviewed system prompt while development traffic stays free to experiment. See Prompt Store.

Response quality

monitor_high_confidence_hallucinationsresponse

runs on responsepriority 500

WhenApplication method typeis any ofchatresponsesbedrockvertex
Then
Hallucination checktrue
Hallucination threshold0.82
Hallucination risk levelhigh
Hallucination actionmonitor

The threshold is the confidence at which a response counts as a hallucination. Start at monitor, then move either the action or the threshold.

Scoping to people and groups

Every card carries one-click scope shortcuts, which add the condition and lift the priority so the narrower scope wins automatically.

ShortcutSeeded priority
User900
Smart group700
Application600

No conditions means everyone. An individual exception therefore outranks a group rule without you choosing numbers.

support_team_pii_exceptionrequest

runs on requestpriority 800

WhenApplicationisSupport Copilot
andSmart groupsincludes (ignoring case)Support Tier 2
anddata foundis any ofPersonally Identifiable Information (PII)
Then
Sensitive data actionmonitor
Risk levelmedium

An exception layered above a stricter default. If the tenant-wide PII rule redacts at priority 750, this monitors at 800, so Support Tier 2 sees unredacted data in the Support Copilot application only.