1 / 2 · Book 3 · From Scripts to Agents -- A Fundamental Shift · drill: interview Q&A⊞ allnext →Get the book →
1.3The Agent Advantage: Adaptive Error Investigation
Consider this real-world example of how an agent thinks through an unexpected situation:
Step 1: OBSERVE -- Login page loaded. Email and password fields visible.
Step 2: THINK -- "I should fill in valid credentials and click login."
Step 3: ACT -- Type email, type password, click submit.
Step 4: OBSERVE -- Error banner: "Account locked after 5 failed attempts"
Step 5: THINK -- "Unexpected error. This is not a test failure -- it is
test environment state. The account was locked by a
previous test run. I should report this as an
environment issue, not a bug."
Step 6: ACT -- DONE fail "Account locked -- environment state issue, not a bug"
A deterministic script would simply fail with "Expected dashboard URL, got login URL." The agent provides a diagnosis.