Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Docker 6 min read How-to mediumAdept

From Hallucinations to Prompt Injection: Securing AI Workflows at Runtime

AI-generated code and autonomous agents introduce risks such as privilege escalation, credential leaks, destructive commands and prompt-injection-driven exfiltration that static analysis, code review and CI miss because they only surface at runtime. The proposed fix is to move runtime security into the dev loop. That means running LLM output in containers with seccomp profiles and dropped capabilities, scanning images with Docker Scout locally and in GitHub Actions, and adding runtime network-deny policies, which are still in beta. Docker plans to integrate MCP Defender for out-of-the-box runtime guardrails.

Related posts

  • AI Agent Security Risks: What Can Go Wrong When Agents Act on Their Own

    Docker easyNovice

    AI agents introduce risks that traditional application security wasn't designed for, because they choose tools at runtime, chain actions and often run with the launching user's credentials. The five main risks are prompt injection, tool misuse and poisoning, excessive autonomy (e.g. auto-approve "YOLO mode"), credential exposure and data exfiltration, illustrated with incidents such as an agent running `rm -rf ~/` and one rebuilding a production environment, which caused a 13-hour outage. Since agents can't reliably tell injected instructions from legitimate ones, the recommended controls are isolation (microVM sandboxes), runtime-scoped tools from verified sources, short-lived dedicated credentials, allow-listed egress, and governance over allowed actions, positioned around Docker Sandboxes and AI Governance.

  • How to Secure AI Agents: A Practical Overview for Development Teams

    Docker easyNovice

    AI agents need a different security model than traditional services because they select tools, chain actions and act on credentials autonomously, widening the blast radius of prompt injection or tool poisoning. Defense rests on four layers: execution isolation in disposable microVMs or hardened containers with allow-listed networking, runtime-scoped tool access through a central gateway and curated registries, dedicated short-lived agent credentials injected at runtime, and full decision-chain logging with behavioral baselines to catch drift. Permission prompts are a UX pattern, not a control. Start with isolation as the highest-impact, lowest-friction step, and treat inter-agent communication as untrusted so delegation cannot escalate privileges.

  • Running AI agents in GitHub Actions with Docker Sandboxes

    Docker mediumAdept

    GitHub Agentic Workflows (gh-aw 0.82.9) supports Docker Sandboxes (sbx) as an agent runtime, so a CI coding agent gets root, sudo and unrestricted shell inside a disposable microVM with its own kernel and private Docker daemon. Outside that VM it is limited by a network allowlist, a read-only token and a safe-output job that may only touch src/**. In the worked example, a Copilot agent on an ubuntu-24.04 runner runs a Java 21 Testcontainers/PostgreSQL suite, adds a regression test exposing a case-sensitive email uniqueness bug, applies a one-line normalization fix, and opens a draft PR. The run took about 11 minutes, and setup needs Docker credentials as secrets plus a KVM-capable host for self-hosted runners.

  • What is an AI code sandbox?

    Modal easyNovice

    AI code sandboxes are ephemeral, isolated environments for executing LLM-generated code so hallucinated packages, crashes or prompt-injected exploits can't affect the host or other tenants. They run on VMs or containers, ideally with a hardened runtime like gVisor that intercepts syscalls through a user-space kernel instead of sharing the host kernel as runc does. Around that sit filesystem sync APIs, controlled networking, orchestration and state snapshotting. Use cases include background coding agents, code review, chatbot code interpreters, RL reward scoring and AI app builders. Buyers should weigh sub-second cold starts, isolation strength, egress control, high-concurrency scaling, dynamic runtime images and snapshotting.

  • The Untrusted Autonomous Workload: How AI Coding Agents Reshape What Isolation Has to Do

    Docker mediumAdept

    AI coding agents are untrusted, autonomous workloads that containers were never designed to isolate, so Docker Sandboxes runs each agent in a microVM (custom VMM on Hypervisor.framework, WHP or KVM) with its own kernel and private Docker Engine. Outbound traffic goes through a TLS-intercepting host proxy that enforces domain policies and injects credentials from the host keychain, so secrets never enter the VM. Two limits remain: domain-level allowlists still permit exfiltration via sites like github.com, and the shared workspace lets an agent plant Git hooks, package.json scripts or CI configs that later run on the host. A real Astro build showed no measurable microVM overhead, though a jemalloc dependency failed on 16K-page Apple Silicon VMs. Agent output should be reviewed like an untrusted pull request, for example by diffing .git/hooks and using --branch worktrees.

The quest for software engineering knowledge.

Look:
Layout: