DEV Community

Cover image for What Is a System Prompt? Where Your Durable Instructions Actually Belong
Nico Acosta for BrainGrid

Posted on • Originally published at braingrid.ai

What Is a System Prompt? Where Your Durable Instructions Actually Belong

A system prompt is the most powerful instruction you can give an AI model, and it is the wrong place to put almost everything people cram into it.

That sounds backwards. The system prompt sits above every other message, it steers tone, format, and behavior across the whole conversation, and it is the first thing most builders reach for when their agent misbehaves. So the instinct is to keep adding to it. When the agent forgets a rule, you add the rule to the system prompt. When it uses the wrong style, you add the style. A month in, your system prompt is a 400-line rulebook, and the agent still drifts.

The problem is not that the system prompt is weak. It is that you have been using it as a filing cabinet for things that were never supposed to live in a prompt at all.

What a System Prompt Actually Is

A system prompt is a set of standing instructions given to a language model before it ever sees a user's message. It defines how the model should behave across the entire session: its role, its tone, its constraints, the format it should answer in. NIST's glossary puts it precisely: system prompts are "application-specific instructions provided in-context to a GenAI system by the model developer or application designer." They are the ambient behavior layer.

Think of it as the difference between a job description and a task. The system prompt is the job description. It says "you are a senior code reviewer, you respond in plain language, you never approve code you cannot explain." The user prompt is the task: "review this pull request." The job description is set once and applies to everything. The task changes every time.

Every major model exposes this layer. In the OpenAI, Anthropic, and Google APIs, you pass a system role (or a system instruction) separate from the user turns. In consumer tools, it is the "custom instructions" or "personality" field. In coding agents, it shows up as the file the agent reads on startup, CLAUDE.md for Claude Code, AGENTS.md for the broader ecosystem, the ambient context that shapes every response before you type a word.

System Prompt vs User Prompt: The Distinction That Matters

The cleanest way to understand a system prompt is by what it is not. A user prompt is a single request in a single turn. A system prompt is the standing context that request lands in.

System prompt: "You are a technical writer for a developer audience. Write in short paragraphs. Never use marketing language. Always include a concrete code example when explaining an API."

User prompt: "Explain how our webhook signing works."

Swap the user prompt for a hundred different questions and the system prompt still holds. That persistence is the whole point, and it is also the trap. Because the system prompt persists, it feels like the natural home for anything you want the agent to remember. Your API conventions. Your database schema. The acceptance criteria for the feature you are shipping this week.

That is where builders go wrong. Persistence across a conversation is not the same as being the durable record of your product. A system prompt lives inside one model's context window, for one session, and it is invisible to everyone but you. Push project knowledge into it and you have created a record that only exists as long as the chat does.

The System Prompt Is Not Your Product's Memory

Here is the reframe. Builders keep discovering, the expensive way, that the model's context is a bad place to store what the product actually needs to know.

The clearest recent evidence came from a Claude Code thread where someone asked whether anyone actually uses the built-in memory feature as a project record. The answers were unanimous, and none of them were kind. One developer had tried exactly that and regretted it:

I made the mistake of trying to use it for project knowledge and now it is bleeding into other projects smh. Don't be like me.

Others in the same thread reported the same failure from different angles. The memory was "entirely opaque" and a wrong entry went undiscovered for a month. Another disabled it outright because "it quickly gets outdated." The consensus that emerged was a rule worth writing down: memory is for user preferences, not for knowledge. Behavior, not facts.

That rule applies to your system prompt too, because a system prompt and an agent's memory are the same kind of thing. Both are ambient context. Both shape behavior. Both go stale silently, because nothing checks them against reality. The moment you use either one to hold your product's requirements, you have made a record that bleeds, drifts, and lies without telling you.

The counterargument is fair, and you should sit with it: any written record goes stale, including the one you keep outside the model. That is true. But there is a difference between a record you can see, version, and verify against, and one buried in a context window you never read. A builder in another thread named the discipline that makes a written record survive: "the wiki must reflect the current state 100%." You cannot enforce that on a system prompt you last touched three weeks ago and cannot inspect. You can enforce it on a plan you own.

What Belongs in a System Prompt, and What Doesn't

The useful line to draw is between how your agent works and what it is building.

