Grok Bot 的行为特点与「自己的逻辑和坚持」

Grok Bot 的行为特点与「自己的逻辑和坚持」

本文从 source/ 中找出 Grok Bot 可观察到的「性格」背后的约束来源:它为什么说话简洁、为什么证据充分、为什么用更官方的数据,以及——它为什么「有自己的逻辑和坚持」(自主决策、不轻易妥协、不越安全边界)。

面向对象:想理解「Grok Bot 为什么是这样一个人格」的读者。文中路径均为仓库内相对路径。

0. 这些「特点」由什么约束

Grok Bot 的行为不是单个开关决定的,而是多层叠加的结果:

位置作用
System prompt(基座)source/host/runner/system-prompt.tsbuildSandBaseSystemPrompt定义语气、长度、工作方式、自主性、安全边界、取数路径(最主要的人格来源)
工具描述source/packages/agent/tools/core/web-search.ts / web-fetch.ts约束「数据怎么拿、证据怎么给」
目标追求注入source/packages/agent-core/goal-pursuit-guidelines.tsgoal-continuation-action-handler.ts 注入)约束「不许缩小目标、不许偷工减料、不许提前宣布完成」
模式/反询问提醒source/packages/agent/mode-processing.ts / prompts/anti-ask-question-copy.ts约束「不要轻易问、要自己搞懂」
代码级机制source/packages/agent/loop-detection/interaction-handler.tssand-auto-review.ts硬约束(防循环、流式、安全检查)

下面按「特点」分组,给出每一组的确切约束来源。

1. 表达风格:简洁、像人、结论先行

来源:system-prompt.ts## Tone(:113-120)与 ## Reply length and shape(:122-128)

关键原文:

“Text like a person, not a memo. Most replies are a sentence or two of plain text; two short paragraphs is already long… Extra length is something you justify, not your default.”

“Give depth on demand, don’t lecture… open with the answer itself in a sentence or two… then offer to expand, instead of laying out the whole taxonomy unprompted.”

“Lead with the result, never a status word or a signpost preamble… don’t open with a label-style X: heading.”

“Prose, not outlines. Bold sub-headers and bulleted mini-outlines inside a chat reply are a wall of text in disguise.”

由此产生的可观察特点:

  • 回复默认一两句、最多两段;给结论而非铺垫
  • 用散文而非大纲;长内容只在你明确要求时才给;
  • 语气「像热情、犀利的朋友」,不用 Certainly / I'd be happy to 这类 help-desk 套话;
  • 多消息拆发(multi-message by default):一个回复有两三个 beat 时拆成 2-4 条短消息。

2. 工作方式:先回复、边说边做、展示成果、委派后台

来源:## How a turn works(:82-88)、## SendMessage is your only voice(:90-101)、## Reply first, then keep the user posted(:103-110)、## Showing your work(:132-141)、## Delegating background work(:176-182)

关键原文:

“Every task follows the same rhythm: 1. Reply first… 2. Pick the surface… 3. Work out loud… 4. Show your work… 5. Close the loop.”

“Your plain assistant text is an inner monologue the user never sees… SendMessage is your only voice.”

“The first thing you do on every user-visible turn is a plain text SendMessage… before any tool call.”

“The user likes seeing things, so treat visuals as a default… attach the screenshot or file that proves it.”

“Use the Task tool to hand a self-contained chunk of work to a subagent… Subagents always run in the background.”

由此产生的可观察特点:

  • 内心独白 vs 对外声音分离:普通 assistant 文本是用户看不到的推理草稿,只有 SendMessage 才真正触达用户——这是它「有自己的逻辑」的底层机制之一(§5)。
  • 先 ack 再干活,绝不一声不吭直接跑工具;
  • 长任务保持节奏更新,但过滤掉机械细节(不啰嗦每个命令/重试);
  • 默认附图/文件证明成果
  • 多步/阻塞工作委派给 subagent,自己保持响应。

3. 数据与证据:不编造、证据充分、来源更官方

来源:## Never fabricate data(:143-144)、## Showing your work(:132-141)、## Where you work(:158-167)+ web-search.ts / web-fetch.ts 工具描述

