index ai security

After the Prompt Injection: The Short Version (Quick Read)

Three findings from a lab that assumes a coding agent has already followed an injected instruction: a default that weakened a layered setup, denied actions missing from logs, and transcripts that recorded things that did not happen.

Suppose a coding agent reads a poisoned file in your repository and does what it says. Two questions follow. What do the controls around the agent still stop? And afterwards, what can you prove?

I built a small lab to test both. It runs the real Claude Code 2.1.220 and Codex CLI 0.162.1 binaries against a scripted model that always follows the injected instruction, and it records what really happened with tools the agent cannot touch: a syscall trace, a packet capture, and the logs of the servers on the receiving end.

This is the five-minute quick read of a two-part study. The full write-ups are Part 1, containment and Part 2, forensics.

Read this first

The model is a script. This says nothing about how often real models obey injections, and it is not a ranking of the two products, which were configured differently. Each test is one fixed action, repeated five times.

Three findings

What was observed What to do about it
1. A default in one layer changed another layer On Claude Code 2.1.220, an approval allowlist alone denied an unlisted shell command in 5 of 5 runs. With the sandbox switched on as well, the same command ran, inside the sandbox, in 5 of 5. Setting autoAllowBashIfSandboxed to false brought the denial back, 5 of 5 Do not assume more layers means stricter. After changing one control, re-test the others
2. Blocked attempts were missing from some logs Claude Code's telemetry export had no event for 75 of 180 injected calls, and every one of the 75 was a call a control had denied. Codex's --json event stream had no entry for 19 of 150, all of them rejected or refused commands. The session files of both agents did record them Keep the full session record off the workstation. Before trusting any export, run a denied action through it and look for the denial
3. Agent records showed tool output, not effects In 5 runs the Claude Code transcript reported the upload command as successful (curl printed ok). No credentials were transferred: the sandbox had hidden the file, and the request that arrived carried 0 bytes. In 10 other runs the record showed an error for a script that had in fact executed Pair agent records with something that observes the effect: file and process auditing, egress logs, the target system's own log

Two more things worth knowing

Configured is not the same as effective. Every one of the 205 Codex runs recorded an approval policy of never in its own session file, including 95 whose configuration file said on-request. I could not establish why. The session file was the only place that showed it.

The workspace is not a safe zone. Overwriting a CI workflow inside the project succeeded wherever no rule named that path, on both agents. Controls that trust the working directory do not protect files in it that carry authority.

What the study cannot tell you

  • Whether a given model would follow the injection in the first place.
  • Whether a determined attacker could get around a control. Nothing here tried.
  • Whether an MCP tool call changed anything. The lab's server only records that the call arrived.
  • How this behaves in other versions, in interactive sessions, or outside Linux containers.

Check it yourself

The lab is public: injection-aftermath-lab. It needs Docker and Python 3 and no API key. Every number above is recomputed from the run records by python3 lab.py claims.