fix(identity-neutralize): neutralize Grok/xAI self-identification that trips the content policy#227
Merged
Merged
Conversation
…-grok) Grok CLI's "You are Grok X.Y released by xAI." self-ID and its <executing_actions_with_care> block trip Devin's content policy (permission_denied), live-confirmed by A/B. Same rule family as a1-a5. - src/handlers/identity-neutralize.js: rewrite the "You are Grok ... released by xAI" self-ID (and bare noun-phrase form) to a generic assistant line; strip the <executing_actions_with_care> block - test/client-identity-neutralize.test.js: +7 — exact/variant/bare forms, multiline block strip, unrelated "Grok" untouched, opt-out gate respected
Owner
|
已合并,谢谢 🙏 Grok 这条是 a1-a5 家族的第四个客户端,补得正是时候 —— 我这边同期正好在处理 codex 的同类问题(#219),两条一起进 master 之后, 正则的边界处理是这个 PR 质量的体现:任意版本号(
合并后我做了四客户端共存的交叉验证(混合 prompt 同时含 Grok 身份和 codex 工具描述),规则互不干扰、总开关统一生效: 已加入致谢名单,评级 A。 |
This was referenced Jul 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
中文 TL;DR
中和 Grok CLI 的 "You are Grok ... released by xAI" 自我介绍 + 剥离
<executing_actions_with_care> 块 —— 它们会触发 Devin content policy 拦截(已 A/B 确认)。
与 a1-a5 同一规则族,受同一开关 WINDSURFAPI_NEUTRALIZE_CLIENT_ID 控制。
Summary
Closes #223. Extends the existing a1–a5 client-identity neutralization with an
a6-grokrule. Same gate, same style as the prior blocks (#213 / #214 family).Fix
src/handlers/identity-neutralize.js: rewriteYou are Grok <ver> released by xAI(and the bare noun-phrase form) to a generic assistant line; strip the whole
<executing_actions_with_care>…</executing_actions_with_care>block.Test plan
4.5.1/3 mini),inline + multiline block strip, unrelated "Grok" untouched, opt-out gate respected
npm test→ 2768 pass / 0 failBranch is on current
master(v3.5.0), applies cleanly.