Engineering Notes · agent operations · security discipline
How I nearly shipped past a critical security advisory because my AI agent read a summary of a page instead of the page, and what got banned fleet-wide the same day.
Routine job: a vendor publishes a security advisory page covering dozens of their Magento modules, and I ask the agent on a client project to scan the page and check whether any of the client's installed modules are affected. The agent fetched the page, searched it, reported back: nothing critical for us.
Wrong. Two High-severity lines for a module we ran, plus a related url-rewrite issue, sat in a later chunk of the advisory. The agent had not read the page. It had read preview windows: the summarised, chunked view its page-fetch tooling returns by default, and searched inside those. The chunks it was shown did not include the lines that mattered. When I pushed back, it fetched more, and there they were. High-severity, installed, missed.
Task failed. Caught only because it didn't survive contact with human review: I knew this client's stack and what that module was actually doing in production, and a clean report didn't square with that domain knowledge. That mismatch — what I knew about the client's own install versus what the agent confidently reported — is what superseded the finding and sent me back in to investigate why the scan had gone so wrong in the first place. The uncomfortable generalisation landed immediately: this was not a security-scan problem, this was every fetch. Research, vendor comparisons, changelog reviews: any task where the agent "reads a page" was actually the agent reading an excerpt it did not choose, with silent gaps it could not see.
This is the part to carry across, because once you see the mechanism you can fix it in your own setup. When a Claude Code agent uses its built-in fetch tool (WebFetch), the main agent never receives the page. This is not reverse-engineering on my part; it is documented behaviour. From the official Claude Code tools documentation:
Read that second line again. "The page doesn't mention it" can officially mean "the extraction prompt didn't ask". So the agent's "I read the page and found nothing" decomposes into: a cheap model read a markdown conversion, answered a prompt, and did not mention the thing, and the main agent trusted that. Lossy steps, each invisible in the final answer. Related tooling has the same shape: search utilities that index a page into chunks and return preview windows around matches will happily let the agent grep the previews and mistake them for the document, which is the exact variant that bit me.
Credit where due: the same doc section suggests using curl via Bash for the unprocessed page, which is exactly the approved path my guard enforces. The design is sensible for token-cheap casual reading. The problem is that nothing about the answer tells you which pipeline produced it: a summarised read and a full read produce the same confident sentence, and on a security advisory that difference is the whole job.
The failure is invisible from inside. The agent was not lying and not lazy: it searched what it was shown and reported honestly. The tool decided which chunks existed. Neither the agent nor I could see the gap in the answer, because the gap was in the input.
Clean answers get less scrutiny than messy ones. "Nothing critical for us" invites a nod and a merge. The failure mode optimises for exactly the answer you will not double-check. This one got caught on instinct; instinct is not a control.
Convenience defaults are calibrated for chat, not for stakes. Summarised fetching saves tokens and is perfectly fine for "what is this blog post about". Security advisories, licence terms, upgrade notes and changelogs are completeness-critical: every line skipped is a decision made blind. The default does not know the difference, so the tooling has to.
The near-miss cost nothing in the end: caught before anything shipped. What it bought was expensive-looking and cheap: one guard hook, one graph fact, one changed default, and a permanent downgrade of my trust in any answer whose input I have not seen whole.
I use my tooling predominantly on Mage-OS (Adobe Commerce / Magento) e-commerce projects, and my own AI Booking Agent. If you have not swapped to Mage-OS yet, you are falling behind ;)