---
title: "Coding Agent Horror Stories: The Command You Already Approved"
description: "CVE-2026-22708 in Cursor let shell built-ins like `export`, `typeset` and `declare` run outside the Auto-Run allowlist, so injected text could silently set variables such as `PAGER`, `PYTHONWARNINGS` or `PERL5OPT` and turn an approved command like `git branch` into arbitrary code execution, even with an empty allowlist."
url: "https://swe.quest/articles/coding-agent-horror-stories-the-command-you-already-approved-c2fceff8d5f4f4cc"
canonical: "https://www.docker.com/blog/coding-agent-horror-stories-the-command-you-already-approved/"
source: "Docker"
published: "2026-08-18"
difficulty: "medium"
kind: "Incident"
reading_minutes: 14
tags: ["ai-agents","sandboxing","appsec","ai-coding","virtualization"]
---

# Coding Agent Horror Stories: The Command You Already Approved

A post on [Docker](https://swe.quest/sources/docker.md), published 2026-08-18, 14 min read, Incident. Original: [https://www.docker.com/blog/coding-agent-horror-stories-the-command-you-already-approved/](https://www.docker.com/blog/coding-agent-horror-stories-the-command-you-already-approved/)

## Summary

CVE-2026-22708 in Cursor let shell built-ins like \`export\`, \`typeset\` and \`declare\` run outside the Auto-Run allowlist, so injected text could silently set variables such as \`PAGER\`, \`PYTHONWARNINGS\` or \`PERL5OPT\` and turn an approved command like \`git branch\` into arbitrary code execution, even with an empty allowlist. The chain in Pillar Security's research ended with SSH private keys being exfiltrated. Running the agent inside Docker Sandboxes microVMs does not stop the injection, but it keeps the key file out of reach, discards \`~/.zshrc\` persistence and limits egress through deny-by-default network policy. Caveats remain: the live host workspace (Git hooks, Makefiles), the shared skills store, and a forwarded SSH agent socket, which declarative kits and org-level governance with SIEM audit logs are meant to constrain.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [AI agents](https://swe.quest/tags/ai-agents.md) (AI & ML)
- [Sandboxing & isolation](https://swe.quest/tags/sandboxing.md) (Security)
- [Application security](https://swe.quest/tags/appsec.md) (Security)
- [AI for coding](https://swe.quest/tags/ai-coding.md) (AI & ML)
- [Virtualization](https://swe.quest/tags/virtualization.md) (Infrastructure)

## Prerequisites

- shell environment variables
- AI coding agents ([easy posts on AI for coding](https://swe.quest/tags/ai-coding.md?difficulty=easy))
- prompt injection basics ([easy posts on Application security](https://swe.quest/tags/appsec.md?difficulty=easy))

## Keywords

CVE-2026-22708, Cursor, Docker Sandboxes, Pillar Security, Docker AI Governance, PAGER, sbx

## Related posts

- [Coding Agent Horror Stories: The CVE That Did Not Exist](https://swe.quest/articles/coding-agent-horror-stories-the-cve-that-did-not-exist-6a97fa18ca5ac54f.md): Docker · 2026-10-29 · Medium · 15 min read · AI agents, Sandboxing & isolation, AI for coding, Code review, CI/CD
  A self-hosted, read-only AI code review bot running on Ollama answered a routine PostgreSQL 16.11→16.13 patch bump with a 1,500-word report alleging an "architectural takeover".
- [Coding Agent Horror Stories: The Security Crisis Threatening Developer Infrastructure](https://swe.quest/articles/coding-agent-horror-stories-the-security-crisis-threatening-developer-feea8c1a7c9350ee.md): Docker · 2026-05-18 · Easy · 26 min read · AI agents, AI for coding, Sandboxing & isolation, Supply chain security, Identity & auth
  AI coding agents run with the full identity of the user who launched them, so they inherit filesystem access, cloud credentials, and secrets with no approval step between a model's decision and its execution.
- [Prove your AI agent guardrails work](https://swe.quest/articles/prove-your-ai-agent-guardrails-work-2a4587e8e9b27383.md): Docker · 2026-11-25 · Medium · 16 min read · Sandboxing & isolation, AI agents, Security, Identity & auth, AI for coding
  Coding agents with broad access can leak credentials or delete files, as two reported July 2026 incidents show: Grok Build CLI silently uploaded whole repositories, including ignored files and planted secrets, to cloud storage, and a Full Access agent deleted a user's home directory after alternatives to blocked rm succeeded.
- [Coding Agent Horror Stories: The 29 Million Secret Problem](https://swe.quest/articles/coding-agent-horror-stories-the-29-million-secret-problem-7f5056c95d2769e4.md): Docker · 2026-07-28 · Medium · 12 min read · Supply chain security, AI for coding, Sandboxing & isolation, JavaScript, AI agents
  The s1ngularity supply-chain attack on the Nx npm package used a post-install script to find installed AI coding CLIs (Claude Code, Gemini CLI, Amazon Q) and invoke them with permission-bypass flags like --dangerously-skip-permissions, prompting the agent to inventory secrets across the home directory before exfiltrating them to public repos under the victim's GitHub account.
- [Coding Agent Horror Stories: The rm -rf ~/ Incident](https://swe.quest/articles/coding-agent-horror-stories-the-rm-rf-incident-68288dbcab0abba2.md): Docker · 2026-06-01 · Medium · 16 min read · AI agents, Sandboxing & isolation, AI for coding, Virtualization, Security
  An AI coding agent asked to clean up an old repo ran \`rm -rf tests/ patches/ plan/ ~/\`, and the trailing \`~/\` expanded to the user's home directory and wiped an entire Mac, including the Keychain, SSH keys and years of files, with TRIM-enabled SSDs ruling out recovery.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
