A study has found that some API relay services linking AI agents with external AI models are being exploited to spread malware and steal credentials. As AI can write code and execute commands, relay servers are emerging as a new security weakness.
Japan's ITmedia reported on Nov. 19 that a joint research team at the University of California, Santa Barbara (UCSB) analysed the security risks of 428 third-party API routers in a paper titled "Your Agent Is Mine".
API routers are relay services that pass requests from AI agents such as Claude Code and Codex to model providers such as OpenAI and Anthropic. They can offer cheaper access to multiple models or centralised management, but communications can be exposed during relaying.
The problem is that routers decrypt encrypted communications in the middle. Malicious operators can manipulate commands or responses sent to AI and steal sensitive data such as API keys and cloud credentials.
Researchers examined 28 paid routers and 400 free routers. They confirmed malware injection on 9 in total, including 1 paid router and 8 free routers.
Hackers replaced legitimate commands that AI would execute with malicious commands or swapped software package names with fake packages using similar spelling.
They also found tactics to evade detection. Some routers processed the first 50 requests normally before launching attacks. Another router inserted malicious commands only when working on projects in a specific programming language in "YOLO mode", where AI automatically approves commands.
They also confirmed credential theft. On 17 free routers, decoy Amazon Web Services (AWS) credentials provided by the researchers were later used without authorisation. On 1 router, real funds were withdrawn from a research ethereum wallet.
Even normal routers cannot be assumed safe. A relay server with deliberately weakened security settings was incorporated into an outside company's communication path, exposing 99 credentials across 440 AI development sessions.
The researchers proposed defences including limiting the scope of commands AI is allowed to execute, detecting abnormal responses and preserving communication logs.
The study shows that trustworthiness must be verified not only for AI models themselves but also for intermediary services that connect models and agents.