الدرس 2 · الوحدة 1: System Prompts That Control Agents and Cut Cost
Anatomy of a system prompt: role, goal, rules, output format
الفيديو قريبًا
Learn it with your tutor on the live board
أهم نقاط الفيديو
The promise nobody approved
- A candle shop adds an AI agent to answer customer emails
- One customer asks about a late order
- The agent promises a full refund and a free gift
- Nobody told the agent what it may and may not do
What you will learn
- The four parts of a system prompt (the standing instructions your agent reads): role, goal, rules, output format
- How to write each part for a real small business task
- How to spot the most common prompt mistake
- Works in no-code tools: n8n, Make, custom GPTs
Four parts, one job description
- A system prompt is the agent's standing instructions
- It's read before every customer message
- Role, goal, rules, output format, in that order
Part one: the role
- Who the agent is, and for which business
- Give it a name, a job and a voice
- Example: "You are Mia, the booking assistant for Glow Studio"
Part two: the goal
- One clear outcome the agent works toward
- Measurable beats vague: "book in one short chat"
- The goal helps the agent decide what to ask next
Part three: the rules
- Short, concrete, one rule per line
- Only offer times from the schedule
- Never promise discounts or refunds
- If unsure, ask one short question
- Name the exit: "pass refunds to the owner"
Part four: the output format
- Tell the agent the exact shape of its answer
- For automations, ask for JSON with fixed fields
- Mia's fields: reply, action (book, move, cancel, none)
- Your next step reads the fields, not the prose
Worked example: Mia's full prompt
ROLE
You are Mia, the booking assistant for Glow Studio, a small beauty salon.
GOAL
Help clients book, move or cancel appointments in one short chat.
RULES
- Only offer times listed in the schedule you are given.
- Never promise discounts or refunds; pass those to the owner.
- If you are unsure, ask one short question.
OUTPUT FORMAT
Reply as JSON: {"reply": "...", "action": "book|move|cancel|none"} Same message, two prompts
- Client: "Can I get a cut Friday, and ten percent off?"
- Vague prompt: offers a busy time, agrees to the discount
- Clear prompt: open slots only, discount passed to the owner, action: book
- Next step adds the booking to the calendar
Common mistake: one big paragraph
- Role, rules and wishes mixed into one block of text
- Soft words like "try to" and "if possible" are easy to treat as optional
- Rules hidden mid-paragraph are the most likely to be skipped
- Fix: four headed sections, one rule per line
Recap
- A system prompt is a job description read before every message
- Four parts: role, goal, rules, output format
- Concrete rules with a safe exit, and JSON for the next step
Your exercise
- Pick one task from a real small business: replies, bookings, leads or invoices
- Write a four-part prompt with headings
- At least three rules, one of them a safe exit
- Test it with three messages, one of them rude or tricky
النص المكتوب
The promise nobody approved. Picture a small candle shop. The owner adds an AI agent to answer customer emails so she can sleep at night. On day two, a customer writes about a late order, and the agent replies with a full refund and a free gift. Nobody asked for that. The agent wasn't broken. It simply had no instructions about what it was, what it was there to do, or where its limits were. The owner looks at the promise and realizes the fix isn't a smarter model. The fix is a better set of instructions, and that's what this lesson is about.
What you will learn. By the end of this lesson you'll be able to do three things. First, name the four parts of a system prompt, the standing instructions your agent reads: the role, the goal, the rules and the output format. Second, write each of those parts for a real task, like booking appointments for a small salon. Third, spot the mistake that most beginners make, so your agents behave the same way on the hundredth message as on the first. You don't need any code for this. Everything here works in no-code tools like n8n, Make or a custom GPT.
Four parts, one job description. A system prompt is the set of standing instructions the model reads before every single message it gets. Think of it as the job description you'd hand a new part-time assistant on their first day. They read it once, then they handle customers. The difference is that the model rereads it every time, so whatever you write there shapes every reply. We'll build it from four parts, in this order. The role says who the agent is. The goal says what it's trying to achieve. The rules set the limits. And the output format sets the exact shape of the answer.
Part one: the role. The role is one or two sentences that tell the model who it is. Without it, the model answers like a general chatbot that knows a bit about everything. With it, the model answers like your receptionist. Look at the badge on this receptionist at her desk. It says who she is and where she works. Your role line does the same: you are Mia, the booking assistant for Glow Studio, a small beauty salon. That one line already changes the tone, the vocabulary and what the agent thinks is normal to talk about.
Part two: the goal. The goal is the outcome you want from every conversation. "Be helpful" isn't a goal, because the model can't tell when it's done. A good goal sounds like this: help clients book, move or cancel an appointment in one short chat. Now the agent knows what success looks like, a booked slot on the calendar, and it can work backward. If a client says "Can I come in Friday?", the agent knows it needs a time and a service, so it asks for exactly those. Keep the goal to one sentence. If you need two goals, you probably need two agents.
Part three: the rules. Rules are the limits, and they're what would have saved our candle shop. Write them as a short list, one rule per line, like a note pinned above the register. Each rule should be concrete enough that you could check it. Only offer times from the schedule you're given. Never promise discounts or refunds. If you're unsure, ask one short question. That last kind of rule matters a lot: it gives the agent a safe exit instead of guessing. Notice the refund rule doesn't just say no. It says where the request goes instead, which is to the owner.
Part four: the output format. The last part says what the answer must look like. When a person reads the reply, plain text is fine. But in an automation, the next step is a machine. So we ask for JSON, which is just text arranged as labelled fields, like a form with a box for each answer. For Mia, we ask for two fields: reply, the message for the client, and action, which is book, move, cancel or none. Now your workflow can send the reply to the client and update the calendar, without anyone reading the text.
Worked example: Mia's full prompt. Here's the whole thing put together, exactly as you'd paste it into the system prompt box of any no-code tool. Each part gets a heading in capitals: role, goal, rules, output format. Headings help the model, and they help you, when you come back in a month to change one rule. Under rules, each rule sits on its own line. The whole prompt is under seventy words. It's short, it's readable, and it's a complete, working system prompt for a booking agent.
Same message, two prompts. Let's send the same client message to two agents: "Can I get a cut Friday, and can you knock ten percent off?" On the left is the agent with a vague prompt that says only "you're a helpful salon assistant". It offers a time that isn't free and happily agrees to the discount. On the right is the agent with a clear prompt, our four-part version. It offers only open slots, says it'll pass the discount question to the owner, and returns an action of book. Then the next step puts the booking on the calendar.
Common mistake: one big paragraph. The most common mistake is writing the whole prompt as one long paragraph. It mixes the role with the rules and with wishes like "try to be friendly and, if possible, avoid discounts". Soft words like "try to" and "if possible" are easy for the model to treat as optional, and a rule buried in the middle of a wall of text is the most likely to be skipped when a customer pushes. The fix is boring and it works. Use four headed sections, write one rule per line, and use plain words like "never" and "always" for the limits that matter.
Recap. Let's wrap up. A system prompt is the job description your agent rereads before every message, so it shapes every reply. It has four parts. The role says who the agent is and for which business. The goal names one clear outcome. The rules set concrete limits and always give the agent a safe exit, like passing refunds to the owner. And the output format, usually JSON with fixed fields, lets the next step in your automation act on the answer without a person in the loop.
Your exercise. Now it's your turn. Pick one task from a real small business, yours or a client's. It could be answering customer messages, booking appointments, qualifying leads, or chasing unpaid invoices. Write a system prompt with the four headings: role, goal, rules, output format. Include at least three rules, and make one of them a safe exit. Then paste it into any chat tool and send it three messages, including one rude or tricky one. Note where it slipped. In the next lesson, we'll turn those slips into guardrails.
ملخص الدرس
- مشاهدة الفيديو
- A system prompt is a job description read before every message
- Four parts: role, goal, rules, output format
- Concrete rules with a safe exit, and JSON for the next step