System Prompts
Set behaviour, tone, and constraints for the entire conversation
🔑 Key Concepts
- Purpose — System prompts set the model's role, behaviour, and boundaries. They apply to every message in the conversation.
- Structure — Role definition + task description + constraints + output format. Keep it under 500 tokens for efficiency.
- Common patterns — You are a [role]. Your task is [task]. Always [constraint]. Never [prohibition]. Format output as [format].
- Testing — Test with adversarial inputs. Can the model be convinced to ignore its system prompt? Add explicit refusal instructions.
💡 Practice: Try implementing each concept yourself before moving on. Reading about RAG and building RAG are very different things.