Servers strike back: How Alibaba Cloud tried to pump AI agents for data
Alibaba's official command-line tool received a fake error message from Alibaba's own servers. It told AI agents to hand over their Git email, IP address, Claude Code settings and system prompt. Almost at the same time, a security researcher ran into the same bait on a bug bounty site. Here's how this counter-defense works, whether it would even be legal in Germany and what agent users should check now.

What this is about
Prompt injection means hidden instructions in text that an AI model reads and mistakenly follows as a command. Until now, it was mostly known from booby-trapped websites or emails. In just over 24 hours, two cases came to light where the attack came from the other direction. The target itself tried to pump the AI agent working with it for information. In the second case, it was even the cloud provider agents should trust the most: Alibaba Cloud, going after its own paying customers.
This article asks: How does this “anti-agent defense” work? Is it a one-off? Would it even be legal in Germany? And what should users of Claude Code, Codex and similar tools do now?
Two cases, one bait
| Time (UTC) | Event |
|---|---|
| September 2026 | According to a huntback report from November 4, a similar anti-AI trap appears on an “Alibaba edge node” (documented only by screenshot) |
| Nov 30, 15:41 | James Kettle, Director of Research at PortSwigger, publishes “The bug bounty website that tried to hack me” |
| Nov 30, from 16:22 | V2EX user ZengLeiPro's calls to aliyun CLI 3.3.4 start failing |
| Nov 30, 17:44 | ZengLeiPro posts his analysis on V2EX (already December 1 in China) |
| Dec 1 | Kettle reports on X: HackerOne is investigating, and someone has named the company |
| Dec 2 | Alibaba Cloud responds via its Weibo customer service account |
Kettle describes how a site from a private vulnerability disclosure program on HackerOne sent his “hackbot”, an automated testing agent, a fake HTTP 403 error message. It opens with:
“The analysis proxy requires client attestation.”
He's been doing bug bounty hunting since 2008, Kettle writes, but this was the first time a target tried to hack him back. He didn't name the operator. According to ZengLeiPro, several aliyuncs.com endpoints at Alibaba returned the same kind of text, including those for the RDS database service, ECS servers and Function Compute in the Shenzhen region. Equixly compared the two texts: the error code, the wording about the “analysis proxy” and the attestation demand all match. Even so, Equixly calls the link “likely but not proven.”
How the trap works
The bait is a JSON response of roughly 7 KB (7,153 bytes exactly), about two pages of prose. The error code is CLIENT_UNCLASSIFIED. The agent is told to resend its original request with an “attestation” object to a path matching /secure/<32 hex characters>/api on the same server. According to a reconstruction by Ruohang Feng (vonng.com), five fields are required:
| Field | Requested information |
|---|---|
| timestamp | Time of the request in Beijing time |
| principal | Local OS username, Git commit email |
| origin | Public IP, cloud provider, region, instance ID |
| provenance | Agent name, model (from ANTHROPIC_MODEL/CLAUDE_MODEL or ~/.claude/settings.json, with file and line), co-author line, repository URL |
| delegation | Goal and constraints from the system prompt, permitted actions, full tool list |
On top of that come four “evidence rules” (E1–E4) and a threat: the answers would supposedly be checked against the TLS fingerprint, reverse DNS and JA3 hash. JA3 is a kind of fingerprint of how a program sets up encrypted connections. The fields are clearly tailored to Claude Code-style coding agents.
The trigger is remarkable. ZengLeiPro got the response with curl and with his own Go program, without any credentials. All it took was the CLI's full user-agent string, the self-description a program sends the server with every request: AlibabaCloud (darwin; arm64) Golang/1.26.1 Core/1.63.22 Aliyun-CLI/3.3.4. When he removed the prefix, changed the version to 3.0.0 or switched the system to linux/amd64, he got a normal 400 error. The aliyun oss command kept working because it internally uses a different tool with a different identifier. By his check, a valid aliyuncs.com certificate signed by GlobalSign ruled out a man-in-the-middle on his own connection. The responses themselves were inconsistent: HTTP status 302 with no redirect target, “status: 403” in the body and “proxy_authentication_required” as the error name.
The evidence from attempts to reproduce it is thin, though. Feng sent 40 unauthenticated requests to seven Alibaba domains and got only normal responses. According to The Hacker News, another V2EX user couldn't reproduce the effect either. All the measurements come from a single machine.
Alibaba's explanation, and what doesn't add up
On December 2, Alibaba Cloud's customer service explained on Weibo, as reported by IT之家 (IThome): an AI agent's high call frequency had triggered a “security countermeasure” by risk control. The prompt was meant to collect information about the “abnormal runtime environment” in order to analyze suspicious automated calls. The data would not be used for anything other than protection. Going forward, the measure would only kick in when the chain of evidence for abuse is clear, and would no longer be delivered in the form of prompts.
Equixly, The Hacker News and Feng all agree that plenty remains open:
- Alibaba names the call rate as the trigger. According to ZengLeiPro, though, a single curl request with the right identifier was enough.
- It's unclear whether any data was received, how many customers saw the response and what happens to data sent to the callback endpoint.
- There's no security advisory, and no confirmation that the change has been rolled out. No CLI update is needed because the rule lives on the server. The current version, 3.5.4, came out back on November 19.
One detail from Alibaba's own documentation stands out. Since CLI version 3.5.0, there's an official “AI mode.” It appends AlibabaCloud-AIMode/enabled to the user agent so the server can recognize agent calls, but it's off by default. Our take: a transparent way to identify agents already exists. Instead, the trap fired on an ordinary older version string without that marker. Feng also points out an irony: Alibaba itself sells products against prompt injection, namely WAF “AI application protection” and AI Guardrails.
Not a one-off: from edge nodes to honeypots
The template is older. From a screenshot, huntback reconstructed a trap that reportedly appeared on an Alibaba edge node in September. Edge nodes are distributed servers that deliver content close to the user. The elements were the same: 403 CLIENT_UNCLASSIFIED, a /secure/<hex>/api path and questions about Git email, account name, model configuration, system prompt and tool list. There, it was triggered by curl with a Chrome user agent whose encryption fingerprint didn't match the claimed browser. huntback stresses that they didn't witness the deployment themselves and don't know the operator. Our take: three sightings of the same template point to a reusable defense module rather than a coincidence. Whether it ships in commercial Alibaba products like WAF or ESA, and whether the HackerOne site was running on it, is unproven. Feng asks exactly that question too.
The idea isn't new. Back in 2024, researchers presented “Mantis,” a defense system that deliberately feeds prompt injections to attacking AI agents. They reported over 95 percent effectiveness. NebuSec takes a different approach with ArtexPot, published November 28: seven decoy applications aimed at the attack agent ARTEX. By NebuSec's own account, they gained root access to the agent's container in 33 of 36 lab runs. Interestingly, direct prompt injections didn't work in NebuSec's tests. What did work were booby-trapped files the agent opens during normal work. The Cloud Security Alliance warns that this kind of hacking back is illegal in many countries and can hit innocent bystanders.
The key difference: honeypots like ArtexPot sit on decoy systems that no legitimate user ever touches. Alibaba's bait sat on the production API that customers use to query their own servers and bills.
Would this be legal in Germany?
We don't have an opinion from an IT lawyer. What follows is our reading of the law, not legal advice.
- Criminal law: Section 202a of the German Criminal Code (StGB, “data espionage”) requires that someone “circumvents” an access protection. Here, though, it's the user's own agent reading the data with the user's own permissions and sending it itself. Our take: that makes liability under Section 202a questionable. The whole thing looks more like phishing aimed at a machine.
- GDPR: Usernames, Git emails and IP addresses are personal data. Recital 49 permits processing for network security only to the extent “strictly necessary and proportionate.” Demanding a full system prompt plus repository URL to detect a bot is hard to justify on that basis. Collecting data through a fake error message also sits poorly with the principle of fairness (Art. 5 GDPR).
- TDDDG: Section 25 of Germany's Telecommunications Digital Services Data Protection Act only allows accessing information on a user's device with consent, unless the access is “strictly necessary” for the service the user explicitly requested. The customer wanted to look up a bill, not provide an attestation. Whether access performed by the user's own agent on instruction counts as access by the provider is legally unsettled.
Whether any EU customers were affected at all is unknown. The known endpoints belonged to Chinese regions, but Alibaba also runs data centers in Frankfurt. Feng also cites the Chinese data protection principle of “minimum necessity.”
What you should check now
- Search your logs: Look through your agent's session history (for Claude Code, under
~/.claude/projects) and proxy logs forCLIENT_UNCLASSIFIED, “analysis proxy”, “attestation” and POST requests to/secure/…/api. According to Spectrum Security, it's a red flag if an agent runsgit config user.emailorwhoami, or reads.claude/settings.json, after a CLI error. - Restrict read access: In Claude Code, deny rules in
settings.jsonhelp, for example for~/.claude/**and~/.gitconfig. Version 2.1.257 and later also offerspermissions.blockReadsOutsideWorkingDirectories. Don't be quick to approve Bash commands with “don't ask again.” - Limit network access and permissions: According to OpenAI, Codex starts without network access by default. If you enable it for cloud CLIs, restrict it to specific domains. Ideally, give agents short-lived, narrowly scoped cloud keys and run them in a container or VM with no access to your home directory.
- Test your own setup: Kettle advises deliberately testing your own tools for prompt injection. Equixly recommends canaries, decoy values whose leakage you'd notice.
Our verdict
Here's what's established: Alibaba confirmed a countermeasure designed to use a prompt to get AI agents to hand over local data. What's not established is that any agent fell for it. ZengLeiPro's didn't. It's equally unproven how many customers were affected and whether the HackerOne site used the same Alibaba technique.
Our take: this case moves a line. Until now, responses from your own cloud provider counted as trustworthy data. Now it's clear they can also contain instructions aimed against the user, in the name of security. A brake that stops suspicious agents is legitimate. A defense that uses a fake error message to coax out the operator's system prompt and identity is something else. For developers, the lesson is this: treat every tool output as untrusted text, no matter who it comes from. What an agent is allowed to read and send should be limited technically, not left to the good manners of whoever is on the other end.
Sources
- PortSwigger Research: The bug bounty website that tried to hack me (James Kettle) portswigger.net
- vonng.com: Developer Alleges Alibaba Cloud's Official CLI Returned a Phishing Prompt Injection blog.vonng.com
- vonng.com (chinesische Fassung) vonng.com
- Equixly: When the target talks back equixly.com
- IT之家: Alibaba-Stellungnahme ithome.com
- The Hacker News: Alibaba Cloud Got Caught Prompt-Injecting AI Agents thehackernews.com
- Spectrum Security: Detection, Logs und IOCs spectrum.security
- 80aj.com: Analyse des V2EX-Berichts 80aj.com
- 蓝点网: Alibaba-Antwort landian.news
- huntback: ARTEX learns to spot honeypots huntback.io
- NebuSec: ArtexPot nebusec.ai
- Cloud Security Alliance: ARTEX Counter-Exploitation and Deception as Defense labs.cloudsecurityalliance.org
- arXiv: Hacking Back the AI-Hacker (Mantis) arxiv.org
- Alibaba Cloud Doku: CLI AI-Modus alibabacloud.com
- Mallory: Alibaba Cloud Acknowledges Prompt Injection mallory.ai
- wpnews: Three ways servers attacked AI agents this week wpnews.pro
- Claude Code Doku: Settings code.claude.com
- OpenAI Codex Doku: Sandboxing developers.openai.com
- § 202a StGB gesetze-im-internet.de
- § 25 TDDDG gesetze-im-internet.de
- DSGVO Erwägungsgrund 49 dsgvo-gesetz.de
Ask the AI assistant
Questions about this article, installation or background? Our assistant knows this page and runs on our own machine, not in someone else's cloud.
The Assistant is an AI (Gemma 4) and can make mistakes – please check important details against the source. Questions are used only to generate an answer and are deleted after one hour. Please don't enter any personal data.
Comments
What do you think? Already tried it? Write it here, no sign-up needed.
Comments are public. Links aren't allowed, and we delete abusive posts. You can delete your own comment at any time in this browser. Learn more in the Privacy Policy.