- Workspace: master toggle, classifier model, metering, optional proxy pre‑prompt. One per tenant.
- App: thresholds, detectors, custom phrases, custom PII rules, tool policy, forbidden‑provider routing. Many per workspace.
Workspace config
Endpoints
GET /api/runtime-security/config, requiresruntime_security.view.PUT /api/runtime-security/config, requiresruntime_security.manage. Togglingenabledscales the firewall service up or down.
Payload
App config
Endpoints
GET /api/runtime-security/apps/{id}/config-versions, list version history.PUT /api/runtime-security/apps/{id}/config, publish a new version.
config_version_number linked to the event
row that produced it. The change_summary field captures the
operator’s reason.
Payload
Custom PII rules
Two layers, both queried at scan time:- Per‑App rules,
pii_ruleson the App config above. Edited inline; versioned on every write. - Workspace‑shared rules, set via the Custom Rules endpoints
(
/api/custom-rules/...). Apply across the workspace and across batch / data‑integrity workflows.
NER PII detection
The regex / entropy detectors indetectors.pii are precise on
structured PII (email, phone, IBAN with mod‑97 validation, API
keys) because those have a lexical shape a pattern can anchor on. They’re
blind to unstructured PII: person names, street addresses, dates
of birth. detectors.ner adds a zero‑shot transformer NER tier
(GLiNER2‑PII, Apache‑2.0, fastino/gliner2-privacy-filter-PII-multi)
on top for exactly that gap.
On overlapping spans, the regex tier always wins: a checksum‑validated
IBAN is strictly more trustworthy than a token classifier reading the
same characters. NER only ever adds findings the pattern tier couldn’t
see.
AppNerPolicy
Recommended configurations
Benchmarked against ai4privacy (general PII) and NCBI‑disease / synthetic clinical notes (medical):
Latency is CPU‑bound and independent of these choices: p50 ≈ 130–140ms,
p99 ≈ 200ms per scan once the model is warm.
Model status
runtime_security.view. Also warms the model: the first
call kicks off the (~40s) background load so the tier is ready before
traffic needs it. Poll this after enabling detectors.ner for the
first time, or to render a live status badge in your own tooling.
The tier fails open at every stage: cold model, load error, or a slim
image with no
gliner2 package all just mean NER findings are absent
for that scan. Every other detector still runs.
Pre‑prompts on the proxy
Admins can configure a system message that the proxy auto‑prepends (or appends, or sandwiches) to every request. The pre‑prompt is admin‑trusted and not scanned. It’s rewritten into the right shape for each provider:messages[]for OpenAI and OpenAI‑compatible.systemblock for Anthropic and Bedrock.systemInstructionfor Gemini and Vertex.
Forbidden providers
Setrouting.forbidden_providers on an App to refuse traffic to
certain upstreams. Useful for data‑residency requirements (an
EU‑only App might forbid openai, groq, and bedrock US regions).
Refused requests return a provider‑shaped error with verdict block
and blocked_reason="provider_forbidden:<name>".
Environment variables
Most tuning lives in the App / workspace config APIs above. A smaller set of knobs (mostly about detector rollout, fail‑posture, and abuse caps) are process‑level env vars, useful for self‑hosted deployments. None of these require a config‑API round trip; they take effect on process restart.The perplexity defaults above were retuned this release (previously
1500 / 5000, which was high enough that the detector effectively
never fired). If you run with
detectors.perplexity enabled and
rely on the old defaults implicitly, expect more redact verdicts
from this tier after upgrading. Re‑tune per your own corpus via the
env overrides if that’s not what you want.Common workflows
Tighten the firewall for one App
Tighten the firewall for one App
PUT .../apps/{id}/configwith lower thresholds and a clearchange_summary.- Watch the drift dashboard for verdict mix shifts over 24h.
- Roll back via the version history if anything looks wrong.
Add a workspace‑wide custom PII pattern
Add a workspace‑wide custom PII pattern
- Use
POST /api/custom-ruleswith the regex. - New scans pick it up within ~30 seconds.
- Test in the dashboard before relying on it.
Roll out a system pre‑prompt safely
Roll out a system pre‑prompt safely
- Set
pre_promptwithpre_prompt_placement="prepend". - Run synthetic traffic through every App to confirm the new system message doesn’t break behaviour.
- Promote to production by enabling on the workspace config.

