MAQPNA

Sector series · Defence · · 4 min read

AI agents in defence: policing untrusted code on air‑gapped systems

Imagine a government‑grade LLM that, without any internet connection, pulls a new model from an unknown source and writes a kernel driver that silently escalates privileges.

No‑Internet Rule‑Sets: frozen tools are the only safe option

In defence environments the network is deliberately air‑gapped. Any tool that can download a model, plugin or update at runtime instantly violates the supply‑chain rule‑set. The risk is not theoretical; a rogue model could embed an exploit that bypasses the host OS.

A plausible failure: an autonomous analysis agent receives a fresh threat‑intel dataset, asks a cloud‑hosted model for a classification, and the model returns a payload that the agent writes to /usr/local/bin. Because the host is isolated, the payload never gets scanned and spreads across the enclave.

  • Enforce default‑deny policies for every tool and argument.
  • Pin tool definitions (MCP pin) to a known hash and reject any drift.
  • Run agents only against a pre‑approved catalogue of models stored on the air‑gapped repository.

Shared‑Host Threats: model‑written code in a shared container

Agents often share a Kubernetes node with workloads owned by partner organisations or other ministries. The container runtime shares the host kernel, so a single exploit in model‑generated code can compromise the whole node.

Suppose an agent that scrapes satellite imagery generates a Python snippet to stitch images together. The snippet inadvertently calls a low‑level system library that escalates to root, giving the partner’s untrusted workload the same privileges.

  • Isolate each agent session in a gVisor sandbox.
  • Where higher assurance is needed, deploy Firecracker microVMs with attestation‑gated tokens (designed for).
  • Apply hierarchical budgets and token‑rate limits to cap the impact of a runaway agent.
Fit map · DefenceWhat the sector needs, and what MAQPNA does about it
  • Agents must never fetch code from the internet on an air‑gapped networkMAQPNA enforces a default‑deny policy per tool and argument, and pins MCP tool definitions so any silent change is caught.
  • Workloads on shared infrastructure must be isolated from the host kernelEach agent session runs in its own gVisor sandbox; for higher assurance Firecracker microVM isolation is designed for.
  • Every piece of code execution must have a verifiable provenance chainAll decisions are written to a SHA‑256 hash‑chained, tamper‑evident ledger; calls that cannot be recorded are blocked.
  • Human oversight of risky actions is mandatory under defence policyRisky calls are held for a person to approve with four‑eyes approval and separation of duties.
  • The ability to instantly stop all agents in an emergencyA kill switch revokes every agent, everywhere, with a measured 302 ms p99 latency in a cross‑region test.
  • Offline, signed installation for environments that never connect to the internetMAQPNA is designed for an offline bundle that can be signed and verified before any component touches the network.

Provenance and the audit ledger: proving what actually ran

Defence auditors demand a cryptographic chain that proves exactly which signed software executed, and that nothing was altered afterwards. Without such evidence the chain of custody is broken.

A plausible failure: an incident response team reviews logs and sees a “create‑policy” call, but the underlying model that generated the policy has been replaced by a malicious variant. If the call was not recorded, the ledger provides no clue.

  • Every decision is written to a SHA‑256 hash‑chained, tamper‑evident ledger; a call that cannot be recorded does not run.
  • Configure the audit failure policy to “closed” so that missing ledger entries abort execution.
  • Export evidence packs that map ledger entries to EU AI Act and ISO/IEC 42001 requirements (designed for).

Monday‑morning controls: what a CISO can enable today

Start with a single policy test against a low‑risk namespace: maqpna policy test --policy payments.yaml --ns team-a --agent payer --server payments --tool create. Verify the default‑deny behaviour before scaling.

Activate the four‑eyes approval flow for any call flagged as “risky”. The system will hold the call for a person to approve, enforcing separation of duties.

Deploy the kill switch and confirm the 302 ms cross‑region revocation time in a test run. Knowing you can cut off every agent instantly is essential for incident containment.

  • Run maqpna dev on a sandbox cluster to visualise the full request timeline.
  • Review the DLP patterns for private data, untrusted content and exfiltration paths; adjust them to the specific classification levels used by your service.

Where MAQPNA fits into the defence stack

MAQPNA is the sovereign runtime for AI agents: it checks, approves and records every action AI agents take, on infrastructure the customer controls. It runs in the customer's own cloud account, Kubernetes cluster or data centre, with no vendor control plane, so no outside party can read or stop the customer's agents. One gateway sits between agents and everything they touch; every tool call, model call and agent‑to‑agent call goes through it.

Takeaways

  • Lock down every tool call with default‑deny and pin the tool hash.
  • Run each agent in a gVisor sandbox; consider microVMs for the highest‑risk workloads.
  • Enable four‑eyes approval for any call flagged as risky and keep the kill switch test‑ready.
  • Verify that every action is recorded in the SHA‑256 ledger before it is allowed to run.

Questions people ask

Can I let an AI agent download a model from the internet on a classified network?

No. Defence policy requires a default‑deny rule for any outbound request. MAQPNA enforces this per‑tool policy and will block the call.

What happens if an agent tries to execute code that was not reviewed?

The action is held for four‑eyes approval. If the ledger cannot record the decision, the call is aborted, preventing unreviewed code from running.

How this was written

Part of the MAQPNA sector series, written with Cloudflare Workers AI and checked automatically: every claim about MAQPNA comes from our fact sheet, no statistics are invented, and rules are named, never "certified". MAQPNA helps you produce the controls and evidence they ask for; your assessor decides the rest. See MAQPNA for defence. Spotted a mistake? Tell us.

Let agents act. Keep control.

Run MAQPNA on a laptop in minutes, then in your own cloud, cluster or data centre.

More install options
curl -fsSL https://maqpna.com/install.sh | sh