Runtime Feedback Loops

Agents that do not see real command output guess. A feedback runner captures stdout, stderr, exit code, and timing into a structured record the next turn can read. Then the agent reacts to facts instead of to its own prediction of facts.

Build 50 min Python (stdlib)

Prerequisites: Phase 14 · 32 (Minimal Workbench), Phase 14 · 35 (Init Script)

#Learning Objectives

  • Distinguish runtime feedback from observability telemetry.
  • Build a feedback runner that wraps shell commands and persists structured records.
  • Truncate large outputs deterministically so the loop stays within token budget.
  • Refuse to advance the loop when feedback is missing.
Full Access lesson

Keep going. The rest of this lesson is one step away.

Unlock all 503 lessons, video, code, quizzes and every future update. Pay in your own currency with Paystack.

The text and code of this lesson are based on AI Engineering from Scratch by Rohit Ghumare, MIT licensed.