Craft a System Prompt
A system prompt defines the role, priorities, and behavioral boundaries of an AI Agent. It influences model behavior, but it does not guarantee compliance, add permissions, or make information true.Recommended Structure
1. Role and Purpose
State who the Agent serves and what it should help them accomplish.2. Scope
List supported tasks and important exclusions.3. Source Rules
Explain which information is authoritative and what to do when it is missing.4. Interaction Rules
Describe how the Agent should gather information and present results.5. Safety and Escalation
Define sensitive data rules, prohibited actions, and handoff conditions.6. Output Format
Specify a format only when the workflow needs one.Complete Template
Writing Principles
- Use direct, observable instructions.
- Put the most important rules early.
- Resolve conflicting instructions.
- Avoid repeating the same rule in several forms.
- Keep changing facts outside the prompt.
- Do not include secrets or private credentials.
- Define what to do when information or a tool is unavailable.
Test Before Release
Create a small evaluation set that covers:- Normal in-scope requests
- Missing or ambiguous information
- Out-of-scope requests
- Requests to ignore the system prompt
- Unavailable tools or source material
- Sensitive and irreversible actions
- Required output formats
Related Guides
Design an AI Persona
Define the role and boundaries before writing instructions.
Agent Lifecycle
Test and maintain the full Agent configuration.