- 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
| Field | Range / values | What it does |
|---|---|---|
enabled | bool | Master toggle. Off, scan endpoints return 503. |
injection_model | HuggingFace model id | Which classifier to use. Default is the bundled ONNX‑quantized DeBERTa. |
max_text_length | 256–200000 | Bytes. Input is truncated before scoring. |
log_events | bool | Persist a row to the event table per scan. Off, the firewall is invisible. |
pre_prompt | string ≤ 20000 chars | System prompt injected by the proxy. Admin‑trusted, not scanned. |
pre_prompt_placement | prepend / append / sandwich | Where the pre‑prompt goes relative to the user’s messages. |
agentic.max_arg_bytes | 256–1000000 | JSON‑serialised argument size cap for tool‑call scanning. |
agentic.allow_private_network | bool | Disable SSRF blocks for RFC1918 / loopback. Use only for on‑prem agents. |
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
| Field | Range / values | What it does |
|---|---|---|
thresholds.block | 0.0–1.0 | Input verdict becomes block at or above this score. |
thresholds.redact | 0.0–1.0 | Input verdict becomes redact at or above (and below block). |
thresholds.output_block / output_redact | 0.0–1.0 | Same, applied to model output traffic. |
detectors.injection | bool | Run the prompt‑injection classifier on input. |
detectors.pii | bool | Run PII / secret detection (input and output). |
detectors.embedding_anomaly | bool | Score the prompt against the App’s embedding baseline. Flags out‑of‑distribution traffic. |
detectors.perplexity | bool | Score perplexity to catch fuzzed / obfuscated prompts. |
detectors.topic_drift | bool | Track topic distribution drift across the App’s traffic window. |
detectors.agentic_guardrails | bool | Apply tool‑call rules in tool_policy plus the SSRF / shell / SQL guards. |
custom_phrases | array of strings | Phrase pack. Exact / fuzzy hits force block regardless of model score. |
pii_rules | array | App‑scoped regex PII rules. Validated for catastrophic backtracking before accept. |
tool_policy.allowlist / denylist | array of strings | Per‑App tool gates. Combined with workspace‑level rules. |
routing.forbidden_providers | array of strings | Reverse proxy refuses traffic to these upstreams (e.g. ["openai", "groq"]). |
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.
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>".
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.

