---
title: "Study Found 9 Malicious Routers in 428 Tested Proxies"
excerpt: "An April 2026 study examined 428 LLM routers and found malicious injection. Proxies can inspect sent requests even when transport encryption protects the link."
author: "Patrick Hughes"
published_at: 2026-04-14T13:58:00.157+00:00
read_time_min: 6
tags: ["ai-agents", "security", "supply-chain", "agentguard"]
canonical: https://bmdpat.com/blog/llm-api-router-supply-chain-compromised-2026
---

Your AI agent calls an API. The API calls a router. The router has full plaintext access to every JSON payload in flight. Third-party application proxies can read and alter payloads despite encrypted network connections. The paper identifies missing client-to-provider cryptographic integrity.

That is how routing operated across the tested proxies. The research team documented security failures across the routers they evaluated.

![Inspect Client Router Hops: Verify Route Directly, Check Recorded Usage, Acknowledge Limits.](/blog-assets/llm-api-router-supply-chain-compromised-2026.png)

## The numbers

A team from UC Santa Barbara tested 428 LLM API routers. 28 paid (from Taobao, Xianyu, Shopify storefronts). 400 free (from public communities). The paper is called "Your Agent Is Mine" (arXiv 2604.08407). Here is what they found:

- **9 routers** were actively injecting malicious code into responses (1 paid, 8 free)
- **17 routers** accessed researcher-owned AWS canary credentials
- **1 router** drained ETH from a researcher-owned private key
- **2 routers** deployed adaptive evasion triggers (they only inject when they detect certain conditions)

Those results reflect active behavior measured during the research team's evaluation.

## How the attack works

LLM API routers sit between your agent and the model provider. They are application-layer proxies. Every prompt, every tool call, every credential your agent passes through the router is visible in plaintext.

The researchers defined two attack classes:

1. **Payload injection (AC-1):** The router modifies the model's response before it reaches your agent. It can inject arbitrary code, change tool call parameters, or redirect actions.
2. **Secret exfiltration (AC-2):** The router copies credentials, API keys, or sensitive data from your agent's requests.

There are also two evasion variants. Dependency-targeted injection only fires when specific libraries are detected. Conditional delivery only triggers under certain conditions, making it harder to catch in testing.

## Research findings across sample studies

In the April 9, 2026 v1 preprint, researchers evaluated separate studies measuring leaked credentials, decoy routers, and autonomous sessions:
- **100M GPT-5.4 tokens** generated through a single intentionally leaked OpenAI API key
- **2B billed tokens** observed across weakly configured decoys in a separate study
- **99 credentials** harvested across 440 Codex sessions evaluated in the sample
- **401 sessions** of those 440 running in autonomous YOLO mode without per-command confirmation

YOLO here means automatic tool approval without confirmation for each command. The paper does not establish an absence of cost caps or kill switches. When a malicious router intercepts a YOLO-mode session, it controls an agent executing tool actions without per-command confirmation.

## The LiteLLM supply-chain compromise

