Five ground rules for an agent loop with reliability at its core: state machine first, host and runner split, errors as outcomes, atomic history, 3-way tests.