Defense in depth
This page sets out DIAL's controls in eight layers, shows which layers matter for each source of attack, and marks who provides each control: DIAL or the operator. It is for architects and security reviewers, and it assumes you have read Threat model.
Eight layers of controls
DIAL's controls are grouped into eight layers. They are designed in order: first reduce what an attacker can reach, last detect what got through. Each layer assumes the ones before it may fail.
Figure 3. The eight defense layers, in design order.
Which layers matter for each source
Active attackers are stopped mainly by the earlier layers: reducing the attack surface, authentication, authorization and anti-DoS. Passive attackers present no identity to check, so data protection, anti-injection and detection do most of the work. The matrix shows how much each layer matters for attacks starting in each zone of Figure 2.
| Attack starts in | 1 Surface | 2 Isolate | 3 Authenticate | 4 Authorize | 5 Data | 6 Anti-injection | 7 Anti-DoS | 8 Detect |
|---|---|---|---|---|---|---|---|---|
| Internet — active | ● | ○ | ● | ○ | ○ | ○ | ● | ● |
| Corporate Intranet — active | ○ | ○ | ● | ● | ○ | ○ | ● | ● |
| DIAL Custom Apps — active and passive | ○ | ○ | ● | ● | ● | ● | ○ | ● |
| DIAL - Untrusted — active and passive | ○ | ● | ● | ○ | ● | ● | ○ | ● |
| LLMs / External Systems — passive | – | ○ | – | – | ● | ● | ○ | ● |
● decisive — the main defense against this source ○ contributes – does not apply
For example, a model or tool response presents no identity, so authentication and authorization have nothing to check (–), and data protection, anti-injection and detection carry the defense (●).
The two application zones differ for a similar reason. DIAL - Untrusted runs on infrastructure the operator controls, so isolating it is decisive. DIAL Custom Apps run elsewhere, so the weight shifts to authorization, to what DIAL sends them, and to what it accepts back.
Design principles
| Expose nothing by default | Separate untrusted code | Limit what a model can do | Keep secrets out of reach |
|---|---|---|---|
| Only the models, applications, toolsets and routes an administrator configures exist as endpoints, and each capability is switched on per deployment. | Anything that runs untrusted code or calls untrusted services is a separate component, never sharing a process with DIAL Core. | Toolsets declare exactly which tools a model may call. User consent and administrator approval gate actions and publication. | Stored credentials are encrypted by DIAL with AES-GCM under keys held in the operator's KMS, so reading storage directly yields only ciphertext. |
Controls by layer
Each layer lists the attack vectors from Figure 2 it protects, and who provides each control:
- DIAL — built into the software and active in every installation, in some cases after an administrator configures it.
- Operator — set up by the operator. DIAL ships no infrastructure, so every infrastructure control is the operator's. Technologies in bold are working examples from the DIAL team's reference environments; any technology with the same result is equally valid.
Layer 1 · Reduce attack surface
Protects: Internet → DIAL - Trusted and Internet → DIAL Storage resources. Contributes to every other vector.
| Control | Provided by |
|---|---|
| Nothing is exposed by default. Only configured models, applications, toolsets and routes exist as endpoints. Within each, capabilities are switched on per deployment — tool calling, system prompts, attachments, caching, and the rating, tokenization and truncation endpoints | DIAL |
| The API surface is declared, not discovered: the API specification is generated from the code and checked in CI, so the documentation and the real API cannot drift apart | DIAL |
| A request for an invalid resource identifier gets the same response as one for a resource that does not exist, so probing cannot map what is there | DIAL |
| Expose only the ingress and only the intended paths. Keep storage, cache, adapters, interceptors and the untrusted cluster off the public internet | Operator |
| Configure only the models, applications and toolsets in use, and keep routes few, narrowly matched and limited to specific roles | Operator |
Layer 2 · Isolate
Protects: DIAL - Untrusted → DIAL - Trusted and DIAL - Untrusted → DIAL Storage resources.
DIAL makes isolation possible by keeping untrusted code in separate components. The operator's infrastructure is what actually blocks connections.
| Control | Provided by |
|---|---|
| Code applications, the code interpreter, MCP proxying and interceptors run as separate components called over HTTP, never in DIAL Core's process, and Core does not need to run next to them | DIAL |
| Untrusted workloads run on their own Kubernetes cluster and nodes, reachable only from the trusted side and on one port, enforced at the network layer | Operator |
| Outbound traffic from untrusted workloads is blocked by default and allowed only to named destinations — for example with Cilium network policy using DNS and TLS-name allow-lists | Operator |
| Pod security forbids privileged containers, host networking and host path mounts. Without it, network policy can be bypassed from inside a pod | Operator |
| A sandboxed container runtime such as gVisor or Kata Containers adds a kernel or virtual-machine boundary, where the risk of escaping a container justifies it | Operator |
See also: Data protection and isolation.
Layer 3 · Authenticate
Protects: every vector except those from LLMs / External Systems, which present no identity to check.
| Control | Provided by |
|---|---|
| OpenID Connect sign-in, with tokens (JWTs) verified against the identity provider's published keys. Several providers can be used at once: Keycloak, Microsoft Entra ID, Azure AD B2C, Auth0, Okta, Amazon Cognito, Google | DIAL |
| API keys held by DIAL Core for programs, short-lived per-request keys for internal calls, and key comparison written to resist timing attacks | DIAL |
| The identity provider itself: multi-factor authentication, conditional access, session length, and processes for people joining, moving and leaving | Operator |
| TLS and secure cookie settings at the edge, and mutual TLS between components so a service without a valid identity cannot connect — for example with Istio | Operator |
See also: Authentication and access control.
Layer 4 · Authorize
Protects: Corporate Intranet → DIAL - Trusted, Corporate Intranet → DIAL Storage resources, and DIAL Custom Apps → DIAL - Trusted.
| Control | Provided by |
|---|---|
| Role-based access control from the roles in the user's token, deciding which models and applications each user may use | DIAL |
| Administrative operations require a separate administrator role, so changes to the whole installation need a distinct privilege | DIAL |
| Sharing goes through invitations, which can be limited to a number of people and a time period. Publication goes through administrator approval rather than a direct write | DIAL |
| Access is checked on every request for a resource, not once at sign-in, and against the resource's owning bucket rather than its path | DIAL |
| Groups and roles in the identity provider, and how they map onto DIAL roles | Operator |
| Kubernetes RBAC, cloud permissions for storage and keys, and separation of duties over who may change configuration | Operator |
Roles reach DIAL inside the user's sign-in token — for example in resource_access.<client-id>.roles with
Keycloak, or in groups with Microsoft Entra ID. Each deployment lists the roles allowed to use it:
"models": {
"gpt-4o": {
"type": "chat",
"endpoint": "http://adapter/openai/deployments/gpt-4o/chat/completions",
"userRoles": ["finance-analysts"]
}
}
See also: Authorization rules and spaces, Public and private access, Access control reference.
Layer 5 · Protect data
Protects: DIAL - Trusted → DIAL Storage resources (what is written), and every vector from an attacker agent — DIAL - Untrusted, DIAL Custom Apps and LLMs / External Systems into DIAL - Trusted (what is sent out).
Data sent out of the trusted zone can reach model providers, MCP servers, code applications, the code interpreter, interceptors and custom applications — all semi-trusted or untrusted.
| Control | Provided by |
|---|---|
| Application-level encryption of stored credentials: DIAL encrypts them with AES-GCM before writing, using keys held in the operator's KMS, so reading the storage account directly yields only ciphertext | DIAL |
| Content is kept in the operator's own object storage — Amazon S3, Google Cloud Storage or Azure Blob Storage, never a vendor's — and its owner can delete it | DIAL |
| Logging of prompts can be switched off per API key, and the user identity in logs is pseudonymized by default | DIAL |
| DIAL controls what leaves: the user's sign-in token is not passed to a deployment unless that is switched on, and interceptors can redact a request before it leaves the trusted zone | DIAL |
| Storage-level encryption at rest, performed by the storage service, and the KMS behind application-level encryption, with its key policy and rotation | Operator |
| A secrets vault connected through the Secrets Store CSI driver, and workload identity | Operator |
| A redaction interceptor where data policy requires one, and the per-deployment decisions about what may leave: whether tools are on, attachments allowed, or the sign-in token passed on | Operator |
| TLS in transit, retention and lifecycle rules, backup and recovery, and data residency through the choice of region and provider | Operator |
The two kinds of encryption protect against different people. Storage-level encryption protects against physical access to disks, including by cloud provider staff, but the storage service decrypts automatically for anyone allowed to read the storage account. Application-level encryption protects even against them, and today it covers stored credentials. Conversations and files rely on storage-level encryption, so the operator should strictly limit who has direct access to storage.
See also: Data protection and isolation, Data handling and privacy.
Layer 6 · Anti-injection
Protects: every vector. Attacks from the Internet and the Corporate Intranet try classic injection against the API. Attacker agents inject through content that DIAL then acts on.
| Control | Provided by |
|---|---|
| Definitions are checked against their JSON Schema when written and when loaded, and the schemas are themselves checked against a meta-schema, so invalid or hostile input is rejected rather than stored | DIAL |
| Three classes of injection cannot occur in DIAL Core. Resources are typed objects in a bucket, not file paths, so there is no folder structure to escape. Core stores data in object storage and a key-value cache, not a SQL database. And it does not deserialize untrusted input into arbitrary objects | DIAL |
| What model output can trigger is limited: toolsets declare which MCP servers and tools a model or application may call | DIAL |
| A person can be required in the loop: a deployment can require the user's consent before acting, and publication takes effect only after administrator approval | DIAL |
| Interceptors are where content is inspected — user input, retrieved and tool content, and model output before it is returned or acted on. DIAL provides the place in the request flow; the checks belong to the interceptor | DIAL |
| The interceptors themselves and the policy they enforce, including prompt-injection and content checks | Operator |
| Least privilege for anything a manipulated model or tool could drive: the fewest tools per application, MCP servers and tools vetted before use, non-root accounts, and narrowly scoped cloud identities | Operator |
| Outbound traffic allowed only to named destinations, which stops a manipulated component from leaking data or reaching internal services — for example with Cilium domain-name policy, or a forward proxy with a DNS firewall | Operator |
| A web application firewall at the edge where policy requires one, and regular patching of deployed images | Operator |
Prompt injection has no complete solution. DIAL does not claim to detect it reliably. Instead it limits what an injected instruction can achieve: the fewest tools, explicit consent, approval before publication, and restricted outbound traffic. Consent and approval guarantee that a person is asked, not that the person checks carefully.
Layer 7 · Anti-DoS
Protects: Internet → DIAL - Trusted and Corporate Intranet → DIAL - Trusted, plus DIAL's own calls to LLMs / External Systems, because using up a model provider's quota denies service to every user.
| Control | Provided by |
|---|---|
| Token, request and cost limits per API key and per role, over periods from a minute to a month, with usage accounting behind them | DIAL |
| A maximum size for stored resources, and a smaller limit for what may enter the cache, so one large object cannot push out cached data | DIAL |
| Lists are returned in pages, with a maximum page size enforced by the server, so neither a response nor DIAL Core's memory grows with the size of a collection | DIAL |
| Idle and connection timeouts, and a limited pool of connections to upstream services | DIAL |
| Weighted load balancing with failover across model provider endpoints | DIAL |
| Distributed locks that serialize concurrent writes | DIAL |
| A maximum request size at the ingress, and limits on the duration or volume of streamed model responses | Operator |
| CPU, memory and run-time limits for code workloads, and storage quotas per user | Operator |
| DDoS protection and connection rate limiting at the edge, autoscaling, and enough quota with model providers | Operator |
See also: Usage limits and cost control.
Layer 8 · Detect and respond
Protects: every vector. Records are kept in DIAL - Trusted and DIAL Storage resources.
| Control | Provided by |
|---|---|
| OpenTelemetry tracing and Prometheus metrics. Each request records trace identifiers and the chain of deployments it passed through, so an agent's actions can be reconstructed across components | DIAL |
| Token and cost accounting by project, deployment and user | DIAL |
| Chat completion logs: a record of what was asked and what was answered | DIAL |
| A separate audit log for credentials DIAL uses on a user's behalf with external services, recording failures as well as successes | DIAL |
| An optional analytics service that derives topics, sentiment, language, user counts and cost using self-hosted models, and stores only the results | DIAL |
| The monitoring stack — for example Vector, InfluxDB and Grafana — and network flow visibility such as Hubble | Operator |
| Forwarding to a SIEM with retention and alerts, on-call, anomaly detection on usage and spend, posture monitoring, and incident response | Operator |
Switching off prompt logging for an API key (Layer 5) protects data, but also removes evidence an investigation would need. The operator makes that trade-off per key.