This is not just about routers. In the [LiteLLM maintainer security update (March 24, 2026; updated March 30)](https://docs.litellm.ai/blog/security-update-march-2026), maintainers reported an ongoing investigation into a suspected supply-chain incident. They believe the compromise originated from a Trivy CI scanning dependency, while initial evidence suggests attackers bypassed official CI/CD workflows to upload unauthorized releases 1.82.7 and 1.82.8 directly to PyPI. Official LiteLLM Proxy Docker images and source installs were not impacted, but environments pulling those specific PyPI packages were exposed.

In a separate threat analysis, [a trojanized npm campaign went after AI tool directories](https://bmdpat.com/blog/ottercookie-ai-tool-supply-chain-attack-2026) to steal the keys those agents run on.



## What this means for your agents

If your agent routes through a third-party API proxy, you are trusting that proxy with content routed through its application, including prompts, tool calls, and credentials transmitted in those requests.



## How to protect your agents

Three things you can do:

### 1. Run guards in-process, not at the gateway

A gateway-level guard runs after the proxy has already received your payload. An in-process guard runs inside your agent code before dispatching an external call.

AgentGuard runs in-process with zero dependencies. Helper checks inspect recorded usage rather than future call cost, and consume records usage after the call completes, raising only after usage is incurred.

```python
from agentguard import BudgetGuard, LoopGuard

budget = BudgetGuard(max_calls=10)
loops = LoopGuard(max_repeats=3, window=6)

for step in agent.plan(task):
    budget.check()
    loops.check(step.tool, step.args)
    result = step.run()
    budget.consume(calls=1, tokens=result.tokens)
```

The imported guards open no network sockets. These guards are plain Python objects in your process. BudgetGuard.check inspects recorded usage before the next call, meaning an unpriced or oversized call can overrun the remaining amount before detection. The consume method records usage after the call completes and may raise an exception after the cost has already been incurred. Your application must honor and handle these exceptions explicitly. A warning threshold can be crossed by the same call that breaches a limit, so early notice is not guaranteed.

These guards are not sandboxing, compromised-code containment, credential protection, or hard invoice caps. Timeouts are cooperative. Unknown model estimates return zero with a warning rather than free usage, and the library does not intercept Copilot, Claude Code, or Cursor subscriptions. In-process guards do not stop router malware, credential theft once secrets leave the process, or hostile code running inside the same runtime.

### 2. Track recorded usage and iteration limits

In the evaluated sample, 401 out of 440 Codex sessions ran in YOLO mode without per-command approval. Autonomous execution requires explicit tracking of iterations, elapsed time, and recorded token usage. Recorded usage is checked before a call and accounted for after incurred work. Because an individual call can overrun and in-process guards provide no invoice ceiling, applications must handle exceptions when limits are exceeded. See [Meta's agent budget control analysis](https://bmdpat.com/blog/meta-60t-token-burn-ai-agent-budget-control-2026).

### 3. Test your real call path

Inspect the direct network connection your client makes to the configured endpoint. Local configuration, resolved IP logging, and client TLS verification only check that immediate hop and any explicit local proxy. They cannot reveal or validate hidden server-side relay routes behind a third-party gateway, because the intermediary terminates client TLS before opening its own upstream connection. In staging, test with synthetic canaries rather than real credentials, without assuming clean responses prove an intermediary safe.

## The bottom line

In the tested sample of 428 routers, 9 were actively malicious. The researchers demonstrated payload injection and credential exfiltration across those proxies.

Your agents benefit from runtime checks that inspect recorded usage and enforce iteration limits inside your process. These guards do not provide sandboxing, hard invoice caps, or compromised-code containment. They do not replace direct, verified network routes, nor do they protect against credential theft or malicious code executing in the same process.

---

### Accompanying prompt
**What the prompt does:** Evaluates agent call paths and configures runtime guardrails without executing network requests.
Copy/paste this prompt:
```text
Role:
AI Security Reviewer

Context:
You are reviewing an agent pipeline that dispatches tool and model calls through external routes. The application must limit call loops, track recorded token consumption, and avoid uninspected intermediary proxies.

Task:
1. Review the supplied agent call dispatch configuration to identify configured endpoints and explicit proxies, and flag intermediate routing hops beyond them as unknown.
2. Place local BudgetGuard and LoopGuard checks around model invocations to inspect recorded usage before each step.
3. Record usage after each invocation with consume, and flag that unknown model estimates return zero with a warning.
4. Verify fallback handling when timeouts expire or when unpriced models return zero cost estimates.
5. Document that local in-process guards do not protect credentials from router malware or hostile code in the same process.

Output:
Provide a code review summary with the guarded dispatch loop and an explicit audit of guard limitations.

Constraints:
Use supplied files only. No execution, credentials, spending or network.
```
Copy the block above.

**AgentGuard** is an open-source Python SDK for AI agent runtime safety. Budget limits and loop detection that run locally, with zero dependencies.

[Get started with AgentGuard](https://bmdpat.com/tools/agentguard)

---

Get the local AI lab notes (benchmark rows, VRAM fit, quant choices, what runs on consumer GPUs), M-F only when there is something worth sending: https://bmdpat.com/newsletter?utm_source=blog_md&utm_medium=aeo&utm_campaign=llm-api-router-supply-chain-compromised-2026
