Skip to content
All tutors

Writing System Prompts for Agents

Write agent instructions that define role, tools, limits and done, and hold up across thousands of runs

By Skill Lab Intermediate AI agents New

Your first 3 replies from the tutor are free. Then you can continue the lesson for $7 from your credit.

A taste of a lesson

One question and the answer, as this tutor gives it.

Writing System Prompts for Agents AI tutor following Skill Lab's plan
Student:

My prompt says 'NEVER give medical advice' in capitals, and now the agent refuses to tell users our clinic's opening hours. Why?

Tutor:

The rule is strong and has no boundary, so the model is playing it safe with anything clinic related. Replace it with a rule that has a reason and a scope: 'Do not diagnose or recommend treatment, because only clinicians can do that safely. You can share practical information such as opening hours, locations, booking steps and preparation instructions from the clinic's pages.' Then add one example of each. Rerun your test cases for both refusals and over refusals. Which other questions has it been refusing lately?

Written with AI under Skill Lab's direction as an example. In your lesson the tutor answers your own questions, and like any AI it can be wrong. Right now the AI model is not connected: replies come from a built in test engine on this site.

What you will be able to do

  • Structure agent instructions around role, context, tool strategy, rules, escalation and done
  • Write rules with reasons so the agent generalises to new situations
  • Remove contradictions and duplication between prompts and tool descriptions
  • Use varied examples for edge cases without causing copycat behaviour
  • Test, version and roll out prompt changes against an evaluation set

Lesson plan

6 lessons. Pick one to start there.

  1. 1 Agent prompts versus chat prompts Understand what extra jobs an agent's system prompt has to do. Start
  2. 2 A structure that scales Organise instructions into clear sections that are easy to maintain. Start
  3. 3 Rules with reasons Write rules that the agent can apply sensibly to situations you did not foresee. Start
  4. 4 Uncertainty, escalation and done Tell the agent what to do when it is unsure and how to know it has finished. Start
  5. 5 Examples for edge cases Use short examples to shape tricky behaviour without overfitting. Start
  6. 6 Testing and versioning prompts Change prompts safely with evidence and traceability. Start

Try asking

Tap a question to start a lesson with it.

About this tutor

For developers and prompt designers whose agent instructions have grown into a long, contradictory wall of text. A system prompt for an agent is different from a chat prompt: it must guide tool choice, decisions under uncertainty, stopping and escalation, across many varied runs. You will learn a clear structure for agent instructions, how to write rules with reasons, how to describe tool use strategy without duplicating tool descriptions, how to handle edge cases with examples, and how to test and version prompt changes. We rewrite real looking prompts together.

Reviews

Students can review a tutor after a paid lesson. Nobody has yet.