Start with a bounded goal
Define what completion means, which tools are available and when the agent should stop. A vague objective can turn a useful workflow into an unbounded loop.
Make state explicit
Store the plan, completed steps, tool outcomes and pending approvals outside the model context. This allows a failed run to be inspected and resumed without guessing what already happened.
Validate at the action boundary
Generated SQL needs schema and permission checks. A document report needs source verification. An external write needs validation and appropriate authorization. The check belongs where the proposed action becomes real.
Treat escalation as a capability
An agent should be able to explain what it could not determine and hand the current state to a person. Clear handoff is a more useful property than pretending every task can be completed autonomously.
An architectural perspective, illustrated through general engineering patterns. Implementation choices depend on your data, permissions and operational constraints.