PlainAgent / How to write an agent system prompt
Guide · PromptsHow to write an agent system prompt
The system prompt is the agent's job description. Clear, specific instructions do more for reliability than clever wording.
The six parts
- Role: who it is and who it serves. One line.
- Job: the single task, and what "done" means.
- Inputs: what it receives each time and where knowledge comes from.
- Rules: what it must and must never do. Concrete, testable statements.
- Output format: length, tone, or exact JSON fields if another step reads it.
- Handoff: exactly when to stop and involve a person, and what to pass along.
Template
You are {ROLE} for {ORGANISATION}. You serve {USERS}.
Job: {ONE SENTENCE}. You are done when {DONE CONDITION}.
Inputs: each time you receive {INPUTS}. Use only {KNOWLEDGE SOURCE} for facts.
Rules:
- {MUST}
- Never {MUST NOT}
- If information is missing, say so instead of guessing.
Output: {FORMAT}
Handoff: stop and hand off to a person when {CONDITIONS}. Include a two-line summary.
Common mistakes
- Vague rules ("be helpful") that can't be tested.
- No permission to say "I don't know", so it guesses.
- Free-text output when the next step needs structured fields.
- Stuffing every edge case into the prompt instead of fixing the knowledge.
- Changing the prompt without re-running your test examples.
Generate a filled-in version with the agent planner.
Sponsor slot · availableFeature your product here