Loading pattern...

What is System Prompt?

A System Prompt is a special instruction you give to an AI model before the conversation starts that defines its role, personality, behavior, and constraints. Think of it as "pre-programming" the AI—like telling an actor their character before the play begins. User messages come after the system prompt. System prompts persist across the entire conversation and guide how the AI interprets and responds to every user message.

When Should You Use This?

Use system prompts when building AI products, chatbots, or assistants where you need consistent behavior across conversations. Define the AI's role ("You are a Python tutor"), personality ("Be encouraging and patient"), output format ("Always respond in JSON"), constraints ("Never suggest paid tools"), and domain expertise. Most OpenAI/Anthropic APIs support system prompts as a separate parameter.

Common Mistakes to Avoid

  • Writing novels—long system prompts waste tokens and get ignored; keep it focused and clear
  • Being vague—"Be helpful" means nothing; specify exactly what helpful looks like
  • Not testing edge cases—users will try to jailbreak or confuse the AI; anticipate and block
  • Forgetting it's not magic—system prompts are instructions, not guarantees (AI can still ignore them)
  • Overloading with rules—too many constraints make the AI rigid and unhelpful; prioritize key behaviors

Real-World Examples

  • ChatGPT—uses system prompt to define its helpful, harmless, honest assistant persona
  • Customer support bots—"You are a friendly support agent for [Company]. Never apologize excessively. Escalate billing issues."
  • Code assistants—"You are a senior engineer. Provide code examples in TypeScript. Explain trade-offs."
  • Content moderation—"You review user content. Flag anything violent, hateful, or spam. Explain your reasoning."

Category

Ai Vocabulary

Tags

system-promptai-personalityprompt-engineeringchatbotllm-config

Permalink