Model Integrity Verification Guide
Before any LLM is deployed on classified infrastructure, its integrity must be verified. Covers SHA256, SBOM, supply chain attack indicators, and chain of custody for air-gapped deployments.
🎯 Supply Chain Attack Vectors for LLM Models
An adversary targeting your air-gapped SOC cannot attack the LLM API (there is none). Instead, they target the model file itself during acquisition and transfer. Understanding the attack surface is the first step to defending it.
Risk matrix by acquisition method
| Acquisition Method | Tampering Risk | Mitigation |
|---|---|---|
| Official Hugging Face (HTTPS + verified publisher) | Medium | Hash verification against published values |
| Third-party mirror or alternative download site | High | Do not use — always use official sources only |
| USB transfer from staging to air-gapped (internal) | Medium | Encrypt before transfer, verify hash on destination |
| Optical media (write-once CD/DVD/BD-R) | Low | Write-once media cannot be modified after burning |
| Data diode transfer | Very Low | One-way hardware enforces no return channel |
| Torrent / P2P download | Critical | Never use — completely unverifiable provenance |
✅ Step-by-Step Verification Procedure
Copy
🔒 Trusted Download Sources Only
| Model Family | Official HF Account | Verified GGUF Provider | Official Hash Source |
|---|---|---|---|
| Llama 3.1 / 3.2 | meta-llama | bartowski (verified quantisations) | HF file listing + meta.ai |
| Mistral / Mixtral | mistralai | mistralai (official GGUF) | HF file listing |
| Phi-3 / Phi-3.5 | microsoft | bartowski or microsoft | HF file listing |
| Qwen 2.5 | Qwen | Qwen (official GGUF) or bartowski | HF file listing |
| Gemma 2 | bartowski | HF file listing |
How to verify a Hugging Face account is legitimate
🚨 Indicators of a Compromised Model
Post-deployment, these behavioural indicators may suggest the model file was tampered with. No single indicator is conclusive — look for patterns.
Monitoring commands for deployment integrity
📋 Chain of Custody Template
Every LLM deployed on classified infrastructure needs a documented chain of custody from download to deployment. This is the minimum required record.
📦 Software Bill of Materials (SBOM) for LLM Deployments
An SBOM for your LLM deployment documents every software component — model file, inference runtime, Python packages, and system libraries. Essential for vulnerability management and regulatory compliance in classified environments.
Generate SBOM for your LLM stack
Minimum SBOM contents for classified LLM deployment
| Component | What to record | Why |
|---|---|---|
| Model file(s) | Filename, size, SHA256, source URL, version/tag | Primary integrity reference |
| Inference runtime | Ollama/vLLM version, installation package SHA256 | Runtime vulnerabilities affect security |
| Python version | Exact version string, source package hash | Python CVEs regularly affect inference stacks |
| CUDA / ROCm version | Driver version, toolkit version | GPU driver vulnerabilities are high-severity |
| Key Python packages | torch, transformers, safetensors — exact versions | LLM loading libraries have had supply chain attacks |
| OS and kernel | Ubuntu version, kernel version | Patching schedule baseline |
| Web UI (if deployed) | Open WebUI version, npm package hashes | Web components are common attack surface |