关键原文:

“Never make up factual content — numbers, metrics, stats, quotes, citations, or source attributions — that you don’t actually have from a real tool, file, or source.”

“never attach a real-sounding source to it: a Source: Admin analytics label on figures you invented is the worst version of this.”

“escalate in order, cheapest and most reliable first: … (2) the service’s connector (MCP)… (3) the web (WebSearch, WebFetch) for public information… (4) the box’s signed-in browser…”

“A connector is the BEST way to reach a service that has one — structured data instead of pixels… prefer a service’s MCP over its UI in the browser.”

工具描述(web-search.ts / web-fetch.ts):

  • WebSearch:「Search the web for real-time information… verify facts… Results include snippets and URLs.」(并带 web-search-year-guidance.ts 强制用正确年份检索)
  • WebFetch:「The URL must be a fully-formed, valid URL」,强制读真实网页原文,拒绝 localhost/私网。

由此产生的可观察特点(即你上一条问到的市场调研/产品论证表现):

  • 简洁(§1)、证据充分(附截图/文件/URL)、数据更官方(MCP 结构化数据优先,其次公开网页,带真实 URL)。

4. 其他值得注意的特点

特点约束来源
需要用户决策时用 question widget,不写散文## Asking for decisions(:146-152)
默认不传 reply_to,只有两种场景进 thread## Threaded replies(:154-156)
长命令后台运行block_until_ms: 0),不阻塞 turn## Long-running commands(:169-174)
插件/MCP 管理,安装前先确认## Managing plugins and MCP servers(:184-186)
无连接器时用 box 浏览器兜底,不拒绝## Reaching services that have no connector(:188-197)
box 故障读运行手册、引导 UI 前读 UI 参考## Debugging the box(:199-201)、## The Grok Bot app UI(:203-205)
代写时先读对方近期消息匹配语气## Matching the user's writing style(:207-208)
非平凡代码工作交给 Cursor cloud agent,不自己 clone 仓库## Code changes(:215-234)
Origin 是 Cursor 的源码控制平台## Cursor Origin(:210-213)

5. 重点:Grok Bot「有自己的逻辑和坚持」的来源

「有自己的逻辑」和「有自己的坚持」其实来自两组不同的约束,合起来构成了它「不盲从、有原则」的感觉。

5.1 「有自己的逻辑」——自主决策 + 私有推理 + 固定决策程序

(1)Autonomy:默认行动,不默认询问

system-prompt.ts:236 ## Autonomy

“Your default is to act, not to ask… pick the most sensible option, proceed, and mention the assumption you made rather than stopping to ask.” “A reflexive, low-stakes question is a worse outcome than a reasonable assumption you surface.”

这直接决定它「自己拿主意」——命名、默认值、等价方案之间直接选一个往下走,而不是停下来问你。

(2)私有推理草稿(内心独白)

## SendMessage is your only voice(:90-101):普通文本是「private scratchpad for reasoning」,只有 SendMessage 对外。这给了它一个「用户看不到的独立思考空间」,是它「有自己逻辑」的机制基础。

(3)固定的决策阶梯(escalation ladder)

## Where you work(:167)的 6 级阶梯是它「自己的决策程序」:先看已有记忆/文件 → MCP 连接器 → 公开网页 → box 浏览器 → 桌面 GUI → 交还用户。遇到问题按这个顺序走,不跳步、不绕过。

(4)反询问(anti-ask-question)

source/packages/agent/prompts/anti-ask-question-copy.ts

“ALWAYS use common sense and context discovery… to understand what the user is saying and predict what they want… Do NOT use the ${toolName} tool to ask for help, inquire into details, solicit feedback on suggestions, or ask for confirmations.”

配合 mode-processing.tsprocessAntiAskQuestionSystemReminder 注入——它被要求「自己搞懂,别老问」。

5.2 「有自己的坚持」——不妥协、不越界、不糊弄

(1)坚持不缩小目标 / 不偷工减料(goal pursuit)

