TL;DR
LLM agents, commonly used for tasks like coding and automation, are vulnerable to "response-path integrity gaps" where an intermediary relay can silently inject malicious code into the agent's instructions, leading to "False-Green Verification." This paper introduces sign-c, a novel defense mechanism that cryptographically signs critical execution fields, preventing such tampering without breaking the agent's functionality or routing capabilities.
What Problem Does This Paper Address?
Large Language Model (LLM) agents are increasingly used to perform complex actions, from writing code to managing financial transactions. Developers often rely on signals like test pass/fail statuses and execution transcripts to verify the safety and correctness of these actions. However, a significant portion of real-world LLM agents use a "Bring-Your-Own-Key" (BYOK) configuration. In this setup, traffic between the user's agent and the remote LLM API server is routed through a user-authorized relay. While this relay is authorized to read the traffic for routing purposes, it can also decrypt and modify the LLM's response after alignment but before it reaches the agent. This creates a "response-path integrity gap": the agent receives a seemingly valid, verified response, but it might contain a hidden vulnerability or malicious instruction injected by the relay. This phenomenon is termed "False-Green Verification" because the agent reports success and passes developer-visible checks, while a critical security flaw is silently introduced. Existing defenses like model alignment or agent-side content detection fail to address this because they either operate before the relay's intervention or inspect content rather than its origin.
Methods
The paper proposes sign-c, a response-provenance protocol designed to close the response-path integrity gap. sign-c operates at the application layer and involves two main components:
- Gateway (Provider-side): This component sits before the LLM model and signs only the "execution-bearing fields" (e.g., tool calls, JSON payloads) of the model's response. This signing uses a canonicalization method that is invariant to benign relay reformatting but sensitive to any alteration of the execution-bearing content.
- Shim (Agent-side): This component sits beside the BYOK agent. It verifies the signature provided by the gateway before the agent executes any action. If the signature is invalid (indicating tampering), the shim rejects the response. The shim also signs outgoing requests to provide bidirectional authentication.
To ensure confidentiality, sign-c also includes a "sealing layer" that encrypts the message body, preventing the relay from reading sensitive content, while essential routing fields remain in clear-text. The protocol is designed to be compatible with BYOK routing and to avoid false rejections on legitimate traffic.
Datasets
The paper evaluates its proposed defense on several real-world datasets and benchmarks:
- SWE-bench Django: A dataset of real-world software bugs and their fixes, used to evaluate the impact of False-Green Verification on coding tasks.
- APPS: A large-scale dataset for evaluating code generation capabilities, used to assess the impact of the response-path integrity gap at scale.
- AgentDojo: A benchmark designed to evaluate LLM agents across various tasks, including coding and tool use.
- Agent Security Bench (ASB): A benchmark used to evaluate agent behavior and security across different LLM models.
Key Insights and Ideas
- The "Response-Path Integrity Gap" is a fundamental flaw in BYOK architectures: It's not about breaking encryption or compromising the model, but about an authorized intermediary silently altering critical instructions.
- False-Green Verification is a significant threat: LLM agents can appear to function correctly and pass all developer checks, while secretly executing vulnerable code or performing unintended actions.
- Existing defenses are insufficient: Model alignment (provider-side) and content-based detection (agent-side) fail because they don't authenticate the origin of the execution-bearing fields after they've been generated.
- Selective signing is key: Signing only the critical execution-bearing fields, rather than the entire response, preserves the relay's ability to read routing information while ensuring the integrity of executable instructions.
- Canonicalization is crucial for deployability: A method to represent execution-bearing fields in a consistent format is needed to prevent benign relay reformatting from causing false rejections.
Key Results
- Relay Tampering Attack (RTA) effectiveness: The RTA successfully injects vulnerabilities into code fixes on SWE-bench Django (69.0% of forced-edit instances) and APPS (99.7% of test-passing solutions).
- False-Green Verification impact: On ASB, RTA misdirects agents on 89.1% of tasks, far exceeding prompt injection attacks.
sign-ceffectiveness:sign-crejects every tampered response with zero false rejections.sign-cperformance overhead: The defense introduces a median latency overhead of 2.97 ms per call, which is only 0.0167% of the median upstream inference time.sign-cdeployability: The solution works as a drop-in shim without modifying the agent or model API, and requires minimal provider overhead.- Comparison with other defenses: Endpoint defenses (provider-side alignment, agent-side detection) and cross-relay designs (full-path encryption, whole-response signing) fail to satisfy all three critical axes: integrity, routing, and deployability.
sign-cis the only design that satisfies all three.
Limitations and Future Work
- Confidentiality layer termination: The confidentiality layer of
sign-cterminates at the gateway, not the model. This is a deliberate scope choice to keep the trusted computing base small. - Pinned key and policy reachability: The downgrade resistance relies on the shim's pinned key and policy reaching the endpoint through a channel the relay cannot control. In scenarios where the relay also distributes the client, this provenance must be established separately.
- Generalizability: The gap applies wherever an agent parses tool-call fields from an unauthenticated intermediary, and the unsigned surface grows as the ecosystem adopts new protocols.
- Future work: The authors suggest that native support for
sign-cin LLM frameworks could make it ubiquitous. They also propose extending the canonicalization to handle code embedded in free-form response bodies, not just structured tool calls.
Summary updated