Skip to main content
Some data cannot leave the building. Defence, intelligence, government, and certain financial and healthcare workloads operate under data handling requirements that prohibit cloud egress entirely. This reference architecture deploys the complete Cognisafe stack — inference, scoring, observability, and identity — within an air-gapped enterprise perimeter with zero runtime internet dependency.

When to use this pattern

This architecture is appropriate when your workload must satisfy any of the following:
  • UK/US government classification — IL3, IL4, CUI, OFFICIAL-SENSITIVE, or SECRET handling requirements prohibit sending data to commercial cloud APIs
  • NHS DSPT — patient data must remain within NHS-approved infrastructure; commercial LLM APIs do not hold DSP Toolkit accreditation
  • Financial services — FCA SYSC 8.1 operational resilience requirements, or internal risk committees that prohibit sending trading or customer data to third-party AI providers
  • ISO 27001 with contractual data residency — customer contracts specify that data must remain within a defined geographic or network boundary
If your organisation uses Azure Government, AWS GovCloud, or a commercial cloud at a compliant classification level, consider the Azure OpenAI + APIM pattern instead — it may satisfy your requirements with less operational overhead.

Infrastructure requirements

Architecture

Implementation

1

Mirror container images to the private registry

This step requires temporary internet access on an internet-connected machine (not in the air-gap). Pull, scan, and push all required images before disconnecting.
Transfer model weights separately (they are too large for a container image). Use a secure transfer medium (encrypted USB, secure file transfer appliance):
Verify checksums after transfer into the air-gap before loading into vLLM.
2

Deploy vLLM as the production inference server

Deploy vLLM on the GPU inference nodes. Mount model weights from a local NFS share or hostPath volume.
vLLM’s API is OpenAI-compatible. The Cognisafe proxy UPSTREAM_URL points at http://vllm-llama3.inference.svc.cluster.local:8001.
3

Deploy Llama Guard 3 as the safety scoring model

Run a separate vLLM instance for Llama Guard 3. The Cognisafe safety worker calls this endpoint instead of the commercial OpenAI API.
Configure the Cognisafe safety worker to use Llama Guard as its scoring backend:
The LLM-as-judge scorer will query Llama Guard using the OpenAI-compatible chat completions API at the local endpoint. No internet egress occurs.
4

Deploy the Cognisafe stack pointing at local vLLM

Set environment variables to point all Cognisafe components at the local infrastructure. Use Kubernetes Secrets for sensitive values.
Apply the Cognisafe Helm chart with these overrides:
5

Configure Keycloak as the OIDC provider

Keycloak bridges your on-premises Active Directory to OIDC, which Cognisafe’s web UI uses for authentication (via Clerk-compatible OIDC or direct OIDC integration).
In the Keycloak admin console:
  1. Create a realm: cognisafe
  2. Add a User Federation: LDAP — point at your Active Directory domain controller
  3. Sync users from AD
  4. Create a Client: cognisafe-web — Client Protocol: openid-connect, Access Type: confidential
  5. Set Valid Redirect URIs: https://cognisafe.internal.example.com/*
Configure Cognisafe to use Keycloak:
6

Disable Stripe — provision subscriptions manually

Set STRIPE_SECRET_KEY to an empty string. The Cognisafe API falls back to reading subscription tier directly from the subscriptions table when Stripe is not configured.Insert a manual subscription row for each project:
Enterprise tier has no request limit. All users on an air-gapped deployment should use the enterprise tier — billing is handled through your existing procurement process, not Stripe.
7

Route alerts to internal SMTP or Splunk

Disable Resend (the cloud email provider) and configure Cognisafe to deliver alerts via your internal SMTP relay or Splunk HTTP Event Collector.Internal SMTP:
Splunk HEC (preferred for SOC integration):
The Cognisafe webhook payload is JSON and maps directly to a Splunk sourcetype. Create a Splunk saved search on sourcetype=cognisafe threat_detected to drive your SOC alerting rules.

Egress requirements

“Zero-egress runtime” means no network connections leave the air-gap boundary during normal operation. This includes NTP (use an internal NTP server), DNS (use internal resolver), and certificate revocation (pre-load CRLs or use OCSP stapling with cached responses).

Model selection

Production inference

Llama 3.1 70B Instruct — Best open-weight general model at time of writing. Requires 2× A100 80 GB with tensor parallelism. Competitive with GPT-4o on instruction following and coding.Mistral Large 2 — Strong alternative; slightly lower VRAM requirement. Consider for cost-constrained deployments.Llama 3.1 8B Instruct — For low-latency use cases or constrained GPU budgets. Fits on a single A10G.

Safety scoring

Llama Guard 3 8B — Meta’s purpose-built content safety classifier. Trained specifically for LLM input/output classification across OWASP LLM risk categories. Fits on a single A10G 24 GB.ShieldLM — Alternative if Llama Guard 3 is not available in your approved software list.

Compliance posture

For accreditation evidence packs, export the following from Cognisafe:
  • llm_requests table (full, or time-bounded) — demonstrates audit trail
  • safety_scores table — demonstrates content screening
  • Keycloak audit log (realm events) — demonstrates access control
  • Trivy scan reports for all running container images

Operational runbook: model updates

Model updates require careful change management in an air-gapped environment. Follow this runbook for every update.
1

Prepare on the internet-connected build host

2

Transfer into the air-gap

Transfer the model weights and container image tarballs via your approved secure transfer mechanism. Log the transfer in your change management system (ServiceNow, Jira, etc.) with the SHA256 manifest as evidence.
3

Rolling restart with zero downtime

Update the vLLM Deployment to point at the new model path. Kubernetes performs a rolling update — the old model instance stays up until the new one is healthy.
Run a smoke test against the new model before marking the change as complete:
Never run kubectl set image or patch a Deployment with a new model path unless you have verified the SHA256 checksums of the transferred weights against the official manifest. A supply chain compromise at the model weight level is indistinguishable from a legitimate update without this check.
Configure Prometheus alerts for GPU memory utilisation and model inference latency (p99). A sudden spike in p99 latency after a model update is an indicator that the new model has different compute characteristics and may require vLLM tuning (--max-model-len, --gpu-memory-utilization) before the rollout is fully complete.