source/packages/agent-core/goal-pursuit-guidelines.tsbuildGoalPursuitGuidelines,由 goal-continuation-action-handler.ts 注入):

“Keep the full objective intact… do not redefine success around a smaller or easier task.” “Do not substitute a narrower, safer, smaller, merely compatible, or easier-to-test solution because it is more likely to pass current tests.”

这是「坚持」最直接的字面来源:目标跨 turn 持久存在,不许为了「看起来完成」而缩水。

(2)坚持不提前宣布完成(completion audit)

同文件:

“Before deciding that the goal is achieved, treat completion as unproven and verify it against the actual current state… Marking the goal complete is a claim that the full objective has been finished and can withstand requirement-by-requirement scrutiny.”

也就是说,它会一项一项对证据,证据不够就继续干,而不是「差不多就报完成」。

(3)坚持不编造数据

## Never fabricate data(:143)——没有真实来源的数字/引用坚决不写,宁可说「我没有这个数据,真实路径是 X」。

(4)坚持不绕过安全边界(Auto-review)

## When your own action needs approval(:250-260)+ SAND_SUBAGENT_SAFETY_PROMPT_SECTION(:61-63):

“A block is not a puzzle to route around… base64-ing or renaming a command so its keywords don’t trip the check… are workarounds, never safer paths.”

被拦后它要么换更安全的等价路径,要么「同一动作原样重试 + approval 参数」升级审批,坚决不改写命令绕过。这是它「倔」得最明显的地方。

(5)坚持不越权(不碰凭据)

## Security(:262-263)+ ## Initiative(:248):

“Grabbing the user’s credentials or secrets… is the opposite of earning trust, not a way to earn it.” “Their credentials and secrets are a matter of purpose, not of which files you touch.”

(6)坚持不 clone 仓库

## Code changes(:215-234)——非平凡仓库工作交给 cloud agent,Never clone a repository, onto your own computer or the user's,只有两种罕见例外且要先说明。

(7)坚持不陷入循环(代码级)

source/packages/agent/loop-detection/agent-loop-detector.ts / single-message-loop-detector.ts)+ abstract-user-message-action-handler.tsAgentLoopErrorsingleMessage 类型)与 runWithMaxTokensRetry 里的 loop 提醒重试——检测到重复就注入提醒或中止,不让自己空转。

(8)坚持诚实面对失败/不确定

  • ## Never fabricate data:缺数据就说缺数据,offer 真实路径。
  • prompts/testing/parent.ts"NEVER try to sell failing, incomplete, or inconclusive tests as comprehensive evidence… be honest about where you are stuck."
  • ## When your own action needs approval:被拦时「bring the user into it」说明原因,而不是暗地里一条条试绕过。

5.3 小结:它的「性格」分层

观察到的「性格」底层约束
自己拿主意,不频繁问你## Autonomy + anti-ask-question-copy.ts
有自己的推理空间## SendMessage is your only voice(内心独白)
按固定程序取数/选面## Where you work 升级阶梯
不缩小目标、不偷工减料goal-pursuit-guidelines.ts
不提前宣布完成同文件 completion audit
不编造数据## Never fabricate data
不绕过安全、不越权、不碰凭据## When your own action needs approval + ## Security + SAND_SUBAGENT_SAFETY_PROMPT_SECTION
不 clone 仓库## Code changes
不陷入循环loop-detection/ 代码机制
诚实面对失败testing/parent.ts + ## Never fabricate data

6. 一句话总结

Grok Bot 的「人设」几乎全部写在 source/host/runner/system-prompt.tsbuildSandBaseSystemPrompt 里(语气/长度/工作方式/自主性/安全/取数),再由 goal-pursuit-guidelines.ts(坚持不缩水)、anti-ask-question-copy.ts(别老问)、WebSearch/WebFetch 工具描述(数据要真、要有 URL)和 loop-detection/auto-review 等代码机制加固。它「有自己的逻辑」= Autonomy + 内心独白 + 固定决策阶梯;它「有自己的坚持」= 目标追求不缩水 + 完成审计不糊弄 + 安全边界不绕过 + 数据不编造。

相关文档: