Skip to main content

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 in1 Surface2 Isolate3 Authenticate4 Authorize5 Data6 Anti-injection7 Anti-DoS8 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 defaultSeparate untrusted codeLimit what a model can doKeep 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.

ControlProvided 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 endpointsDIAL
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 apartDIAL
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 thereDIAL
Expose only the ingress and only the intended paths. Keep storage, cache, adapters, interceptors and the untrusted cluster off the public internetOperator
Configure only the models, applications and toolsets in use, and keep routes few, narrowly matched and limited to specific rolesOperator
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.

ControlProvided 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 themDIAL
Untrusted workloads run on their own Kubernetes cluster and nodes, reachable only from the trusted side and on one port, enforced at the network layerOperator
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-listsOperator
Pod security forbids privileged containers, host networking and host path mounts. Without it, network policy can be bypassed from inside a podOperator
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 itOperator

See also: Data protection and isolation.

Layer 3 · Authenticate

Protects: every vector except those from LLMs / External Systems, which present no identity to check.

ControlProvided 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, GoogleDIAL
API keys held by DIAL Core for programs, short-lived per-request keys for internal calls, and key comparison written to resist timing attacksDIAL
The identity provider itself: multi-factor authentication, conditional access, session length, and processes for people joining, moving and leavingOperator
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 IstioOperator

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.

ControlProvided by
Role-based access control from the roles in the user's token, deciding which models and applications each user may useDIAL
Administrative operations require a separate administrator role, so changes to the whole installation need a distinct privilegeDIAL
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 writeDIAL
Access is checked on every request for a resource, not once at sign-in, and against the resource's owning bucket rather than its pathDIAL
Groups and roles in the identity provider, and how they map onto DIAL rolesOperator
Kubernetes RBAC, cloud permissions for storage and keys, and separation of duties over who may change configurationOperator

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.

ControlProvided 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 ciphertextDIAL
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 itDIAL
Logging of prompts can be switched off per API key, and the user identity in logs is pseudonymized by defaultDIAL
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 zoneDIAL
Storage-level encryption at rest, performed by the storage service, and the KMS behind application-level encryption, with its key policy and rotationOperator
A secrets vault connected through the Secrets Store CSI driver, and workload identityOperator
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 onOperator
TLS in transit, retention and lifecycle rules, backup and recovery, and data residency through the choice of region and providerOperator

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.

ControlProvided 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 storedDIAL
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 objectsDIAL
What model output can trigger is limited: toolsets declare which MCP servers and tools a model or application may callDIAL
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 approvalDIAL
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 interceptorDIAL
The interceptors themselves and the policy they enforce, including prompt-injection and content checksOperator
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 identitiesOperator
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 firewallOperator
A web application firewall at the edge where policy requires one, and regular patching of deployed imagesOperator

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.

ControlProvided by
Token, request and cost limits per API key and per role, over periods from a minute to a month, with usage accounting behind themDIAL
A maximum size for stored resources, and a smaller limit for what may enter the cache, so one large object cannot push out cached dataDIAL
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 collectionDIAL
Idle and connection timeouts, and a limited pool of connections to upstream servicesDIAL
Weighted load balancing with failover across model provider endpointsDIAL
Distributed locks that serialize concurrent writesDIAL
A maximum request size at the ingress, and limits on the duration or volume of streamed model responsesOperator
CPU, memory and run-time limits for code workloads, and storage quotas per userOperator
DDoS protection and connection rate limiting at the edge, autoscaling, and enough quota with model providersOperator

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.

ControlProvided 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 componentsDIAL
Token and cost accounting by project, deployment and userDIAL
Chat completion logs: a record of what was asked and what was answeredDIAL
A separate audit log for credentials DIAL uses on a user's behalf with external services, recording failures as well as successesDIAL
An optional analytics service that derives topics, sentiment, language, user counts and cost using self-hosted models, and stores only the resultsDIAL
The monitoring stack — for example Vector, InfluxDB and Grafana — and network flow visibility such as HubbleOperator
Forwarding to a SIEM with retention and alerts, on-call, anomaly detection on usage and spend, posture monitoring, and incident responseOperator

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.

Further reading​