LearnAILevel 1.5 · Agents ← Roadmap

Station 5 · Prompting Your Agent

Prompting your agent

An agent is only as good as the instructions steering it. The prompt is where you tell it who it is, what it's allowed to do, and how to behave on every loop — not just once.

5 of 10 · ~6 min

What you'll walk away with

Concept 1

The system prompt is a job description

When you chat with an LLM, your message is a one-off request. An agent has something extra sitting above every turn: a system prompt that stays in place for the whole task and governs each loop.

Think of it as the agent's job description. A good one spells out four things:

A chatbot prompt is a single question you can rephrase if the answer disappoints. A system prompt is different: it fires on every step of the loop, so a small flaw gets repeated dozens of times before the agent finishes.

🧑‍💼 Analogy: briefing a new intern

Imagine a sharp new intern on day one. If you say "handle the inbox," they'll do something — but maybe reply to the wrong people. If you say "sort today's emails into Urgent / Later / Ignore, draft replies only for Urgent, and never hit send without asking me," they nail it. Same intern, same skills — the briefing is what changed the outcome. Your system prompt is that briefing, given once and followed all day.

Concept 2

The habits of a good prompt

Straight from the roadmap, these are the moves that turn a vague ask into instructions an agent can actually act on:

🔑 The core idea

You don't steer an agent by hoping — you steer it with the prompt. Specific + context + examples + format, then iterate. Every ambiguity you leave in the prompt is a decision the agent will make for you, over and over.

Concept 3

A good agent system prompt

Here's what those habits look like assembled into a real job description — role, tools, rules, and a stop condition, plus a tiny few-shot example.

system_prompt.txt
# ROLE — who it is
You are a travel research agent. Goal: find 3 flight
options for the user and rank them by total cost.

# TOOLS — what it can call, and when
search_flights(origin, dest, date)  → use for live prices
get_baggage_fees(airline)          → add before ranking

# RULES — how to behave
- Always use tools for prices. Never guess a fare.
- Include baggage fees in "total cost".
- Format each option as: Airline · $total · stops.

# STOP — when the job is done
Stop once 3 ranked options are listed. Do not keep searching.

# EXAMPLE (few-shot) — show one input → output
Input : AUS → JFK, Aug 3
Output: Delta · $312 · nonstop
        United · $340 · 1 stop
        JetBlue · $358 · nonstop
why this worksThe agent knows its role, which tool to reach for, how to format, and — crucially — when to stop. No guessing, no endless looping.

Concept 4

Weak vs. strong, side by side

Same goal, two prompts. Watch how much of the agent's behavior is decided by the wording alone.

Vague

"Find me a good flight to New York."

Good how? Cheapest, fastest, fewest stops? No date, no budget, no format. The agent has to invent the missing pieces — and may search forever without knowing when it's "done."

Specific

"Find the 3 cheapest nonstop flights AUS→JFK on Aug 3. Include baggage fees. List as: airline · total · stops. Stop at 3."

Exact goal, real constraints, a format, and a stop condition. The agent calls the right tool, ranks correctly, and finishes.

Nothing about the model changed between those two — only the instructions. That's the whole point: prompting is the steering wheel, and most "the agent did something weird" moments trace back to a fuzzy prompt.

Concept 5

Why fuzzy prompts hurt agents more

For a plain chatbot, a vague prompt just means a mediocre answer you can re-ask. For an agent, the same vagueness compounds — because the agent acts on it, step after step:

🔀 Wrong tool

If the prompt doesn't say when to search vs. calculate, the agent guesses — and a wrong tool call sends the whole loop down the wrong path.

♾️ Endless loops

With no clear stop condition, the agent keeps "improving," re-searching, and re-checking — burning time and money without ever declaring done.

🌀 Hallucination

When the goal is underspecified, the agent fills gaps by inventing details — then confidently builds on its own made-up facts.

🎯 Drift

Vague instructions let each loop reinterpret the task, so the agent slowly wanders away from what you actually wanted.

Checkpoint

Your agent keeps searching and never returns an answer. Which prompt fix most directly addresses that?

Make the whole prompt longer and more detailed. Add a clear stop condition — tell it exactly when the goal counts as done. Switch to a bigger, more powerful model.

An agent runs a loop, so "when do I stop?" is a real instruction it needs. Without a stop condition it will keep taking actions. More length or a bigger model doesn't help if you never told it what "done" looks like — spelling out the finish line does.

Try it yourself — 5 minutes

Sharpen a vague prompt and watch the behavior change

Open any AI assistant that can browse the web or run code (ChatGPT, Gemini, or Claude) and run the same task twice:

  1. First ask it vaguely: "Find me a good laptop." Notice how much it has to assume — budget, use, size.
  2. Now rewrite it specific: "List 3 laptops under $800 for video editing, ranked by price, as: name · price · one reason. Use current prices and stop at 3."
  3. Compare the two answers. Same tool, same model — the prompt is what made the second one useful.

Want to go deeper on general prompting technique? That's the whole focus of Level 1.


Recap. The system prompt is your agent's job description — who it is, its tools, its rules, and when to stop — and it governs every loop. Good prompts are specific, carry context, use examples, and set the format, then get iterated. Get it fuzzy and the agent calls the wrong tool, loops forever, or hallucinates. Next, we give the agent something to remember between steps: memory.