Antigravity answers a system prompt that reads as Claude Code's or the
Claude Agent SDK's with a 429 "Resource has been exhausted", whatever
quota is left (xzplzpl on X). Tried with a real account, it matches
"x-anthropic-billing-header:" and "You are a Claude agent, built on
Anthropic's Claude Agent SDK", and lets the same prompt through with a
U+200B inside each. This middleware puts one after the first letter of
both words, in system text only (Anthropic system, Chat/Responses system
and developer messages, Responses instructions, Gemini
systemInstruction), and only in what an Antigravity account is sent: it
uses magpie's new onProvider hook (v0.1.1283), so a Claude subscription
or any other provider in the same routing group gets the prompt as the
agent wrote it. Options: extraWords, accounts, off. The README says the
ban risk and what happens if Google changes its match. After hexiaolv's
magpie-antigravity-cloak (MIT), which changes every request.
scripts/middleware.mjs: a case's "provider" runs the request on through
onProvider with ctx.provider, and expect_request is that try's body.
Run:
- HOME=$(mktemp -d) bun test: 1783 pass, 0 fail (the package's 12 cases
among them). bun scripts/check.mjs: every package ok.
- Real use: magpie built from e44b9aef3 in a sandbox HOME, a real
Antigravity account, this package added from its folder. Claude Code
2.1.302 `claude -p` on antigravity/gemini-3-flash answered; with
{"off": true} the same run got the 400. /v1/messages with the billing
line, the SDK line and Claude Code's three system blocks: 200 each on,
400 each off.
@magpie-community/middleware-antigravity-cloak
Claude Code and Claude Desktop on an Antigravity account, as magpie gateway middleware.
Antigravity answers a request whose system prompt reads as Claude Code's or the Claude Agent SDK's (which Claude Desktop's chats use) with 429 Resource has been exhausted, however much quota is left. magpie shows it as a 400 that says so. Tried with a real account, Antigravity matches two pieces of the prompt:
- Claude Code's billing line,
x-anthropic-billing-header: …; You are a Claude agent, built on Anthropic's Claude Agent SDK.
The same prompt goes through when each has a zero-width space (U+200B) inside it. This middleware puts one after the first letter of x-anthropic-billing-header and Claude Agent SDK, in the system prompt only, and only in what an Antigravity account is sent. Every other provider, a Claude subscription above all, gets the prompt as the agent wrote it, even in a routing group that tries Antigravity first. The model reads the words as before.
It needs a magpie with the onProvider hook (v0.1.1283 or later): an older magpie loads it and never calls it, so requests go as they came.
Install it from magpie's Plugins › Discover, or with magpie plugin add @magpie-community/middleware-antigravity-cloak.
Before you turn it on
- This changes what Google is sent so that a request it means to refuse isn't refused. It may be against Antigravity's terms, and Google can ban the account for it. Use it on an account you can afford to lose.
- Google can change what it matches at any time. Then the refusal comes back, and magpie may no longer recognise it as this refusal: it can read as a real quota running out and rest the account. If that happens, add the new words to
extraWords, or turn the plugin off.
Options
{ "extraWords": [], "accounts": ["antigravity"], "off": false }
extraWords: more words to break the same way, matched whatever their case.accounts: the subscriptions it acts on, by kind.antigravityis the default.off: leave every request as it came.
中文:Antigravity 看到 Claude Code / Claude Agent SDK 的系统提示词会回一个假的 429。这个中间件只在发给 Antigravity 账号的请求里,往 x-anthropic-billing-header 和 Claude Agent SDK 里插一个零宽空格,其他供应商(尤其是 Claude 订阅)收到的提示词不变。这样做可能违反 Antigravity 的条款,账号有被封的风险,请只用在可以承受损失的账号上。需要 magpie v0.1.1283 或更新版本。
After hexiaolv/magpie-antigravity-cloak (MIT), which breaks a longer list of words in every request, whatever provider it goes to.