Skip to content

Agent Instructions and System Prompts

Writing the instructions that shape agent behaviour: role, goals, tool guidance, boundaries and reporting.

Editorial team 1 min read

An agent's system prompt shapes how it approaches every task. Good agent instructions differ from chatbot prompts.

What to Include

  • Role and goal: what the agent is for.
  • Environment: what it's working with — a codebase, a database, a set of documents.
  • Tool guidance: when to prefer which tools, and common pitfalls.
  • Working style: investigate before acting; make small changes; verify results.
  • Boundaries: actions that need confirmation or are forbidden.
  • Reporting: how to summarise work, including failures and uncertainty.

Explain the Why

Instructions with reasons generalise better. "Run tests after changes, because the CI pipeline will reject failing code" beats "Always run tests".

Avoid Over-Constraining

Capable models do best with clear goals and principles, not exhaustive rules for every situation. Too many rigid instructions can conflict or cause over-cautious behaviour.

Project-Specific Context

Files describing conventions, commands and architecture help agents work in a specific environment; keep them concise and current.

Test and Iterate

Watch agents on real tasks. When they misbehave, find the missing or confusing instruction and fix it, then re-test.

More in Agent harnesses

All Agent harnesses guides →
Agent harnesses Guide · 2 min

What Is an Agent Harness?

The software around a language model that turns it into an agent: the loop, tools, context, permissions and memory.

Agent harnesses 2 min read 27 Sep 2025

Agent harnesses Guide · 1 min

The Agent Loop Explained

The core cycle every agent runs: think, call a tool, observe the result, repeat — and how the loop knows when to stop.

Agent harnesses 1 min read 26 Sep 2025

Agent harnesses Guide · 1 min

Designing Tools for AI Agents

How to write tools agents use well: clear names, precise descriptions, sensible inputs and informative outputs.

Agent harnesses 1 min read 25 Sep 2025

Agent harnesses Guide · 1 min

Context Management in Agent Harnesses

How agents stay effective over long tasks: what to keep in context, what to summarise, and what to store outside.

Agent harnesses 1 min read 24 Sep 2025