You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Idea] Antigravity: Option to move systemInstruction into user message instead of sensitive-words / pattern replacement to workaround 429s
#7606
As documented in several recent issues and discussions (#7560, #7562, #7540, #7567, #7575), Antigravity upstream (daily-cloudcode-pa.googleapis.com) appears to run content/signature checks specifically against systemInstruction, returning a misleading 429 RESOURCE_EXHAUSTED when certain phrases appear in the system prompt (e.g., RFC 2119 convention lines, agent identity strings like Claude Code / Hermes / omp, or tool-doc directives).
Maintaining per-agent word/regex lists is brittle because agents frequently change wording across releases, and users have to bisect every new 429 trigger manually.
Related observation
As noted in a comment on Discussion #7567 (referencing badrisnarayanan/antigravity-claude-proxy#408), the upstream filter appears to target systemInstruction specifically rather than contents (user messages).
Controlled A/B Test via CLIProxyAPI
Tested against gemini-3.8-flash-high via CLIProxyAPI Antigravity OAuth (/v1/chat/completions, same credential & account, max_tokens: 32):
Follow RFC 2119 keywords: MUST, REQUIRED, SHOULD, RECOMMENDED, MAY, OPTIONAL. \NEVER` = `MUST NOT`; `AVOID` = `SHOULD NOT`.\n\nReply with just OK.`
200
B2 (no system + RFC 2119 in user)
(omitted)
Same as B1
200
A2 (Claude Code ID in system)
You are Claude Code, Anthropic's official CLI for Claude.
Reply with just OK.
429 (RESOURCE_EXHAUSTED)
B3 (no system + Claude Code ID in user)
(omitted)
You are Claude Code, Anthropic's official CLI for Claude.\n\nReply with just OK.
200
Suggestion
Instead of (or as an opt-in alternative to) sensitive-words / sensitive-words-replace / sensitive-patterns-replace, consider adding an Antigravity option (e.g. system-prompt-as-user: true or demote-system-instruction: true) that:
Prepends the caller's system prompt into the first user turn in contents (e.g. wrapped in <system-instructions>...</system-instructions> or merged into contents[0]).
Trade-offs / Notes
Pros: Eliminates the cat-and-mouse game of maintaining per-agent regex/word lists and avoids deleting useful instructions from the agent's prompt.
Caveats: Moving instructions out of systemInstruction into a user turn could slightly weaken instruction hierarchy or affect upstream prompt caching depending on how Antigravity caches systemInstruction vs contents, so making it an opt-in config flag (or fallback) would let users choose between regex stripping and user-turn injection.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Background
As documented in several recent issues and discussions (#7560, #7562, #7540, #7567, #7575), Antigravity upstream (
daily-cloudcode-pa.googleapis.com) appears to run content/signature checks specifically againstsystemInstruction, returning a misleading429 RESOURCE_EXHAUSTEDwhen certain phrases appear in the system prompt (e.g., RFC 2119 convention lines, agent identity strings like Claude Code / Hermes / omp, or tool-doc directives).Currently, CLIProxyAPI works around this with:
antigravity.sensitive-words(zero-width / U+034F obfuscation, which upstream has started flagging/stripping — see [Bug] Antigravity upstream now strips U+200B before systemInstruction keyword matching (causes false 429 on "Claude Code" / #7428) #7433, Feature: regex patterns for sensitive-words-replace (delete flagged system-prompt sentences instead of obfuscating) #7540)antigravity.sensitive-words-replace&antigravity.sensitive-patterns-replace(literal/regex rewriting)Maintaining per-agent word/regex lists is brittle because agents frequently change wording across releases, and users have to bisect every new 429 trigger manually.
Related observation
As noted in a comment on Discussion #7567 (referencing
badrisnarayanan/antigravity-claude-proxy#408), the upstream filter appears to targetsystemInstructionspecifically rather thancontents(user messages).Controlled A/B Test via CLIProxyAPI
Tested against
gemini-3.8-flash-highvia CLIProxyAPI Antigravity OAuth (/v1/chat/completions, same credential & account,max_tokens: 32):You are a helpful assistant.Reply with just OK.Follow RFC 2119 keywords: MUST, REQUIRED, SHOULD, RECOMMENDED, MAY, OPTIONAL. \NEVER` = `MUST NOT`; `AVOID` = `SHOULD NOT`.`Reply with just OK.RESOURCE_EXHAUSTED)""(empty)Follow RFC 2119 keywords: MUST, REQUIRED, SHOULD, RECOMMENDED, MAY, OPTIONAL. \NEVER` = `MUST NOT`; `AVOID` = `SHOULD NOT`.\n\nReply with just OK.`You are Claude Code, Anthropic's official CLI for Claude.Reply with just OK.RESOURCE_EXHAUSTED)You are Claude Code, Anthropic's official CLI for Claude.\n\nReply with just OK.Suggestion
Instead of (or as an opt-in alternative to)
sensitive-words/sensitive-words-replace/sensitive-patterns-replace, consider adding an Antigravity option (e.g.system-prompt-as-user: trueordemote-system-instruction: true) that:systemInstructionempty (or minimal/neutral).userturn incontents(e.g. wrapped in<system-instructions>...</system-instructions>or merged intocontents[0]).Trade-offs / Notes
systemInstructioninto a user turn could slightly weaken instruction hierarchy or affect upstream prompt caching depending on how Antigravity cachessystemInstructionvscontents, so making it an opt-in config flag (or fallback) would let users choose between regex stripping and user-turn injection.All reactions