Observatory defense blueprint · ATO.M0005

Safe Weight Serialization & Artifact Malware Inspection

Mandate SafeTensors weight serialization and pre-load bytecode scanning (ModelScan/Fickling) to eliminate arbitrary code execution when loading model checkpoints.

Control blueprint overview

Control ID
ATO.M0005
Framework
Observatory defense blueprint
Stack layers
Tool/Sandbox Boundary · Pre-Training · Network/IAM
Techniques addressed
0
OWASP LLM Top 10
NIST AI RMF
Reference URI
https://observatory.silvauren.com/catalog/mitigations/ato-m0005/

Open ATO.M0005 in Interactive Defense Workbench

Control mechanism

Replaces Turing-complete Python `pickle` checkpoint deserialization with SafeTensors (strict JSON header + pure numeric byte offsets) and inspects any unavoidable legacy `.pt`/`.pkl`/`.h5`/SavedModel archives via static opcode analysis (ModelScan, Fickling) inside network-isolated workers before loading into GPU memory.

Implementation steps

  1. Configure training/serving loaders to enforce `use_safetensors=True` and `weights_only=True` everywhere, failing hard on raw pickle checkpoints.
  2. Integrate Protect AI ModelScan and Trail of Bits Fickling into artifact-mirror CI gates to block unsafe `__reduce__`, `os`, `subprocess`, or `eval` opcodes.
  3. Convert any verified legacy checkpoints into SafeTensors inside an ephemeral air-gapped microVM before internal distribution.
  4. Block `trust_remote_code=True` across Hugging Face pipelines unless pinned to an audited, signed internal commit SHA.

What this control stops

Known bypass conditions & residual risk

Latency, usability & false-refusal trade-offs

Latency: Improves model load startup speed via zero-copy `mmap`; 0 ms inference overhead. | False-Refusal Risk: None; legacy research repos shipping `.bin`/`.pt` require a one-time automated quarantine conversion. | Operational Cost: Low; drop-in CI scanners and loader policy checks.