Step-Zero Attack: Agent Safety Before Observability

Tian Qin, Yuhang Jiang, Junzhe Chen, Lit Sin Tan, Lijie WenarXiv 2026 · arXiv

TL;DR

AI agents are vulnerable to Step-Zero attacks, where the mere act of opening a file or fetching a URL causes harm before the model’s safety filters can even see the data. By exploiting the "observability gap" in how agents process opaque carriers like ZIP files or network responses, attackers can trigger resource exhaustion or file integrity violations that bypass traditional model-side defenses.

What Problem Does This Paper Address?

Most research on AI agent safety focuses on "indirect prompt injection"—malicious text hidden inside documents that persuades a model to perform unauthorized actions. However, this assumes the model has already read the content.

The authors identify a critical oversight: to read an unknown archive (ZIP), network response (HTTP), or image, an agent must first process it. This initial processing step, which they call Step Zero, is an action that happens on the user's machine before the content enters the model's context. If that processing step is unsafe (e.g., a decompression bomb), the damage is done before any guardrail can inspect the payload.

![Fig.

  1. Step Zero for an opaque carrier. The first processing call admits the hazard before the model can observe the content.](/figures/art_b25a4e6379f44415a2eef72a4de9ca4a)

Methods

The researchers developed the Opaque Input Carrier (OIC) framework to formalize how agents interact with sealed data. They evaluated safety using a paired protocol: agents were given either a "crafted" carrier (containing a hazard) or a "benign twin" that appeared identical in its metadata (same filename, declared size, etc.).

To defend against these attacks, they introduced the Step-Zero Safe Protocol (SZSP). This defense moves safety checks into the tool layer by:

  1. Decoupling Observation from Mutation: Using a peek operation that streams data through a decompressor to count bytes without writing anything to disk.
  2. Staged Commits: Only writing files to the workspace if the entire stream stays within a predefined safety budget.

Datasets

The study introduces a reproducible measurement protocol across a diverse "zoo" of agent environments:

  • 7 Agent Harnesses: Including popular platforms like OpenHands, SWE-agent, and Claude Code.
  • 6 Large Language Models: Ranging from GPT-4 and Gemini to DeepSeek and Qwen.
  • 3 Carrier Types: Crafted ZIP archives (availability hazards), HTTP endpoints (integrity hazards), and QR-coded images (integrity hazards).

Key Insights and Ideas

  • The "Breach First" Phenomenon: In many cases, the agent crashes the system or overruns its disk budget before the model receives a single byte of content. Traditional "content-judging" defenses are useless here because there is no content to judge yet.
  • Declarations are Lies: Agents often rely on "listings" (like unzip -l) to check file sizes. However, these listings only show what the attacker declared in the file header. The actual data stream can be orders of magnitude larger.
  • Immediate vs. Deferred Failure: The authors distinguish between Immediate Failure (e.g., a ZIP bomb that fills the disk during extraction) and Deferred Failure (e.g., an agent fetching a file, seeing it's wrong, but saving it anyway because it trusts the initial filename declaration).
  • Inconsistent Caution: Interestingly, a model’s caution on one type of input (like an archive) does not predict its caution on another (like a network fetch). For example, Gemini-4-Argon was the most cautious with archives but the most reckless with network writes.

Key Results

The results highlight a massive vulnerability in current agent implementations:

  • Widespread Vulnerability: 32 out of 42 harness-model pairs overran a 4 MiB disk budget when given a crafted archive.
  • Timing is Everything: In 26 of those 42 cases, the breach happened before the model saw any content.
  • SZSP Effectiveness: When the SZSP defense was active, breaches dropped to 0/28 in live agent tests, while the agents still successfully completed 25 out of 28 benign tasks.

![Fig.

  1. Timing analysis showing that archive breaches (red triangles) frequently occur before the first member reaches the model context.](/figures/art_d367431975b6477598d0b45199ad68b5)

Limitations and Future Work

The authors acknowledge several areas for further exploration:

  • Scope of Hazards: This study focused on disk usage and file integrity. Future work is needed to address confidentiality (e.g., an agent "phoning home" data during Step Zero).
  • Complex Formats: While ZIPs and images were tested, other opaque carriers like PDFs, multi-layered repositories, or specialized package formats remain unstudied.
  • Integration: The SZSP is currently a prototype. The authors argue that harness maintainers must integrate these "gates" directly into their tool layers to provide a safe-by-default experience for users.
  • Safety Alignment: Beyond tool-level fixes, model developers should train agents specifically to "look before they leap" when handling unknown external references.

Summary updated

Abstract

Existing attacks and defenses for coding agents act once content enters the model context: injected text persuades the model, and guards inspect what the model reads. Yet to judge whether processing an unknown archive, network response, or image is safe, an agent often must process it first, and that step can do harm before any content reaches the model. We call this first processing Step Zero, and harm done by it a Step-Zero attack. Across seven harnesses and six models, each agent received only a path or URL to a crafted input, paired with a benign twin showing the same visible fields. Step Zero is where most agents are already unsafe: 32/42 harness-model pairs overran a 4 MiB disk budget, 26/42 before the model saw any member, and four of the six models did so in every round (84/84), so the damage precedes any model-side defense. Every twin stayed within budget, so the attacker's bytes alone cause the harm. On network and image inputs the risk moves to what the agent writes: agents stored the body under the name the input declared, letting the input decide what is written, and their checks faded once cues were removed. Model-free tests trace the harm to the processing primitive, so we defend it there: a gate that counts the bytes each call produces held every routed extraction within budget while agents completed 25/28 tasks. Vendors should pair such gates with safety-alignment training that teaches agents to inspect an input before processing it.
BibTeX
@misc{qin2026step,
  author = {Tian Qin and Yuhang Jiang and Junzhe Chen and Lit Sin Tan and Lijie Wen},
  title = {{Step-Zero Attack: Agent Safety Before Observability}},
  year = {2026},
  eprint = {2611.01953},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.01953},
}
Figure