Skip to main content
The system prompt (also called agent instructions) is the most important part of your agent. It defines the agent’s role, behavior, decision-making logic, and output format. Think of it as the agent’s job description and operating manual.

What is a System Prompt?

A system prompt is natural language text that tells the agent:
  • Who it is - Its role and persona
  • What it does - Its responsibilities and goals
  • How it works - When to use tools, decision criteria
  • What it produces - Output format and tone
Unlike traditional code, agents understand natural language instructions. You don’t write if/then logic - you explain the task like you would to a smart colleague.

Anatomy of a Good Prompt

Effective system prompts typically include these sections:

1. Role and Context

Define who the agent is and what domain it operates in.

2. Core Responsibilities

List the agent’s main tasks.

3. Decision Logic

Explain how the agent should make decisions.

4. Output Format

Specify how the agent should structure its response.

Complete Example

Here’s a full system prompt for an alert triage agent:

Prompt Engineering Tips

Bad: “Use VirusTotal to check things”Good: “Use VirusTotal to check any file hashes from the alert. If more than 5 vendors flag it as malicious, classify as Critical.”
Show the agent what good looks like:
Cover scenarios where the agent might get confused:
Tell the agent what NOT to do:
Break your prompt into clear sections with headers. This helps agents parse and follow instructions better.

Improving Prompts Automatically

Once your agent is deployed, Cotool automatically evaluates every run and suggests improvements when issues are detected:
1

Write Initial Prompt

Start with clear instructions covering role, responsibilities, and decision logic
2

Deploy and Monitor

Agent runs are automatically evaluated (scored 0-100)
3

Review Suggestions

When runs score poorly, system detects issues and suggests prompt fixes
4

Accept Improvements

Click “Generate Diff” to see suggested changes, then accept or reject
5

Track Versions

Each accepted improvement creates a new version automatically

Learn About Automatic Evaluations

See how every run is scored and improvement suggestions are generated

Common Pitfalls

Too Vague: “Analyze the alert and do the right thing”Agents need specific instructions about what “the right thing” means.
Too Rigid: “Always check these 5 tools in this exact order”Over-constraining the agent removes its adaptive reasoning capability. Guide, don’t dictate.
Conflicting Instructions: “Be thorough” vs “Respond in under 30 seconds”Make tradeoffs explicit and prioritize clear goals.
No Examples: Agents learn patterns from examples. Show don’t just tell.

Context Documents

In addition to the system prompt, agents can reference external documents:

Learn About Context Documents

Provide agents with runbooks, policies, and reference docs from Google Docs or Notion