The audit log wrote this entry for a Read of a PNG:
{"outcome": "blocked", "posture": "deny", "method": null, "failure": {"kind": "host_configuration", ...}}
In the same run, the next request Claude Code sent to the model carried the image. A PDF and a notebook went the same way, and the notebook had the example key in plaintext. Three runs per file type, the same result every time.
Part 1 covers the setup and the method: Claude Code with its own model loop, the OWASP Agent Control Standard (ACS) reference Guardian, the shipped hook, and every protocol frozen with its sha256 before it runs. Part 2 is about the ! prefix, and part 3 about MCP tools. This part is about what the hook writes down when it can't carry out a decision.
Read goes through the Guardian now
Part 1 ended with a gap: the shipped hook settings didn't match Read, so cat of a file came back [REDACTED] and Read of the same file came back with the key. I filed it as #330, and a maintainer asked for a pull request.
PR #597 adds Read to both matchers and gives it its own output path. Bash's output sits in tool_response.stdout, and Read's text sits in tool_response.file.content, so the result gate has to know which field to send to the Guardian and where to write a redaction back. Claude Code drops a replacement that doesn't match the tool's output shape and delivers the original, so the path has to be exact.
With the shipped settings, a fresh Guardian and a fresh session per run, 3 runs per case:
| Case | Guardian | What the model got |
|---|---|---|
| Read of a text file | allow, then modify |
[REDACTED] in place of the key |
| Same file read twice | allow, then modify, twice |
[REDACTED] both times |
| Read with offset and limit | allow, then modify | [REDACTED] |
cat of the same file through Bash |
allow, then modify | [REDACTED] |
That closes the gap from part 1, for text.
Text only
Read returns five kinds of result: text, image, PDF, PDF pages and notebook. Only text has file.content. An image carries file.base64 and a notebook carries file.cells, so there is no text field to redact or replace.
For those types the result gate can't build a request at all, and the session's failure posture decides. Under proceed, today's default, the output goes through and the audit log records proceeded with host_configuration. That matches the specification: §6.4 says every decision failure must be recorded, and under proceed the record makes the bypass "visible rather than silent".
Under deny, the hook refuses and exits with code 2. That's where the entry at the top comes from.
What exit 2 means after the tool ran
Claude Code's hooks reference has a table of what each exit code does for each event. For PostToolUse, exit 2 "Shows stderr to Claude; the tool already ran". It withholds nothing.
I measured it live. Claude Code's debug log shows PostToolUse:Read finishing with status 2, and the transcript records the hook's stderr as a hook_blocking_error attachment. Then the output is delivered anyway: the image and the PDF reach the model as an image block and a document block, and the notebook's cells carry the key.
I don't take what reached the model from the model's reply. Claude Code records every request it sends to the API in the session transcript, and I rebuild each request's content from there. The reply proves nothing in either direction. With a block message on screen, the model answered at least once that it hadn't received the key, while the key was in its request. And it can quote the AWS example key from memory without ever receiving it.
For text and Bash, the hook does withhold. It writes [OUTPUT WITHHELD BY POLICY] into the output field, Claude Code delivers that instead, and a blocked entry is true. The false entry takes one combination: the effective posture is deny, and the result has no text field to replace. I replayed every captured payload through the real hook, and it held for all seven non-text cases: PNG, JPEG, GIF, WebP, a whole PDF, PDF pages and a notebook. The Guardian made no difference. One that was up, one stopped mid-session and a stub giving 13 different answers all led to the same entry, because the hook fails before it talks to the Guardian.
I filed it as #568. The workstream lead for coding agents asked for the log first: "fix that first, so the log records what really happened". Hiding images, PDFs and notebooks can follow, one type at a time.
Unenforced
PR #615 changes what the hook writes in that case:
-{"outcome": "blocked", "posture": "deny", "method": null, "failure": {"kind": "host_configuration", ...}}
+{"outcome": "unenforced", "posture": "deny", "method": null, "failure": {"kind": "host_configuration", ...}, "tool": "Read"}
The entry names the tool because nothing else in it does: no request was built, so method is null, and the failure message names a hookmap path. The hook's stderr message now says that the agent receives the output anyway.
Whether a stop at this point withholds anything depends on the host, so the host declares it. Claude Code's reference says exit 2 at PostToolUse doesn't. OpenCode's plugin records that a throw at the same point "stops the model from ever seeing the tool's output". So only the Claude Code hook declares that its stop doesn't withhold, and OpenCode keeps writing blocked. That OpenCode result is its authors' measurement, not mine.
The readers changed with the writer. The Inspector prints UNENFORCED with the tool, and its banner gained a counter, unenforced=N, painted as a warning above zero. I kept it apart from fail-open proceeds, because none of these steps is a fail-open. Before the change, a session under deny could show fail-open proceeds=0 while every image went through. The OTLP converter skips the entry and counts it separately.
The default may change
deny isn't the default today. PR #603, still a draft, proposes to make it one: fail closed unless a deployment opts into proceed. Under that default, every Read of an image, a PDF or a notebook would write this entry. I offered to take the reference implementation's side of that change, and its author handed it to me. It comes after #615.
Two more ways past the result gate
Looking for every result-gate path that ends in exit 2 turned up two problems that don't involve Read. Both are filed, and neither is fixed.
A Bash command that exits non-zero skips PostToolUse. Claude Code fires PostToolUseFailure instead, the shipped settings have no hook for it, and the whole output reaches the model. cat fake-secret.txt comes back redacted, and cat fake-secret.txt; exit 1 comes back with the key, 3 runs out of 3. Wiring the event wouldn't help: the hooks reference says "PostToolUseFailure can't rewrite a result", and a probe hook confirmed it. That's #613.
The hook also stops waiting for the Guardian at 300 seconds, whatever timeout the handshake negotiated. The cut comes from Bun's fetch, not from the hook's own timer. With 900 s negotiated and a decision arriving at 360 s, deny blocks a call the Guardian would have allowed, and proceed runs one it would have denied. The audit entry records the negotiated 900 s, not the 300 s that passed. The reference Guardian negotiates 5 s, so it never hits this, but the handshake schema sets no maximum. That's #614.
What I didn't measure
I didn't run OpenCode, so its blocked rests on its authors' comment. Hiding the output of images, PDFs and notebooks isn't done: it needs a replacement in each type's own shape. The live runs used one model, claude-opus-5-5, on Claude Code 2.1.325. The 300 s cut was measured with a stub Guardian, since the reference one never negotiates that long.
The question I ask now
Part 1 asked which tools cross the control. Part 2 asked where content enters the model's context, and part 3 whether each tool is declared everywhere the Guardian looks. This one is about the record.
A control can decide correctly and still not be the part that carries the decision out. So when a log says blocked, I now ask which component did the blocking, and whether it can block at that point at all.
Quotes from the ACS specification and source are © The OWASP GenAI Security Project and the ACS contributors, licensed CC BY-SA 4.0.
Top comments (0)