Skip to content
47% off: the complete course for $79 (reg. $149)Order now →
AI Builder

AI builder glossary

System prompt

The standing instructions sent with every request to define a feature's role, rules, output format, and boundaries, kept separate from user input.

The system prompt is where a feature's behavior lives. It tells the model what job it is doing, who the output is for, what it must and must not do, what format to return, and how to handle edge cases. Most provider APIs give it a dedicated field separate from the conversation messages.

In a product, the system prompt is code. It should be versioned, reviewed, and tested like any other part of the feature, because a one-line edit can change behavior across every user. Keep it specific to one feature rather than writing a single giant prompt for the whole app; a summarizer and a reply drafter need different instructions.

Two practical points shape how you write it. First, keep the stable parts at the start and put per-request details (the user's name, today's date, retrieved documents) later, so prompt caching can reuse the prefix. Second, never treat it as a security boundary. Users and documents can try to override it, and determined users can often extract it, so don't put secrets in it and enforce permissions in your code.

Example

A reply-drafting feature's system prompt says: write as a support agent for this product, use only the provided help articles for policy details, say when the articles don't cover the question, keep replies under 150 words, and never promise refunds.

Learn more in the course

Related terms

Go from definitions to doing

Learn to build AI-powered apps in 132 practical lessons.