Module 1 · Foundations of Agentic AI · scripted

Exercise: Your First Agents

30 min

What "agency" means

Agency is the capacity to decide and take the next action yourself, instead of waiting to be told what to do. An LLM is showing agency when it drives the conversation — deciding what to ask, what to do next, and when it is done. That capacity is what the name agent points at: an agent is something that acts on its own behalf.

Agency, in one line

Agency= deciding and taking the next action yourself, instead of waiting to be told what to do.

An LLM with agency drives the conversation. That is what the name "agent" points at.

The goal: prompts that produce agency

In this exercise you will practice building an agent by writing flipped interaction prompts. The goal is to have the agent drive the conversation — and the moment it begins driving, it is demonstrating agency. You are practicing writing and architecting conversations that lead to agency from the agent.

What you are practicing

An agent here is a prompt — nothing more.
Your prompt must make the LLM take charge: decide what to ask, issue one action at a time, wait for the report, and choose the next action based on what came back.
When that happens, the conversation has a driver — and it isn't you.

The exercise at a glance

  1. 1
    Step 1: a flipped interaction prompt that teaches you to cook a dish.
  2. 2
    Step 2: add a fixed output format and see whether it holds.
  3. 3
    Step 3: a guided process from your own domain.
  4. 4
    Capture as you go — we read the prompts together at the end.

The exercise playground

For this exercise we have built an exercise playground — the Agent Lab — to help you do it. You create an agent, paste your prompt as its system prompt, and converse with it. Agents and their conversations are saved, so you can build several and switch between them — and the Prompts view lets you watch the machinery underneath.

You can also do the exercise in ChatGPT, Claude, or Gemini instead — if you're going to use one of those tools, click here for the instructions →.

How the playground works

  1. 1
    Open it.
    The link: /exercises/agent-lab — or scan the QR code on the next card.
  2. 2
    Create an agent and paste your prompt as its system prompt.
  3. 3
    Converse — you are the person being guided.
  4. 4
    Toggle to the Prompts view as you go.
    It shows, for every Send, the ENTIRE prompt actually transmitted — system message and every turn. Nothing is happening except that one growing prompt, re-sent again and again.

Scan to open the Agent Lab

Scan to open the Agent Lab
ai-agents-seminar.vercel.app/exercises/agent-lab

One thing worth experimenting with as you go: the driving prompt can live in different places — in the system instructions, as the first user message, or even dropped in as a user message mid-conversation ("From now on: guide me through X, one step at a time…"), which can flip an ordinary conversation into a driven one on the spot. If you try more than one placement, compare: does it change how strongly the agent drives, how well it holds the pattern over many turns, how easily it slips?

Step 1 · The cooking guide

Step 1 · What you'll do

  1. 1
    Create a flipped interaction prompt that teaches you to cook a dish, one step at a time.
    The skeleton below is a starting point — rewrite it in your own words and sharpen it.
  2. 2
    Run it, playing the cook.
    Report honestly what would happen at each step — and at least once report a problem ("the pan is smoking" · "there's no butter").
  3. 3
    Watch whether the agent keeps driving.
    Gathers what it needs, issues actions, adapts.

Write a flipped interaction prompt whose job is to guide you through cooking a dish, one step at a time. The basic pattern:

The flipped interaction pattern — a starting skeleton

user prompt
Guide me through cooking a dish of your choosing. First, ask me questions — one at a time — until you know what I have to work with (ingredients, equipment, time). Then give me ONE step at a time, and wait for me to tell you what happened before giving the next. Steps must be action-oriented: "Do ___ with ___." Adjust your next step based on what I report.

Capture — end of Step 1

💾 Save this before you move on

Copy into your course document and save:

  1. 1The exact prompt, verbatim.
  2. 2One exchange (2–3 turns) showing the agent driving.
  3. 3The moment it adapted to your problem report — or failed to.

Step 2 · Add a format

Step 2 · What you'll do

  1. 1
    Modify your prompt: add a FIXED FORMAT the agent must output every step in.
    For example, the format below.
  2. 2
    Run it again and watch what the format buys.
    Every step now arrives with an explicit request for the feedback the agent needs — the step and its report are designed as a pair.

A format to add to your prompt

user prompt
Every step you give me must follow this format exactly: Step number: the action to perform Question: what you need to know from me afterward

Capture — end of Step 2

💾 Save this before you move on

Copy into your course document and save:

  1. 1The updated prompt, verbatim.
  2. 2Two consecutive agent turns showing the format holding — or slipping.
Did the format hold?
  • Was the agent able to hold and maintain the format?
  • If it got the format right in the first few steps, did it keep it all the way through?
  • If it got it wrong early in the conversation, did the errors compound from there?

Step 3 · A complex process from your domain

Step 3 · What you'll do

  1. 1
    Think of an interesting process from your domain the agent could guide somebody through, step by step.
    Calibrating an instrument, running an analysis choice by choice, preparing a submission, a lab protocol, setting up field equipment.
  2. 2
    Build a flipped interaction prompt that guides them through it, with a fixed output format.
    The opening interview (questions before the guidance starts) is optional this time — include it only if your process needs it.
  3. 3
    Run it as the person being guided.

Run it as the person being guided. Give it one honest run — and one report of a problem the standard documentation for that process never mentions.

Before we regroup

💾 Save this before you move on

Keep one document for this course. Copy each item into it and save — we will read the prompts together at the end: what made the strongest prompts drive, where agents slipped out of the pattern, and which one sentence most changed an agent's behavior.

Copy into your course document and save:

  1. 1The exact prompt you used for your domain, verbatim.
  2. 2Be ready to discuss: what is the process, and how does your prompt guide somebody through it?

Be ready to discuss:

  • Where in the conversation did agency actually appear — which turn, and what in your prompt caused it?
  • If you tried more than one placement (system instructions, first message, mid-conversation), what differed?