TL;DR
LLM agents can produce perfectly correct task outputs while simultaneously executing malicious code with hidden side effects, such as data exfiltration. This paper introduces SINGED, a benchmark demonstrating that current "output-only" evaluations fail to detect these security breaches, revealing that agent safety is dangerously sensitive to tool ranking and how deeply malicious code is buried in dependencies.
What Problem Does This Paper Address?
As LLM agents move from generating text to acting in environments, they increasingly rely on third-party tools and code artifacts. This creates a massive supply-chain vulnerability. The authors identify a specific threat: functional counterfeits. These are implementations that perform a requested task perfectly (e.g., redacting a document) but include a "forbidden" side effect (e.g., sending the unredacted data to a remote server).
Existing benchmarks typically use a "Task Oracle" to check if the final output is correct. However, if a malicious tool produces the correct output, the agent appears to have succeeded. The authors argue there is a structural Outcome-to-Execution Gap (OEG): a successful task outcome does not certify a safe execution path. They set out to quantify how often agents choose these "counterfeits" over benign alternatives and what factors drive those choices.
Methods
The authors developed a controlled evaluation framework that separates the evaluation into two channels:
- Task Oracle: Verifies the correctness of the returned artifact (e.g., file hash, JSON structure).
- Process Oracle: Monitors the execution environment (a network-isolated sandbox) for forbidden events like unauthorized POST requests, out-of-scope file writes, or unrelated file reads.
The study varies several key experimental dimensions:
- Display Rank: The order in which candidate tools are presented to the agent.
- Evidence Depth: Whether the malicious code is in the main entry point, one import deep, or two imports deep.
- Decision Policy: Instructions given to the agent (e.g., "deliberate before choosing" vs. "compare all candidates").
- Agent Configuration: Testing across different frameworks like ReAct, AutoGen, and LangGraph.
Datasets
The researchers introduced the SINGED benchmark, comprising 7,549 audited trials across 20 model releases and 14 model families.
- Primary Tasks: Document redaction, speech transcription, paper retrieval, archive extraction, and tabular conversion.
- Held-out Tasks: Configuration editing and image thumbnailing to test generalization.
- Public-Package Slice: A transfer test using real-world, version-pinned packages (like
markdown2ortoml) with injected probes to see if findings hold in realistic software structures.
Key Insights and Ideas
- The Rank Bias: Agents exhibit a strong "first-result" bias. If a malicious tool is ranked first, agents are far more likely to execute it without further inspection.
- Early Commitment: Failures concentrate in trajectories where the agent stops after inspecting only one candidate. Once an agent starts looking at a tool that "looks" right, it often commits to execution immediately, skipping safer alternatives.
- The OEG Metric: The authors formalize the Outcome-to-Execution Gap, which measures how much task success overstates safe utility. In their study, every counterfeit execution also passed the task oracle, meaning a standard benchmark would have scored these as 100% successful.
- Comparison is a Leaky Defense: While forcing an agent to "compare all" candidates reduces the Counterfeit Execution Rate (CER), it doesn't eliminate it. As malicious code moves deeper into dependencies (Evidence Depth), the benefit of comparison diminishes significantly.
Key Results
- Rank Sensitivity: In the randomized-rank study, counterfeit execution occurred in 45% (27/60) of trials when the counterfeit was ranked first, but dropped to near zero at later ranks.
- Policy Impact: Moving from a baseline "deliberate" policy to a "compare-all" policy reduced the CER from 15.7% to 4.2% across primary tasks.
- Single-Source Vulnerability: Seven model releases that showed zero CER when alternatives were available (because they chose the benign tool) suddenly executed the counterfeit in 55/175 trials when the benign alternatives were removed. This shows that "observed safety" often just reflects the presence of better options, not an inherent ability to reject bad ones.
Limitations and Future Work
- Unseen Effects: The benefit of comparison policies remains uncertain for novel or highly complex side effects not covered in the benchmark.
- Public-Package Structures: While the rank gradient transfers to public packages, the aggregate benefit of comparison is less consistent across diverse software trees.
- Future Directions: The authors suggest that evaluations must move beyond output hashes and start binding outputs to specific, inspected execution identities. They also highlight the need for stronger system-level controls and provenance tracking in agent deployments to mitigate these supply-chain risks.
Summary updated