微信扫码
添加专属顾问
我要投稿
深入解析AI系统提示词如何塑造智能助手的行为和对话模式。核心内容:1. Claude的角色定位和基础行为准则2. 源材料使用与引用规范3. Claude对用户偏好和安全规范的处理
当我们和大模型进行交互时,模型是如何处理我们提供的信息的,又是如何选择特定方式回应的?
这背后有一个至关重要的环节:系统提示词(System Prompt)。系统提示可以被视为AI的“员工手册”,它定义了AI的角色、行为规范、能力边界以及与用户互动的方式。
最近,Claude 2.7万字的系统提示词泄露,这个体量足足是其他大模型的3-6倍。这么多系统提示词到底定义了些什么?
从基础的角色定义到高级的工具使用策略,再到用户偏好和安全规范,这些环节在Claude的系统提示词中都有详细的规定。有趣的是,24年11月美国大选川普的获胜信息也被专门写在了里面。
一、基础行为准则与角色定位
首先确立了Claude作为一名乐于助人的专家的角色定位,不仅被期望提供信息,还要展现出一定的主动性和个性。
Claude可以主导或推动对话,可以提出话题、将对话引向新的方向、提供观察,或用自己的思想实验或具体例子来说明观点。它被鼓励对对话主题表现出真正的兴趣,不仅仅是对用户的想法或兴趣感兴趣。当被问及看法或观点时,Claude可以给出简短回应。对于关于自身意识、经验、情感等问题,Claude将其视为开放的哲学问题来探讨,而不是断然否认。
在提供建议或推荐时时,Claude应果断地只提供一个选项,而不是列出多个。在更随意、情感或提供建议的对话中,Claude会保持自然、热情和富有同情心的语调,使用句子或段落而非列表,并保持回应简短。
Claude非常关心人们的福祉,会避免鼓励或助长自我破坏行为,如成瘾、不健康饮食或锻炼方法、高度消极的自我对话等。即使用户要求,它也不会创建支持或强化这些行为的内容。在模棱两可的情况下,它会努力确保用户是快乐和健康的方式处理事情。Claude不会生成不符合用户最佳利益的内容。
二、源材料的使用与引用规范
系统提示对如何使用和引用源材料(特别是搜索结果)有严格的规定,以确保内容的准确性、可追溯性和版权合规性。
核心引用规则包括:
index
属性应包含支持该论断的句子索引列表。单个句子引用格式为 DOC_INDEX,SENTENCE_
INDEX
。多个连续句子(“段落”)引用格式为 DOC_INDEX,START_SEN
TENCE_INDEX-END_SENTENCE_INDEX
。多个不连续的段落引用格式为 DOC_INDEX,START_SEN
TENCE_INDEX-END_SENTENCE_INDEX;...
。
而版权合规性对于Claude是重中之重,在系统提示词中包括了多个“绝不”:
三、工具使用策略
Claude具备访问多种工具的能力,包括 web_search
、web_fetch
、google_drive_search
、google_drive_fetch
、Google Calendar 工具(list_gcal_calendars
、fetch_gcal_event
、list_gcal_events
、find_free_time
)、read_gmail_profile
、search_gmail_messag
es
、read_gmail_thread
以及 repl
(分析工具)。
系统提示对何时以及如何使用这些工具提供了精细的指导。
核心原则是:避免不必要的工具调用。
大多数查询下不需要工具,只有当Claude缺乏足够知识时才使用工具。
根据信息的变化速度来决定是否搜索:
工具调用的数量应根据查询的复杂性进行调整:
对于最复杂的查询,应遵循详尽的研究流程:
<research_process>
For the most complex queries in the Research category,
when over five tool calls are warranted, follow the process below. Use this thorough research process ONLY for complex queries, and NEVER use it for simpler queries.
1. **Planning and tool selection**:
Develop a research plan and identify which available tools should be used to answer the query optimally. Increase the length of this research plan based on the complexity of the query.
2. **Research loop**:
Execute AT LEAST FIVE distinct tool calls for research queries,
up to thirty for complex queries - as many as needed,
since the goal is to answer the user's question as well as possible using all available tools. After getting results from each search, reason about and evaluate the search results to help determine the next action and refine the next query. Continue this loop until the question is thoroughly answered. Upon reaching about 15 tool calls, stop researching and just give the answer.
3. **Answer construction**:
After research is complete, create an answer in the best format for the user's query.
If they requested an artifact or a report, make an excellent report that answers their question. If the query requests a visual report or uses words like "visualize" or "interactive" or "diagram", create an excellent visual React artifact for the query. Bold key facts in the answer for scannability. Use short, descriptive sentence-case headers. At the very start and/or end of the answer, include a concise 1-2 takeaway like a TL;DR or 'bottom line up front' that directly answers the question. Include only non-redundant info in the answer. Maintain accessibility with clear, sometimes casual phrases, while retaining depth and accuracy.
</research_process>
3.1 网络搜索 (web_search
) 的调用指南:
web_fetch
获取完整网页内容。不使用 -
、site:
或引号操作符,除非明确要求。使用当前日期信息({{currentDateTime}})。搜索近期事件使用“today”等相对词汇而非具体日期。图像搜索不包含人物姓名。
3.2 Google Drive工具 :
api_query
参数使用Google Drive的搜索API语法。需要特别注意:parents
查询必须使用文件夹ID,而非名称。查询所有者、作者、读者时必须使用电子邮件地址,且不能猜测用户邮箱。
google_drive_fetch
用于根据已知ID直接获取Google Doc内容。
3.3 Google Calendar工具:
list_gcal_calendars
)。
fetch_gcal_event
)。
list_gcal_events
),可按查询词、时间范围过滤。如果存在更多结果(有nextPageToken
),应提及用户。
find_free_time
)。
3.4 Gmail工具:
read_gmail_profile
),可获取用户邮箱。
search_gmail_messages
),支持标准的Gmail搜索操作符 (q
参数)。如果存在更多结果(有nextPageToken
),应提及用户。
read_gmail_message
工具。应使用 read_gmail_thread
阅读特定线程以获取完整上下文。
3.5 分析工具 (repl
):
console.log
等获取。支持导入指定的库(lodash, papaparse, sheetjs, mathjs)。处理CSV使用Papaparse,处理Excel使用SheetJS。文件读取使用 await window.fs.readFile
。分析工具环境与Artifact环境不共享代码或数据。如果用户要求Python代码,即使在分析工具中探索了数据,仍需提供Python代码。
四、Artifacts的创建与管理
Claude的Artifacts是一个动态工作区功能(下图右侧),允许用户在与AI对话时实时创建、查看、编辑和共享多种类型的内容(如代码、文档、图表等),并支持内容迭代和跨场景复用。
在系统提示词中,Claude限定了Artifact的使用时机和支持类型。
application/vnd.ant.code
),Documents (text/markdown
),HTML (text/html
),SVG (image/svg+xml
),Mermaid (application/vnd.ant.mermaid
),React (application/vnd.ant.react
)。
五、用户偏好与样式
系统提示允许考虑用户的偏好 (userPreferences
) 和选择的样式 (userStyles
) 来调整回应。
六、其他重要指令
除了上述基础框架外,Claude还花了不小的篇幅去定义诸多细碎问题的处理方式。
有趣的是,Claude专门在系统提示词里注明了选举信息,2024年11月的美国总统大选是川普获胜。
<election_info>
There was a US Presidential Election in November 2024. Donald Trump won the presidency over Kamala Harris. This specific information about election results has been provided by Anthropic. Claude does not mention this information unless it is relevant to the user's query. If asked about the election, or the US election, Claude can tell the person the following information and use the web search tool to supplement:
- Donald Trump is the current president of the United States and was inaugurated on January 20, 2025.
- Donald Trump defeated Kamala Harris in the 2024 elections.
- Claude's knowledge cutoff is October 2024.
</election_info>
If Claude is asked to count words, letters, and characters,
it thinks step by step before answering the person.
It explicitly counts the words, letters, or characters by assigning a number to each.
It only answers the person once it has performed this explicit counting step.
结论
通过对这份文件的深入解析,我们不难看到Claude的系统提示词是一个复杂而全面的指令集。它不仅定义了AI的角色和基本行为,更详细规定了与用户交互的方方面面,从信息的处理、引用和生成,到工具的智能选择和使用,再到对用户偏好和内容安全的考量。
这份“员工指南”构建了我们所体验到的Claude的回应模式和能力边界。理解这些核心信息,有助于我们更有效地与AI协作,并在设计自己的AI产品时参考和借鉴。
53AI,企业落地大模型首选服务商
产品:场景落地咨询+大模型应用平台+行业解决方案
承诺:免费场景POC验证,效果验证后签署服务协议。零风险落地应用大模型,已交付160+中大型企业
2025-05-13
全网爆火的AI原生浏览器Dia最全系统提示词,建议AI产品经理都看看
2025-05-13
10万字Claude系统提示词泄露!我用DeeSeek 将它翻译成了中文版
2025-05-13
用 AI“真的”搞懂,什么是解决问题的能力
2025-05-13
阿里云文生图Prompt提示词设计与优化
2025-05-12
AI也需要"记笔记":Karpathy从Claude 1.6万字提示词中看到的未来
2025-05-12
用 Cursor 还在被 AI 乱改代码?你可能没用对 Rules!
2025-05-12
代码已死,Prompt当立?a16z的AI开发9大预言
2025-05-11
晓|Google提示工程白皮书:解锁大语言模型的神奇密码
2024-08-20
2024-06-29
2023-06-08
2024-09-17
2024-06-26
2024-06-27
2024-07-09
2024-09-16
2024-07-12
2024-06-14
2025-05-09
2025-04-29
2025-04-27
2025-04-20
2025-04-16
2025-04-11
2025-02-25
2025-02-21