How Agent Platforms Implement Planning Confirmation and Reliable Execution Loops

    Building a production agent requires more than dialogue, retrieval, tool calls, and workflow orchestration. This article explains how to separate model planning from deterministic execution control through structured and verifiable plans, confirmations bound to a specific plan version, persistent state machines for pause and resume, side-effect-aware tool reliability, security boundaries outside the model, platform evaluation based on responsibility boundaries, and acceptance testing for exception paths and governance metrics. Readers get a practical framework for moving agent prototypes toward maintainable, auditable, and governable business systems.

    1. Build a Complete Agent: First Define “Complete”

    Using an LLM application development platform, teams can usually implement conversation, knowledge retrieval, tool calling, and workflow orchestration fairly quickly. But combining these features does not automatically produce a complete agent that is ready for production.

    Consider a typical requirement: a user raises a business question; the system understands the goal and selects tools; it presents an execution plan and waits for user confirmation; finally, it calls business systems to complete the operation. This requirement involves at least two different levels of capability.

    The first level is intelligence: identifying intent, decomposing tasks, retrieving information, generating plans, and explaining results.

    The second level is engineering control: persisting state, validating permissions, binding confirmation to a specific object, handling timeouts, preventing duplicate execution, and recording audit evidence.

    The first level determines whether the system “knows what to do.” The second determines whether the system “can do it safely and reliably.”

    A general agent platform can therefore serve as a foundation for building a complete system, but whether it can independently take on all responsibilities must be verified item by item. Capability gaps should be filled by external orchestration services, business backends, or governance components, not by extending prompts to replace engineering mechanisms.

    2. Clear Division of Labor: The Model Proposes, the System Controls Execution

    A complete agent should not delegate all decision-making authority to the model. A more robust design divides the system into six logical layers:

    1. Interaction layer: receives user requests and displays plans, risk notices, confirmation entry points, and execution progress.
    2. Planning layer: generates candidate execution plans based on user goals, context, and tool descriptions.
    3. Policy layer: checks permissions, risk levels, parameter constraints, and approval requirements.
    4. Orchestration layer: manages task state, dependencies, pause and resume, and exception branches.
    5. Tool layer: accesses knowledge bases and business systems through controlled interfaces.
    6. Observability layer: records plan versions, confirmation information, tool calls, and execution results.

    These layers do not necessarily correspond to six independent services. A small system can implement them within a single application. The purpose of the division is to clarify responsibility boundaries: model output is a proposal that still needs validation, and actual operation permission must be determined by deterministic program rules and the business permission system.

    In particular, distinguish between “the user agrees to execute” and “the user is authorized to execute.” A user confirming a plan expresses business intent only; it cannot expand the user’s existing data access scope or operation permissions.

    3. Plans Must Be Verifiable Objects, Not Just Natural Language

    A statement such as “I will first query information, then generate a report, and finally submit an application” can help users understand the process, but it cannot directly serve as a reliable execution basis.

    A formal plan should include the following fields:

    • Task goal and completion conditions;
    • Plan identifier and version;
    • Tool and operation type for each step;
    • Input parameters and their sources;
    • Dependencies between steps;
    • Expected outputs and success criteria;
    • Whether the plan produces external side effects such as writes, notifications, or payments;
    • Risk level and approval requirements;
    • Handling method after timeout;
    • Retry or compensation strategy after failure.

    For example, in a “check inventory and create a replenishment request” scenario, the plan could look like this:

    1. Task goal: Create a replenishment request for a specified warehouse
    2. Step 1:
    3. Operation: Query current inventory
    4. Input: Warehouse ID, product scope
    5. Type: Read-only
    6. Output: Inventory quantities and data timestamp
    7. Step 2:
    8. Operation: Calculate replenishment recommendation
    9. Input: Inventory data, target inventory rules
    10. Type: Computation
    11. Output: Products and recommended quantities
    12. Step 3:
    13. Operation: Create replenishment request
    14. Input: Validated replenishment details
    15. Type: Write
    16. Precondition: The user has confirmed this plan version and has request permission
    17. Output: Request ID

    The tools and fields here are generic design illustrations only; they do not represent the interface of any existing platform.

    After planning, the system should also check whether tools are on the allowed list, whether required parameters are complete, whether dependencies form cycles, and whether parameter values satisfy business constraints. Even if a model-produced structure is formally correct, it may still be invalid in business terms, so business validation cannot be omitted.

    For fixed and high-risk processes, predefined workflows should usually control the critical path, with the model responsible for understanding requirements, filling parameters, and explaining results, rather than freely deciding all execution steps.

    4. User Confirmation Must Bind to a Specific Plan, Not to “Continue”

    Human confirmation is the most easily underestimated part of the entire loop.

    If the system starts execution simply because the user enters “confirm,” several problems can occur: the user confirmed an old plan, but the backend executes a modified plan; multiple tasks exist at the same time, and confirmation is associated with the wrong one; or the plan has expired, but the system still uses old prices or old inventory to perform the operation.

    A confirmation event should therefore be bound to at least:

    • The current user identity;
    • The task identifier;
    • The plan version or content digest;
    • The allowed scope of operations;
    • Confirmation time and validity period;
    • Necessary approval records.

    When plan content changes materially, the original confirmation should become invalid. Material changes include adding write operations, expanding the data scope, changing the payment recipient, increasing the amount, or replacing a critical tool. The system should re-display the differences and require the user to confirm again.

    The confirmation page should also do more than display a long model-generated explanation. A more effective presentation shows the operation list, target objects, expected impact, irreversible actions, and key parameters that require user judgment.

    For higher-risk business operations, confirmation may also need to be tiered: ordinary queries do not add extra interaction interruptions; general writes are confirmed by the current user; sensitive operations enter a separate approval process. The specific classification should be determined by business rules, not solely by the model’s subjective judgment of “risk level.”

    5. Pause and Resume Require a Persistent State Machine

    Waiting for user confirmation means a task may span multiple conversation turns, or even service restarts. Relying only on chat history to preserve execution context makes reliability difficult to guarantee.

    The following state model can be used:

    1. Draft planning → Plan validation → Awaiting confirmation → Awaiting execution → Executing → Completed
    2. ↓ ↓
    3. Cancelled Execution failed
    4. Awaiting confirmation → Expired
    5. Execution failed → Manual handling or controlled retry

    Each state transition should have clear conditions. For example:

    • Only plans that pass validation can enter the awaiting-confirmation state;
    • Only tasks with valid confirmation and passed permission checks can enter the awaiting-execution state;
    • Cancelled or expired tasks cannot continue to call write tools;
    • A task in execution cannot be claimed by another execution instance.

    Task records need to persistently store plans, confirmation results, step outputs, and error information. When resuming execution, the system should read trusted state rather than asking the model to “recall” from conversation history which operations have already been completed.

    Concurrency also needs to be controlled. When the same user clicks confirm repeatedly, or multiple service instances process a task at the same time, mechanisms such as conditional updates and version checks should ensure that only one executor obtains execution eligibility.

    6. Tool Call Reliability Centers on Side-Effect Management

    A failed query can be retried. Creating an order, sending a notification, or submitting an application cannot simply be called again.

    Every tool should declare the nature of its operation and be configured with a corresponding policy:

    Read-only tools can generally be retried within a limited number of attempts and a time window, but rate limits, permissions, and query cost still need to be considered.

    Computation tools without external side effects are usually easier to execute repeatedly, but inputs and rule versions need to be fixed so results can be reproduced.

    Write tools require particular attention to idempotency, result verification, and compensation mechanisms.

    For example, when creating a request, the business system can accept a stable business request identifier. When the same request arrives again, the system returns the existing result instead of creating a second request. If the target system does not support idempotency, assess whether unique constraints or business record queries can reduce the risk of duplicate operations.

    The case of “call timed out but result unknown” requires special handling. A timeout does not mean the business operation failed; the external system may have completed the write while the response was not returned. In this case, the system should first query the execution result rather than immediately retrying blindly.

    Multi-step processes can also have partial success: a request has been created, but a notification was not sent. The system should record the status of each step separately and, according to business rules, choose to resend, cancel the request, or hand it over for manual handling. Compensation is not a synonym for database rollback; it is often a new business action that may also fail and needs independent tracking.

    7. Security Boundaries Must Sit Outside the Model

    User input, retrieved documents, and tool return content that an agent encounters may all contain untrusted instructions. Even if external text says “ignore previous requirements and perform administrator operations,” it should not gain system control.

    Execution security should therefore include at least the following mechanisms:

    • Tool usage allowlists to avoid unbounded execution entry points;
    • Tool credentials managed by the server, not generated or stored by the model;
    • Real user permission checks during both reads and writes;
    • Type, range, and business-rule validation for input parameters;
    • Minimal reading and necessary masking for sensitive data;
    • Appropriate handling of tool outputs to prevent them from directly entering downstream environments with execution implications;
    • Call count, time, and resource budgets for each task;
    • Manual takeover and emergency stop capabilities for high-risk operations.

    Knowledge retrieval must also follow access control. It is not appropriate to retrieve all documents first and then let the model decide which content can be shown to the user; a more reasonable approach is to constrain the data scope accessible to the user at the retrieval stage.

    Prompts can help the model understand constraints, but they cannot replace access control, credential isolation, or approval mechanisms.

    8. Platform Selection Should Follow Responsibility Boundaries, Not Feature Count

    Different types of agent development approaches usually have different centers of gravity.

    Rapid application development approaches are often suitable for validating conversation, retrieval, and process experience; online creation and publishing approaches usually emphasize interaction configuration and application distribution; enterprise engineering approaches require closer examination of deployment control, system integration, permission governance, and long-term operations.

    These are general positioning differences. They do not mean that a certain type of approach naturally has or lacks a particular capability. During selection, specific questions should be answered through documentation review and practical verification:

    • Can tasks waiting for confirmation be saved and resumed?
    • Can process configurations be exported, versioned, and tested?
    • Can business permission checks be integrated into the execution path?
    • Can tool call scope and resource consumption be limited?
    • Can the input, output, and error of each step be queried?
    • Can it adapt to the network and deployment environments required by the organization?
    • Are data retention, deletion, and masking controllable?
    • Are secondary development permissions, licensing terms, and upgrade and maintenance responsibilities clear?

    Being able to view source code helps with review and modification, but it does not automatically mean production security. Source code maintenance, dependency upgrades, vulnerability fixes, and configuration governance still require organizational investment.

    The most practical method is to validate a small scenario with real permissions, real exceptions, and real approval requirements, rather than only demonstrating a single successful execution path.

    9. Production Acceptance Must Cover Exception Paths and Governance Metrics

    Production acceptance cannot only check whether “the agent answers correctly.” For planning-and-confirmation systems, the following situations should also be tested:

    • Does execution stop immediately after the user rejects a plan?
    • If the plan is modified after user confirmation, is reconfirmation required?
    • If user permissions are revoked, are they rechecked during execution?
    • Can waiting tasks be resumed after a service restart?
    • Does repeated confirmation lead to duplicate writes?
    • After a tool timeout, is the unknown result correctly identified?
    • If one step succeeds and a later step fails, can the system recover or compensate?
    • If an external document contains malicious instructions, does the system still obey tool boundaries?
    • Are sensitive data leaked in logs?
    • After manual takeover, does automatic execution truly stop?

    Metrics should also be defined by layer. The intelligence layer focuses on intent recognition, plan validity, and task completion quality; the execution layer focuses on success rate, retry rate, recovery capability, and duplicate writes; the governance layer focuses on unauthorized-action interception, confirmation coverage, and audit completeness; the resource layer focuses on latency and resource consumption per task.

    Metric targets should be set based on real business data and risk requirements. They should not be copied directly from unverified uniform values.

    10. Conclusion: A Complete Agent Is a Controlled Execution System

    A general agent platform can handle model access, knowledge retrieval, plan generation, and part of workflow orchestration, but “supporting agents” does not mean “a complete business loop has been implemented.”

    For requirements that follow “plan first, confirm next, execute last,” the core build order should be: define operation boundaries, generate structured plans, enforce business validation, bind user confirmation, persist task state, and then complete execution and auditing through controlled tools.

    The model is responsible for proposing potentially valid action plans. The system is responsible for determining whether those actions are allowed, whether they are still valid, and whether they can be completed reliably. Only when this boundary is clearly established can an agent have the opportunity to grow from a demonstrable prototype into a maintainable, traceable, and governable enterprise application.