ModulesLabQuizAll courses

Prompting for Operators

Write a prompt that returns the same shape of answer every time, keep a library of templates for your team, and set up an assistant that knows your own documents.

Module 2 of 14 · Day 1 · Session 2 · AI Administrator: Agentic Workflows & Automation

Module 02 ~45 min read + lab No code

What you will learn

Prerequisites: Module 1: Agents and Automation, Explained, plus an account on ChatGPT, Claude, Copilot or Gemini.

1. A prompt is a work instruction

When you hand a task to a new temp, you do not say "deal with the inbox". You say who they are standing in for, what the team does, what exactly to do, what they must not do, and what the finished result should look like. A prompt is the same instruction, written for a model. Vague instruction, vague output.

The difference between a chat you enjoyed and a prompt you can put inside an automation is repeatability. In Module 6 the same prompt will run hundreds of times a day without you watching. It has to produce the same shape of answer for every input. That is the standard you are learning to write to now.

The five parts

Role (who the model is), context (what it needs to know), task (the one thing to do), constraints (limits, tone, what not to do), output format (the exact shape of the answer). Most weak prompts are missing two of these.

2. The five parts, with a before and after

Here is a real request an office coordinator typed, and the version that works inside a workflow.

Before: Summarise this email and tell me what to do.
After: Role: You are an assistant to the facilities coordinator of a 200-person office. Context: We receive maintenance requests by email. Urgent means a safety risk or a stopped service (lift, water, power, access). Task: Read the email below and produce a triage note. Constraints: Do not invent details that are not in the email. If the urgency is unclear, say "unclear" rather than guessing. Maximum 80 words. Output format, exactly these labelled lines: Requester: Location: Issue (one sentence): Urgency (urgent / normal / unclear): Suggested next action: Email: [paste email here]
PartWhat it doesWhat goes wrong without it
RoleSets vocabulary, tone and assumed knowledgeGeneric, over-long answers
ContextGives the facts and definitions the model cannot knowThe model guesses your policies
TaskOne verb, one deliverableThe model does three things badly
ConstraintsLength, tone, forbidden actions, what to do when unsureInvented details, wrong register
Output formatMakes the answer machine- and colleague-readableDifferent shape every run; nothing downstream can use it

The line "If unclear, say unclear rather than guessing" is the single most valuable sentence in the prompt. It turns a confident wrong answer into a flag a person can act on. You will reuse it in every AI step you build.

3. Structured outputs and few-shot examples

An automation cannot read prose. It reads fields. Ask for labelled lines, a fixed set of categories, a markdown table, or a small set of key-value pairs, and say the allowed values out loud: "Category must be one of: billing, technical, sales, other."

Few-shot examples

Models copy patterns better than they follow descriptions. If your classification has edge cases, show two or three worked examples inside the prompt. This is called few-shot prompting.

Classify each message as billing, technical, sales or other. Example 1: "My invoice shows the old price" -> billing Example 2: "The portal logs me out every minute" -> technical Example 3: "Do you offer a plan for schools?" -> sales Example 4: "Thanks for the quick help yesterday" -> other Now classify: "[message]" Answer with the category only.

Iterating on a prompt

  1. Collect ten real inputs, including two awkward ones.
  2. Run the prompt on all ten and mark each answer right or wrong in a sheet.
  3. Fix the prompt for the wrong ones by adding a constraint or an example. Never fix by adding "be more accurate".
  4. Re-run all ten. Stop when you are at nine or ten out of ten twice in a row.

That ten-row sheet is your first test set. Keep it. In Module 12 you will use it again every time you change the prompt or the model.

4. Assistants that know your documents

Every major assistant now lets you save a standing set of instructions together with uploaded files, so you do not repeat the context each time. The names differ; the idea is the same.

ProductFeatureWhat you can uploadSharing
ChatGPTProjects, custom GPTsPDF, Word, spreadsheets, textCustom GPTs can be shared with a team or link
ClaudeProjects with project knowledgePDF, Word, text, imagesShared within a Team or Enterprise workspace
Microsoft CopilotCopilot agents, Copilot NotebooksSharePoint and OneDrive filesShared through Microsoft 365 permissions
Google GeminiGemsGoogle Drive filesShared with Workspace users

A "department assistant" built this way is the simplest agent you will meet: a model, instructions, and memory in the form of your documents. It has no tools yet, so it can only answer, not act. That is a good thing while you learn what it gets wrong.

Data goes where the model goes

Before you upload a policy, a contract or anything with personal data, check your organisation's rules and the product's data terms. Consumer tiers may use uploads for training; business tiers usually do not. Module 11 covers this properly. Until then, use public or dummy documents in the labs.

5. Where prompts fail: hallucination and over-confidence

A language model produces the most plausible next words. When it lacks a fact it will often produce a plausible fact instead. This is hallucination, and it looks exactly like a correct answer. Three habits catch most of it:

