# System prompt and revisions

> Write the standing instructions an agent reads before every conversation, keep every version, and roll back when a change makes the agent worse.

The **system prompt** is the standing instruction an agent reads before every conversation: what it does, how it should decide, what it must never do. Every version you save is kept, so changing it is reversible.

## When to use it

Reach for the prompt when the agent's *behavior* is wrong — it does the wrong thing, in the wrong format, or asks you things it should already know. Reach for a [connector](/docs/connect/overview/) or a [skill](/docs/capabilities/skills/) when it lacks a *capability*. Prompting cannot substitute for access.

## Write one

<Steps>

1. **Open the prompt section in [Agent Builder](/docs/build/agent-builder/).**

   You see the current text and the history of previous revisions.

2. **State the job in one paragraph.**

   Who the agent works for, what it is responsible for, and what falls outside that. An agent that knows its boundaries asks fewer pointless questions.

3. **Say what a good result looks like.**

   This is the part most prompts skip, and the part that changes results most. The agent chooses its own steps; what it cannot guess is your standard for "done".

   *"Summarize my unread email"* leaves everything to chance. *"Summarize my unread email, grouped by sender; for anything asking me a direct question, quote the question verbatim so I can answer without opening it"* does not.

4. **List the hard rules.**

   Things that must always or never happen — never email anyone outside the company, always cite the source document, never guess at a number.

5. **Save it as a new revision.**

   The previous text is not overwritten; it becomes a revision you can return to.

</Steps>

<Screenshot
  name="studio-prompt"
  alt="The prompt section: a Markdown editor holding the agent’s instructions, with a character count and the list of saved revisions below it."
/>

## Revisions and rollback

Every save creates a revision. The history shows what the prompt was at each point, and you can restore an earlier one.

This is what makes prompt iteration safe rather than a gamble. Change something, use the agent for a day, and if the change made it worse, go back to the revision that worked — you do not have to remember what the old text said.

<Aside type="note" title="A run uses the revision it started with">
  Restoring a revision affects the agent's next run. A run already in flight
  finishes under the prompt it began with, which is why an agent can appear to
  ignore an edit you just made.
</Aside>

## What belongs where

| Put it in | When |
| --- | --- |
| **System prompt** | It applies to every conversation — your role, standing rules, output format |
| **A message** | It applies to this task only |
| **[Character](/docs/build/identity/)** | It is about tone, not about the job |
| **[Memory](/docs/capabilities/memory/)** | It is a fact the agent should learn once and reuse — a preference, a name, a habit |
| **A [skill](/docs/capabilities/skills/)** | It is a repeatable procedure with steps, not a standing instruction |

A prompt that has grown to cover four unrelated jobs is a sign you need a second agent, not a longer prompt.

## Limits

- A prompt cannot grant access. If the agent needs your calendar, it needs a bound connection — writing "you have access to my calendar" changes nothing.
- Restoring a revision replaces the whole prompt. There is no merge between revisions.
- The prompt is per agent. Two agents that should share standing rules need the text in both.

## Related

<CardGrid>
  <LinkCard
    title="Testing and iterating"
    href="/docs/build/iterating/"
    description="How to tell whether a prompt change actually helped."
  />
  <LinkCard
    title="Memory"
    href="/docs/capabilities/memory/"
    description="Facts the agent learns once instead of being told every time."
  />
  <LinkCard
    title="Skills"
    href="/docs/capabilities/skills/"
    description="Repeatable procedures that do not belong in a prompt."
  />
</CardGrid>
