System Prompt
写在对话最前面的"底层指令",定义了AI的角色、行为规则、输出格式等。
写在对话最前面的"底层指令",定义了AI的角色、行为规则、输出格式等。用户看不到 System Prompt,但它决定了AI的整体表现风格。相当于给AI的"岗位说明书"。
英文原文解释(Dictionary of AI Coding)
The instructions the harness prepends to every model provider request — the agent's standing brief: who it is, how to behave, which tools it can call, what conventions to follow. Usually stable across a session.
The system prompt is written by the harness vendor, not by you, and in coding harnesses it's big — often tens of thousands of tokens of behavioural rules, tool descriptions, and edge-case handling, all paid as input tokens on every turn. Your own standing instructions ride along with it: files like AGENTS.md are loaded next to the system prompt at the start of the session, so the model reads the vendor's brief and yours together before it ever sees your message.
Because it's identical on every request, it forms the start of the prefix cache — which is part of why harnesses keep it fixed for a whole session rather than editing it as they go.
Models are trained to prioritise the system prompt over user messages. So when an agent insists on a convention you never asked for, or formats output in a way you can't shake, it's usually obeying its system prompt — and your message is losing the argument. Some harnesses are customisable: they give you full access to the system prompt, so you can read what the agent is actually being told and change it.
什么时候会用到
讨论产品人设、行为控制、安全策略时会用。
例句
- 在 System Prompt 里加一条'如果不确定就说不知道',能大幅减少幻觉。
- 竞品的 System Prompt 被人套出来了,我们要做好防注入。
- Two harnesses, same model, totally different behavior on the same prompt.
- Different system prompts. One's tuned for terse code edits, the other for explaining — that's where the divergence lives, before your message even arrives.