Decision rule
Known sequence + bounded branching → workflow
Unknown next step + bounded tools + measurable goal → agent candidate
High-impact irreversible action → explicit approval/policy gate- Agentic is not synonymous with advanced.
Start with predictable software workflows. Then learn when model-directed decisions are useful, how tools and state are bounded, and where approvals, budgets, stop conditions and recovery are required.
Engineering focus: Workflows, tools and agentic systems
Start with predictable software workflows. Then learn when model-directed decisions are useful, how tools and state are bounded, and where approvals, budgets, stop conditions and recovery are required.
The rest of this module introduces the formal terminology and production controls behind that idea. You are not expected to memorize the vocabulary before using it.
Carry the same support assistant forward: approved KB, source citations, explicit insufficient-evidence fallback and one bounded read-only asset lookup. Reuse prior artifacts so each module adds evidence to one production AI system.
If the steps are known, encode them directly. Agents are useful when the next step depends on interpretation, tool results or an open-ended search through a bounded action space.
An agent can choose tools, iterate, accumulate state and amplify mistakes. Bound maximum steps, time, token/tool budgets, reachable tools and data domains.
Separate conversation text from durable task state. Record tool requests/results, approvals and final decision so a resumed task does not depend on hidden model memory.
If a tool can create a ticket, charge a card or change infrastructure, a retry must not accidentally repeat the effect. Use idempotency keys, read-before-write checks or approval gates.
Escalate when impact, uncertainty or policy warrants it. Human approval is most useful when the system presents the proposed action, evidence and consequences clearly enough to review.
Known sequence + bounded branching → workflow
Unknown next step + bounded tools + measurable goal → agent candidate
High-impact irreversible action → explicit approval/policy gategoal → model proposes action → validate/authorize → tool → observe result → update state
↺ until success | stop condition | budget exhausted | human escalationGoal: Build a tiny deterministic agent-loop simulator with explicit budget and authorization.
python3 - <<'PY2'
state={'asset':'srv-104','steps':0,'max_steps':3,'approved_tools':{'lookup_asset'}}
plan=[('lookup_asset',{'asset_id':'srv-104'}),('delete_asset',{'asset_id':'srv-104'})]
for tool,args in plan:
state['steps']+=1
if state['steps']>state['max_steps']: raise SystemExit('budget exceeded')
if tool not in state['approved_tools']:
print('DENY',tool); break
print('ALLOW',tool,args)
assert state['steps']==2
print('PASS: tool policy stopped unsafe continuation')
PY2For a hypothetical create_ticket tool, define the idempotency key and what the executor returns if the same request is retried.
Specify when the system stops and asks a human: unsupported tool, budget exhaustion, conflicting evidence, or a write above the approved impact threshold.
Reliable agents look more like workflow engines with probabilistic decision points than unrestricted autonomous bots.
Expose one read-only local function definition and inspect the model-generated tool call without executing arbitrary commands.
MODEL=${MODEL:-qwen3:8b}; curl -s http://127.0.0.1:11434/api/chat -H 'Content-Type: application/json' -d "{\"model\":\"$MODEL\",\"messages\":[{\"role\":\"user\",\"content\":\"Which service owns asset srv-104?\"}],\"stream\":false,\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"lookup_asset\",\"description\":\"Read approved asset ownership\",\"parameters\":{\"type\":\"object\",\"properties\":{\"asset_id\":{\"type\":\"string\"}},\"required\":[\"asset_id\"]}}}]}" | python3 -m json.tool | head -120Concept and scenario checks. Reveal the answer only after you commit to a decision.
When the steps and branches are sufficiently known and can be encoded directly.
Hard budgets/stop conditions, tool validation/authorization and durable state/audit controls.
Retries must not duplicate side effects such as tickets, payments or infrastructure changes.
Trusted application policy denies the tool and the workflow stops or escalates.
Progress is saved in this browser immediately. When you sign in to My Learning, it can also sync across devices.
Attempt the core lab and knowledge checks before marking the module complete.