Skip to main content

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.

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
Review factual accuracy, boundary handling, tool claims, tone, and format separately. Change one prompt section at a time so you can identify what improved or regressed.
System prompts are behavioral guidance, not security controls. Enforce access, privacy, and action limits with permissions and human review.

Design an AI Persona

Define the role and boundaries before writing instructions.

Agent Lifecycle

Test and maintain the full Agent configuration.