Architecting Resilient LLM Agents: A Guide to Secure Plan-then-Execute Implementations