Module 01 · Agent Fundamentals
From Chat to Agent: The 2026 Definition That Matters
Open lesson + course map
On this lesson
Course outline
Module 1 · Agent Fundamentals
Module 2 · Agent Frameworks
Module 3 · Swarm Orchestration
Module 4 · Operational Guardrails
Module 5 · Shipping a Real Agent System
“Agent” is a design description, not a promise of intelligence. A useful working definition is: a system in which a model can inspect state, choose from bounded actions, observe results, and repeat toward an explicit goal under stop conditions. A chatbot that returns one answer may use AI, but it is not necessarily operating an action loop.
After this lesson, you can specify an agent without vague autonomy claims and decide whether a simpler deterministic workflow is safer.
// concept
Identify the Loop
Write six parts:
Goal: observable completion condition
State: facts the run may read and update
Policy: instructions, constraints, and allowed decisions
Tools: typed actions with explicit permissions
Evaluator: checks outcome and risk
Stop: success, budget, timeout, repeated failure, or human reviewThe model proposes; tools create effects. A tool that only searches a read-only knowledge base has a smaller risk boundary than one that sends money, deletes data, publishes content, or messages a customer.
// concept
Use an Autonomy Ladder
- Suggest: model drafts; human performs the action.
- Prepare: model creates an artifact or queued change; human approves.
- Execute reversible: system takes bounded, recoverable actions and logs them.
- Execute consequential: system can affect people, money, access, or public state.
Climb only when evidence justifies it. The same workflow can mix levels: an agent may read support tickets automatically, draft replies, but require approval to issue refunds.
// concept
Prefer Determinism Where It Works
Use ordinary code for known transformations, validation, calculations, state transitions, authorization, and financial checks. Use a model where language interpretation or open-ended planning adds value. Wrap model output in schemas and policy gates before any effect.
// worked_example
Worked Example
A Pakistani ecommerce shop wants to “autonomously resolve returns.” The safe first version has a narrower goal: classify a customer’s request, retrieve the order, draft an answer, and prepare a return case.
State includes order reference, delivery status, published return terms, and prior actions. Read tools retrieve the order and policy. The model may select a reason code and draft a response. It cannot mark a refund paid. The evaluator checks the order exists, reason is supported, no sensitive information is echoed, and the correct team owns the case. Stop occurs on prepared case, missing evidence, two failed tool calls, five turns, or human request.
// failure_cases
Failure Cases to Diagnose
7 cases to diagnose
Goal is “help the business”
define one observable outcome.
Model text is treated as authority
validate against source systems.
No stop condition
cap turns, time, spend, and repeated actions.
Agent gets administrator access for convenience
scope each tool to the task.
Success means “no error”
evaluate business correctness and side effects.
A workflow is called autonomous for marketing
state the real approval points.
Deterministic logic delegated to a model
keep calculations and authorization in code.
// pakistan_angle
Pakistan Angle
Start with tasks such as classifying public enquiries, preparing proposals from approved facts, or reconciling non-sensitive records. Do not let a first agent submit FBR filings, change bank details, approve loans, send bulk WhatsApp campaigns, or make employment decisions without qualified human control and legal review.
Design for connectivity and service outages. A tool timeout should create a recoverable state and honest delay, not repeated charges or duplicate customer messages. Store PKR amounts as exact minor-unit integers where the payment system requires it and verify every financial transition outside model reasoning.
// hands_on
Hands-On Exercise
5 steps
Pick one real or sample business task.
Specify goal, state, policy, tools, evaluator, and stop.
Put each action on the autonomy ladder.
Replace two model decisions with deterministic checks.
Write five failure tests and the human route.
// completion_rubric
Completion Rubric
6 checks — tick as you verify
// sources
Sources
3 official sources — check every claim yourself
// check_yourself
Check yourself
4 questions · answers and options are taken word-for-word from this course
1 / 4 · diagnose
Your work shows this failure mode: “Goal is “help the business”.” What does the lesson tell you to do about it?