This paper provides a comprehensive guide to the "Plan-then-Execute" (PtE) pattern for designing Large-Scale Language Model (LLM) agents capable of complex, multi-step task automation. We explore the fundamental principles of the PtE pattern, an agent design pattern that decouples strategic planning from tactical execution, its components (Planner and Executor), and its architectural advantages over reactive patterns like ReAct in terms of predictability, cost-effectiveness, and inference quality. We focus on security by establishing inherent resilience to indirect prompt injection attacks, detailing the need for a defense-in-depth strategy and essential complementary controls such as the principle of least privilege, task-scoped tool access, and sandboxed code execution. We provide implementation blueprints and working code references for three major agent frameworks: LangChain (using LangGraph), CrewAI, and AutoGen. We analyze how each framework implements the PtE pattern, and discuss advanced patterns, including dynamic replanning loops, parallel execution using DAGs, and the importance of human-in-the-loop (HITL) verification.