Bash, run_command, and package installs. Per-session capability scopes make malicious router rewrites physically unable to call tools or package paths outside the approved task envelope.This paper shows that third-party LLM API routers are not just compatibility layers. Because they terminate client traffic and forward plaintext tool-call JSON upstream, a malicious or compromised router can rewrite executable tool arguments, steal secrets in transit, and selectively target autonomous agent sessions. The defensive lesson is to treat router choice, route policy, tool execution, and request logging as one governed security boundary.
Bash call, then the router can replace one argument with an attacker-controlled installer or package name while preserving valid JSON and schema shape.Bash, run_command, and package installs. Per-session capability scopes make malicious router rewrites physically unable to call tools or package paths outside the approved task envelope.The paper makes a subtle trust boundary hard to ignore: an LLM API router can be both a convenience layer and the last component to touch executable agent commands before they run. AIDEFEND maps strongly to capability scoping, data-flow sink enforcement, route-policy governance, service authentication, execution controls, and monitoring. The remaining ecosystem step is origin integrity for tool calls, so clients can verify what the upstream model actually produced before an agent acts on it.