Chapter 8. AI Supply Chain Security & Shadow AI: components and the kill-switch
Three scenes from one bank. First: an engineer downloads a fine-tuned model for Kovcheg from a public hub — a pickle checkpoint with a silent backdoor that executes code when the weights load (a real attack class, documented by JFrog on Hugging Face). Second: an employee who finds Kovcheg slow copies a customer statement into a public chatbot — the bank's data has left for Shadow AI. Third: Kovcheg's agentic branch starts behaving anomalously, and it turns out there's nothing to stop it with — per a 2026 Saviynt report, only 5% of security leaders are confident they could contain a compromised agent.
This chapter covers the supply-chain plane and the last line of defense, the kill-switch: protecting the stack from poisoned models and vulnerable components, blocking unauthorized AI services, and the technical ability to stop autonomous agents in an emergency.
The customer's business goal
Know what an AI system is built from, keep unverified components out, stop data leaking into Shadow AI, and be able to stop an agent instantly. Promises to the business:
- Every component (weights, dataset, prompt, library) is registered and verified.
- Corporate data doesn't leak to unauthorized AI endpoints.
- Any agent can be stopped and rolled back to a safe state — and that's been tested.
Driver: threat or regulator
- OWASP LLM: LLM03 (Supply Chain), LLM04 (Data & Model Poisoning), LLM06 (Excessive Agency).
- Malicious weights: a pickle/checkpoint with executable code → RCE on load.
- Shadow AI: 2026 estimates put ~78% of employees using unauthorized AI tools; Shadow AI agents and unmanaged machine identities are a growing vector (the "144:1" machine-to-human identity problem).
- An unstoppable agent: the AI Act (Art. 14) requires human oversight — including the ability to intervene and stop it.
Architectural pattern
AI Circuit Breaker & Kill-Switch Architecture — a component registry (AIBOM) + scanning + perimeter control + a multi-layered stop mechanism. The kill-switch isn't one button — it's a layered set of deterministic controls: interrupt the session, revoke credentials and tool access, roll back to a safe state.
Engineering stack & providers
- AIBOM: CycloneDX ML-BOM (the ECMA-424 standard, 2nd ed., Dec 2025; component types: model, llm_endpoint, agent, mcp_server, tool, embedding, vector_store, dataset, retriever…); Syft/Grype, Cisco AIBOM.
- Model scanning: ModelScan, picklescan; prefer Safetensors (doesn't execute code on load; under the PyTorch Foundation/Linux Foundation since April 2026).
- Perimeter/Shadow AI: next-gen CASB/SWG (Netskope, Zscaler) that block unauthorized AI endpoints.
- Self-host / control: OpenLLM / vLLM; OPA + feature flags for the kill-switch.
Engineering implementation
### Step 1. AIBOM in CI
Auto-generate an ML-BOM (CycloneDX): what, where from, version, license, hash — for weights, datasets, system prompts, libraries, and also agents, MCP servers, and vector stores. A manual registry goes stale — generate it in the pipeline only.
### Step 2. Scanning weights before deployment
model artifact → ModelScan/picklescan → [code inside?] ─yes→ block + alert
│no
prefer safetensors ────┴→ verify hash/provenance → deploy
### Step 3. Blocking Shadow AI
CASB/SWG detects and blocks corporate traffic sent to unauthorized external AI endpoints. The sanctioned gateway (ch. 5) is the only legal path to models. Important: a ban with no convenient legal alternative breeds Shadow AI (see ch. 10, over-governance).
### Step 4. AI kill-switch as external state
The kill-switch is implemented as a state machine, not an "if" in code: a flag in the policy engine / a feature flag that every service and agent is required to check before acting. Layers:
- interrupt the current session/agent loop;
- revoke short-lived credentials and tool access (MCP scopes, API keys);
- roll back to a safe state (freeze unfinished actions — ch. 9).
### Step 5. Least privilege for agents
An agent's tools get minimal scopes, short-lived and revocable credentials, and a sandbox (details — ch. 9).
Where it breaks
- An untested kill-switch doesn't work. An unrehearsed "stop" fails at the moment of an incident — hence the 5% confidence figure. Regular chaos-drill agent stops are mandatory.
- Distributed agents. Stopping a swarm is harder than stopping a single process; you need a centralized revocation point — but that's also a single point of failure. Balance against ch. 5.
- AIBOM goes stale without CI auto-generation — it drifts from what's actually deployed.
- CASB gets bypassed. Personal devices/networks outside the perimeter; full control is unattainable — reduce it, don't expect to zero it out.
- Poisoning stays hidden. A scanner catches executable code, not "logical" dataset poisoning (backdoor triggers in data) — that's an eval/red-team job (ch. 3, 7).
- Safetensors isn't a cure-all. It removes RCE on load but doesn't guarantee the weights themselves are "clean" (behavioral backdoors remain).
Standards and mapping
- OWASP LLM: LLM03, LLM04, LLM06.
- ISO/IEC 42001: supplier, change, and incident management.
- NIST AI RMF: Manage (third-party, incident response).
- EU AI Act: Art. 14 (oversight, kill-switch as part of it), Art. 15 (cybersecurity/robustness).
- CycloneDX / ECMA-424: the AIBOM format.
Lab and artifact
Generate a CycloneDX ML-BOM for Kovcheg (including the vector store and MCP servers); run the weights through ModelScan, show a block on a pickle backdoor and a switch to safetensors; configure the kill-switch as a policy flag and run a drill stopping an agentic branch with credential revocation; simulate a Shadow AI endpoint and a CASB block. Artifact: an AIBOM + a scan report + a kill-switch test protocol (evidence of oversight for chapters 6, 10).
Maturity checklist
- L1: a list of models/dependencies, manual weight scanning.
- L2: an AIBOM (CycloneDX) in CI, auto-scanning, CASB blocking of Shadow AI, a kill-switch exists.
- L3: regular kill-switch drills, least-privilege agents, weight provenance/hash verification, an incident runbook, safetensors by default.
Sources
- [Machine Learning Bill of Materials (CycloneDX)](https://cyclonedx.org/capabilities/mlbom/)
- [Malicious Hugging Face models with silent backdoor (JFrog)](https://jfrog.com/blog/data-scientists-targeted-by-malicious-hugging-face-ml-models-with-silent-backdoor/)
- [AI Agent Kill Switches: can you actually stop one in 2026?](https://nerdleveltech.com/ai-agent-kill-switch-containment)
- [Shadow AI Agents: the insider threat (Cloud Security Alliance)](https://cloudsecurityalliance.org/blog/2026/05/26/shadow-ai-agents-the-insider-threat-you-re-not-monitoring-yet)
- [SafeTensors format guide (DataCamp)](https://www.datacamp.com/blog/safetensors-format)
How it actually works — engineering breakdowns
Standalone howto from practice, showing this control plane on real code and a working artifact.
- Enterprise code bastion: Claude works on code with no file or shell accessLeast-privilege and sandbox: the agent works with no file or shell access.
- The Skill That Onboards Other SkillsOnboarding new components by the rules, in a sandbox.
Read next
Putting AI into production under regulatory risk?
Designing the control plane for your system: privacy, access, guardrails, audit, EU AI Act / ISO 42001 compliance — as working architecture, not a policy PDF.
Email meThe transition engine
Next Move Engine — the system that takes a team to an autonomous delivery loop.
Next Move Engine →