Build a bounded agent loop from scratch with three tools and…
Jump & context
Week 5: RAG ACLs, PII UUID Gateway, Training-Data Poisoning & Agent/MCP Foundations
The five hours
- 01
Concepts & system design
60 min· read · map the mechanismR41 — OWASP Agentic AI bounded execution
R24 — LangGraph state & execution concepts
Read the assigned sections; map the mechanism, threat model and trade-offs.
- 02
Project implementation
120 min· build · integrate · debugBuild
P3's bounded agent loop from scratch (no framework yet) with 3 tools, explicit state transitions,max_stepscap, and wall-clock timeout budget.Build, integrate, debug and improve the increment in the active project.
- 03
Security lab
60 min· attack your own systemInject malformed tool outputs and trigger a repeated tool-call loop; verify the state machine halts cleanly at
max_steps.Test the abuse case, failure path, authorization bypass or resource limit.
- 04
Verification & evidence
30 min· test · record evidenceBounded agent state-machine tests and loop-termination proof.
Add or run regression tests; record the 9-point evidence record.
- 05
Deliberate practice & Socratic review
30 min· explain aloud · update gapsAnswer the 8 Socratic questions without notes: What? Why? How? What if? Why not? How can I prove it? Where can it break? What have I learned?
Re-explain the hardest concept aloud, inspect one edge case, update the gap log.
- total5 h
Read today · inside the concepts block
R24 R41State graphs, durable checkpointing, human-in-the-loop interrupts, retries, and resumability.
Agentic threat taxonomy: tool misuse, excessive agency, memory poisoning, inter-agent trust, and human oversight.
Read only the named sections needed for today's task. Reading sits inside the 60-minute concepts block; it is not extra time.
Free resources for this day
5 curated- docsOWASP GenAI Security Project · PDF reportAgentic AI – Threats and Mitigations
Gives the six-playbook agentic threat taxonomy (tool misuse, excessive agency, goal hijack) that justifies why a hand-built loop needs an explicit max_steps cap and a wall-clock budget instead of open-ended reasoning.
R41moved 2026-11-11 - videoTech With Tim · ~1 hrBuild Your Own Agentic Harness in Python - Full Tutorial
Builds the agent loop in pure Python with no framework — basic loop, tool calling, then MCP — which is exactly the P3 from-scratch harness with its own dispatch step.
R24checked 2026-11-11 - videoAWS Developers · ~8 minAgents Are Just Loops
Demonstrates the reason-act-observe loop and adds hooks that expose each iteration, the same interception point you need for counting steps and enforcing a termination condition.
R24checked 2026-11-11 - articleBuilding Agentic AI · ~20 min readBuild an AI Agent From Scratch in Python, No Framework
Walks the four-move loop and then adds both bounded defenses the day asks for: a `max_steps` step budget and repeat-call detection for runaway tool calls.
R24moved 2026-11-11 - labInngest Docs · ~15 min readBuild a Durable AI Agent Tool Loop
Shows each loop iteration and each tool call wrapped as a separately retryable step, which is the explicit-state-transition and failure-isolation model to mirror when you replace the toy loop with real state handling.
R24checked 2026-11-11
Evidence record · 9-point standard
A lab is complete only when it produces evidence. Installing PyRIT, Garak, Presidio or TransformerLens is not completion. Saved on this device only.
Day notes
emptyThe two source formulations
verbatim · nothing summarisedProject & Stage Target
Start P3 | S3, M5
Core Implementation
Build P3's bounded agent loop from scratch (no framework yet) with 3 tools, explicit state transitions, max_steps cap, and wall-clock timeout budget.
Security Lab
Inject malformed tool outputs and trigger a repeated tool-call loop; verify the state machine halts cleanly at max_steps.
Verification & Evidence
Bounded agent state-machine tests and loop-termination proof.
Read Today (60m Concepts Block)
R41 (OWASP Agentic AI bounded execution), R24 (LangGraph state & execution concepts).
---