SymptomLikely causeFix
Cites a policy section that does not existNo source provided, or source not searchedUpload the policy, require a quote
Different category for the same email on two runsCategories not defined, no examplesList allowed values, add few-shot examples
Long, polite, says nothingNo task, no formatOne verb, labelled output lines, word limit
Confident answer to an ambiguous requestNo "unclear" optionAdd the unsure clause and route unclear items to a person

Practical lab

You will build two things: a five-template prompt library your team can reuse, and a department assistant that answers from uploaded documents. Use any of ChatGPT, Claude, Copilot or Gemini. For the documents, use public policies (for example a university's leave policy found online) or a made-up one; do not upload real internal documents yet.

1

Create the library document

Open a new document called M2-prompt-library. Make five headings: Triage an email, Summarise a meeting transcript, Draft a reply, Extract fields from a form, Classify a request.

2

Write each template with the five parts

Under each heading write role, context, task, constraints and output format. Use square-bracket placeholders such as [department] and [paste text] so a colleague can fill them in. Start from this skeleton:

Role: You are an assistant to the [role] in [department]. Context: [two or three facts and definitions the model must know] Task: [one verb, one deliverable] Constraints: Use only the information provided. If something is unclear or missing, write "unclear". Maximum [N] words. Tone: [plain / formal]. Output format (exactly these lines): [Field 1]: [Field 2]: [Field 3]: Input: [paste text]
3

Add examples to the classifier

For the Classify a request template, list four allowed categories and write one example for each. Add a fifth, awkward example that should be classified as other.

4

Build the ten-row test set

In a spreadsheet, write ten realistic inputs for the classifier, with the category you expect in the next column. Run the prompt on each and record the model's answer in a third column. Count the matches.

5

Fix and re-run

For every mismatch, change the prompt (a constraint or an example, not a plea for accuracy) and run all ten again. Record the second score.

6

Create the department assistant

In your assistant, create a Project (or custom GPT, Gem, or Copilot agent). Paste this as its instructions and upload two public policy documents:

You are the [department] policy assistant. Answer questions only from the uploaded documents. For every answer, quote the sentence you relied on and name the document. If the answer is not in the documents, reply: "Not covered by the uploaded policies. Please ask [named person]." Keep answers under 120 words.
7

Test the assistant with a trap

Ask it three questions the documents answer, then two they do not (for example a benefit that is not mentioned). Note whether it admits "not covered" or invents an answer. Record the results at the bottom of your library document.

Deliverable

The M2-prompt-library document (five templates, test scores before and after, and the assistant's trap-test results) plus a screenshot of the assistant answering one question with a quotation.

Knowledge check

Pick one answer per question, then check your score. These mirror the style of the final exam.

1. Which of the five prompt parts is most often missing from a prompt that gives a different shape of answer every time?

Why: Without an explicit output format the model chooses its own shape each run, which breaks anything downstream.

2. What is few-shot prompting?

Why: Examples inside the prompt show the model the pattern to copy, which is more reliable than describing it.

3. The best fix for a classifier that mislabels two of ten test emails is to...

Why: Prompts improve through specific constraints and examples, tested against the whole set so you do not break what already worked.

4. A department assistant built from a Project with uploaded documents is best described as...

Why: It has three of the four agent parts. Without tools it can answer but cannot act, which is ideal while you learn what it gets wrong.

5. Which single instruction most reduces the damage from hallucination?

Why: Giving the model an explicit way to say 'not found' turns an invented answer into a flag a person can act on.

Self-check

Answer in your own words first, then open the model answer.

1. Rewrite "Tell me what this contract says about cancellation" using all five parts.

Role: contracts assistant to the procurement team. Context: we need the notice period and any penalties. Task: extract the cancellation terms from the contract below. Constraints: only from the text, quote the clause, say unclear if absent, under 100 words. Output: Notice period / Penalty / Clause quoted / Confidence.

2. Why keep the ten-row test set after the prompt works?

Because prompts and models change. Re-running the same ten inputs after any change tells you immediately whether quality dropped. It becomes the evaluation set used in Module 12.

3. What is the difference between a project assistant and the agent you will build in Module 8?

The project assistant has a model, instructions and document memory but no tools; it can only answer. The Module 8 agent adds tools, so it can look things up and take actions.

Summary

Key takeaways

  • A prompt is a work instruction: role, context, task, constraints, output format. Missing parts cause most failures.
  • Ask for labelled fields and allowed values, and show examples; that is what makes an answer usable by an automation.
  • Improve prompts with a ten-row test set, one constraint or example at a time, and keep the set for later.
  • Projects and custom assistants give the model your documents as memory; check data rules before uploading anything real.
  • Ground the model, give it an exit, and verify the checkable facts.

Further reading: A Visual Guide to LLM Agents · LangChain and RAG concepts · Text classification with transformers