Sites that cannot send process data, drawings or maintenance records to a cloud AI service are running models on their own hardware instead: Ollama, llama.cpp, LM Studio or vLLM on a server inside an isolated network, with agents that call it. Isolation removes the cloud risk. It does not remove the agent risk. An agent with shell, file or MCP access can do on an isolated network what it can do anywhere else, and on an operational technology (OT) network it may be one hop from an engineering workstation.
Why isolated sites are moving to local models
For many OT networks a cloud model is not an option: the data may not leave, or the network has no route out by design. Open-weight models change that trade-off. A capable model runs on one server, and the local runtimes serve an OpenAI-compatible API, so an agent written for a cloud provider can call a model inside the plant by changing its base URL.
Government guidance points the same way. The joint Principles for the Secure Integration of Artificial Intelligence in Operational Technology, led by CISA and Australia’s ACSC in December 2025, tells operators to ask whether vendors can run on premises without continuous internet access, to avoid sharing sensitive data with models that external parties host, and to move data out of OT through one-way transfer rather than persistent inbound access.
What still crosses the gap
An air gap removes network routes. People, files and devices still cross it, and the best-documented attacks on isolated networks used exactly those paths.
Model files and tools on removable media
Stuxnet spread on removable drives and went after Siemens STEP 7 and WinCC engineering software. ProjectSauron (2016) used hidden areas on USB drives to move data out of air-gapped networks, and GoldenJackal (2024) used USB drives to carry tools in and data out. A model file is the newest thing on that drive, and not an inert one: a pickle-based checkpoint can run code when it is loaded, and a GGUF file carries a chat template written in Jinja.
Maintenance laptops
A vendor or integrator laptop that joins for a day brings its own agents, its own MCP servers and its own configuration.
Agents near engineering workstations
An agent with a shell can run a protocol client. An agent given an MCP server or a function tool for the historian or a controller can write through it.
Policy and evidence
With no cloud console, policy has to reach devices and evidence has to leave the site without a live connection.
A hardening checklist for a local-LLM enclave
1. Scan model files before they cross
Scan every model file on the transfer station before it goes on the media, and again inside. moorai-model-scan reads a file without loading or executing it and gives one verdict per file (unsafe, suspicious, clean, allowed or unscanned) with its sha256. It reads pickle and PyTorch, Keras, TensorFlow SavedModel, ONNX, GGUF (including Ollama’s extension-less blobs) and SafeTensors. It flags dangerous pickle imports and GGUF chat templates that reach Python internals, and exits 1 on an unsafe or suspicious file, so it can gate a transfer script. Known-good hashes go on an allow-list with --allow.
moorai-model-scan /media/staging --json
The scan is static: it never runs the model, so a backdoor that fires only on certain inputs is out of its reach.
2. Keep inference on loopback, or inside the enclave
Treat the enclave as its own zone, in the zones-and-conduits sense of IEC 62443-3-2, with the transfer path as a defined conduit. Bind the inference server to loopback or to the enclave’s own interface, and put the model proxy in front of it. MoorAI’s daily heartbeat reads the listening sockets, matches them to local model runtimes and classes each bind as loopback, all interfaces or LAN. A model server reachable without MoorAI raises a content-free alert. The model proxy listens on 127.0.0.1 and routes to any OpenAI-compatible local server’s /v1:
moorai-model-proxy --mode enforce --route /plant=http://127.0.0.1:8000/v1
In enforce mode each tool call the model returns is judged before the agent framework receives it, and a denied call is refused or withheld.
3. Give agents the least they need
Turn on the MCP approval gate, so only approved servers answer, and tool drift blocking, so a tool that changed after approval is refused until it is approved again. The MCP guard and gateway check each tool call’s arguments before the server sees it. Egress rules name which program may reach which host, port, method and path for the destinations a command or tool call names, with egressDefault: "block" for the rest.
For agents that can reach controllers, the Management Server’s Industrial / OT preset denies OT write, setpoint, controller-program, safety-system and historian-delete functions by name at the model proxy, with name patterns for Modbus, OPC UA, S7, DNP3, BACnet and similar tools. Method calls, historian writes and alarm handling ask first, and read-only protocol calls are reported. The preset also denies destructive commands and bulk exports, denies MCP servers off the list you enter, and fails closed. Matching is by function name, so add your own tools’ names.
MoorAI governs the AI agent on the host it runs on. It never sits inside a PLC, a safety instrumented system or the historian. Those belong to deterministic components built to the IEC 61508 and IEC 61511 functional-safety standards and the IEC 62443 security series.
4. Sign the policy, and let it work offline
The Management Server signs each tenant’s policy with ed25519, and the device verifies it against a key held outside the agent’s write scope, such as a root-owned policy.pub. Enforcement needs no network. A device whose console is unreachable keeps enforcing its cached policy, then its last-known-good verified policy, then the offline default the administrator chose (a fail-closed default, or the built-in prevention defaults). The package and MCP pre-install checks take --offline and report not checked instead of calling out.
5. Keep evidence on site, and export it one way
Alerts carry a category, a risk level and a keyed one-way hash, never the prompt, the file or the matched text. Each finding is also written to the device’s own action audit log. An alert is sent to the console once and not retried, so run the Management Server inside the enclave, where every device can reach it. It delivers them to an on-premises SIEM collector at a private address you list. For an audit it builds an evidence pack: a zip whose manifest is signed with the tenant’s policy key and checked with OpenSSL alone, with no console and no network. Carry it out of the enclave one way, and verify it on the other side.
Where each MoorAI part fits
| Part | Where it runs | What it does there |
|---|---|---|
| MoorAI for Agents free, open source (MIT) | Windows and macOS workstations where agents run, and the transfer station | Checks each command, file read and tool call before it runs. Lists the local model runtimes and flags exposed ones. Ships moorai-model-scan. |
| MoorAI for AI Servers priced per server | In front of the inference server and the tool servers | The model proxy, the MCP gateway, the Agent SDK and scan-before-embed for the documents a local retrieval pipeline indexes. |
| MoorAI Management Server free to self-host, no user limit | Self-hosted inside the enclave | Signs policy, holds the Industrial / OT preset, receives content-free alerts and builds evidence packs. It runs with no internet access. |
Self-hosting is the natural fit for an air-gapped site: the console that holds the fleet’s records stays inside the boundary. The hosted console at app.moorai.dev is a free trial, then contact us, for sites that can reach it.
Sources
- CISA and partners. Principles for the Secure Integration of Artificial Intelligence in Operational Technology, 3 December 2025; ICSA-10-201-01C, USB Malware Targeting Siemens Control Software, ICS-CERT.
- Kaspersky. FAQ: The ProjectSauron APT, Securelist, 8 August 2016.
- ESET. Mind the (air) gap: GoldenJackal gooses government guardrails, WeLiveSecurity, 7 October 2024.
- Python. pickle documentation, on malicious pickle data running code when it is unpickled.
- Symantec. W32.Stuxnet Dossier, version 1.4, February 2011.
- ISA and IEC. ISA/IEC 62443 series; IEC 62443-3-2; IEC 61508-1; IEC 61511-1.
- MoorAI. MoorAI on GitHub, agent v1.25.0: README sections “Air-gapped deployment”, “Model file scanning”, “Model proxy” and “Living off the AI”; the regulated and defense page for the Industrial / OT preset and the private deployment.
See also: Treat AI as critical infrastructure, MoorAI for AI Servers and MCP security.