Conditions and loops
Also called If statement, For loop
A condition (if) runs some code only when a test is true. A loop (for, while) repeats some code until its test turns false. Between them, they decide which lines run and how many times.
Reading an agent's code, every if is a question: what happens in the other case? A branch nobody wrote and a loop that stops a step early are where a lot of almost-right code hides.
Say it to your agent
“This function has four nested ifs. Rewrite it with early returns so the main path is not indented, keep the behaviour identical, and add a test for each branch, including the one with no else.”