What is the human-in-the-loop pattern for agents, and when is it needed?

Technical