The system prompt is for the "how." Your conventions, your tone, your formatting rules, the commands the agent should run, the mistakes it made last week that you turned into a standing instruction. These are true across every feature. They are ambient by nature, and the system prompt is exactly where they should live.

The "what" is different. The requirements for the feature you are shipping, the acceptance criteria that define done, the specific behavior the code must exhibit, none of that is ambient. It is specific, it changes per feature, and it needs to be verifiable. Put it in the system prompt and it competes for attention with everything else in the window, degrades as the session grows, and leaves you no artifact to check the finished work against.

Compare the two failure modes:

The agent behaves inconsistently across a session: it forgets your code style, ignores your naming convention, switches tone. That is a system prompt problem. Fix the "how" in the ambient layer.

The agent builds the wrong thing, or builds something that looks right and breaks in production. That is not a prompt problem at all. That is a missing spec. No system prompt is going to define "done" for a feature it has never heard of.

This is the gap BrainGrid is built to close. The Planning Agent takes the feature you describe and turns it into a requirement with real acceptance criteria, the "what" written down as statements you can verify, not buried in a prompt. That requirement is the durable record. When the Builder Agent writes the code, in BrainGrid Cloud or in your own GitHub repo with Claude Code, Cursor, or Codex over MCP, the acceptance criteria are what the work gets checked against. A feature is not done because the agent stopped. It is done because every criterion is verified with evidence.

The system prompt still matters. It carries how your agent works. But the thing that defines whether the build is correct lives in the plan, where you can see it, version it, and hold the finished code up against it. Models are stateless. Your product is not.

The Practical Version

If you are debugging an agent that keeps misbehaving, the fastest triage is to ask which layer the problem lives in.

If the agent's behavior is off, tone, format, ignoring a convention, that is your system prompt. Tighten it, and keep it short. A shorter system prompt attends better than a long one, the same reason a bloated context window makes an agent dumber, not smarter. Deciding what earns a place in that ambient layer, and what belongs somewhere the model can be checked against, is the whole discipline of context engineering. Boris Cherny, who built Claude Code, found that cutting context beat adding it for the tool itself.

If the agent builds the wrong thing, stop editing the prompt. No amount of ambient instruction defines a feature the agent was never given. Write the requirement, with acceptance criteria, somewhere you own and can verify against. Then let the agent build against that.

The system prompt sets the stage. It does not write the play.

FAQ

What does a system prompt mean?

A system prompt is a set of standing instructions given to an AI model before any user message, defining how it behaves across the whole session: its role, tone, constraints, and output format. It is the ambient behavior layer that applies to every response, as opposed to a single request. Most model APIs expose it as a separate system role.

What is the difference between a system prompt and a user prompt?

A user prompt is a single request in a single turn ("review this pull request"). A system prompt is the persistent context that request lands in ("you are a senior code reviewer who responds in plain language"). The user prompt changes every turn; the system prompt is set once and shapes all of them. The system prompt is the job description, the user prompt is the task.

Do I need a system prompt?

For a one-off question, no. For anything you use repeatedly, yes: a good system prompt reduces the instructions you have to repeat in every message, lowers token usage, and makes responses more predictable. But keep it to behavior and conventions, the "how." Do not use it to store your product's requirements or a feature's acceptance criteria, which belong in a plan you can verify against, not in ambient context.

What is the system prompt in ChatGPT?

In ChatGPT, the system-level instructions come from OpenAI's own hidden system prompt plus your "custom instructions," the fields where you tell it how to respond across all chats. In the API, you set it explicitly with the system (or developer) role. Either way it plays the same part: standing behavior applied before your actual message.

Can a system prompt go stale?

Yes, and this is its main risk as a knowledge store. A system prompt is invisible ambient context that nothing checks against reality, so outdated instructions sit there silently steering the model wrong. That is why it should hold durable behavior, not fast-changing project facts. Requirements that change per feature belong in a record you can inspect and version, not in a prompt you last edited weeks ago.

Your agent's behavior belongs in the system prompt. What it is building belongs in a plan you can verify against.

BrainGrid is the system that takes an idea to a live product you can trust, turning what you want built into requirements with acceptance criteria your coding agent can be verified against. Try it at braingrid.ai.


Originally published on the BrainGrid blog.

Top comments (0)