AI Agent Planning, Approval, and Reliable Execution
Enterprise AI agents need more than conversational responses: they need an auditable execution process with explicit plans, risk-based approval, controlled tool calls, and traceable state. This article explains how to separate planning from execution, define tool contracts, coordinate knowledge and memory, and establish the operational safeguards needed for reliable deployment.
Enterprises need more than another chatbot that answers questions. They need an execution process that can be audited, interrupted, and reviewed: understand the goal, break it into steps, explain the tools to be called and their expected side effects, obtain approval, and report progress throughout execution.
Connecting a large language model to a knowledge base or workflow often supports only question answering or predefined processes. Once a task involves multistep reasoning, reads and writes to external systems, and clear accountability, planning and execution must be separated, with human approval between them.
1. What Makes an AI Agent Complete?
An agent capable of handling an end-to-end business scenario typically needs four capabilities:
- Goal understanding: Extract the task objective, constraints, missing information, and risk level from natural language.
- Dynamic planning: Use the available tools to produce an ordered, explainable plan with explicit dependencies, rather than placing every tool in a prompt and hoping the model selects correctly.
- Controlled execution: Define inputs, outputs, timeouts, retries, and permission boundaries for every step.
- Closed-loop state management: Keep the plan, approval records, tool results, and final response in the same conversation state to support follow-up questions, rollback, and auditing.
Missing any of these capabilities weakens the system. Without planning, the model may repeatedly try different tools without a clear direction. Without approval, writes and external notifications may occur before the user understands their impact. Without state, a mult turn conversation cannot reliably track previous progress. Without observability, production failures can only be investigated through the user’s account of what happened.
2. Why Planning and Execution Must Be Separate
The planning stage should produce a structured plan, not a vague paragraph. A usable plan should include:
- A summary of the goal
- Preconditions and assumptions
- An ordered list of steps
- The tool selected for each step and the reason for selecting it
- Whether each action is read-only or performs a write
- The sources of required parameters
- Expected results
- Failure branches
- Whether human approval is required
Dependencies must be explicit. For example, a task might first retrieve policies, then extract relevant clauses, and finally generate a comparison table. A later step must not silently continue if a prerequisite fails.
The execution stage consumes only an approved plan. The executor schedules tool calls step by step, writes results into state, and reports progress to the user. The model may organize parameters and summarize results within a step, but it should not add write operations without replanning and obtaining renewed approval.
This separation distinguishes what the system intends to do from what it is actually doing. If a user rejects a plan, the system can revise it without leaving partially completed side effects.
A platform-independent plan object might look like this:
plan:goal: Summarize this month's exceptional support tickets and recommend actionsassumptions: [Time range is defined, Read-only queries]steps:- id: s1tool: ticket_searchmode: readneeds_confirm: false- id: s2tool: knowledge_retrievemode: readdepends_on: [s1]- id: s3tool: report_draftmode: generatedepends_on: [s1, s2]write_actions: []
3. Present the Plan Clearly and Enforce Approval Gates
Users approve a verifiable description of execution, not the model’s internal reasoning. Present the plan in business language: which data will be queried, whether records will be modified, whether messages will be sent, how long the task is expected to take, and how execution will stop if it cannot finish.
Technical identifiers can be placed in expandable details. Internal tool names should not be the user’s only way to understand the plan.
Approval policies should reflect risk rather than interrupting the user at every step. Retrieval, format conversion, and draft generation can usually proceed automatically. Creating, updating, deleting, making payments, sending information externally, and changing permissions require explicit approval.
Even when the user says “just do it,” write operations should still display their key parameters—including the target objects, quantities, and scope of impact—and require clear agreement. Approval must be bound to a plan version. Any plan change invalidates the previous approval, preventing a mismatch between what the user approved and what the system executes.
Rejection and revision are normal paths. A user may approve only the first two steps, remove an external notification, or narrow the time range. The system should support partial replanning: retain completed read-only results and recompute only the affected steps.
If approval is not received before the timeout, the plan expires and does not enter execution.
4. Define Tool Contracts Before Adding Intelligence
A tool is not merely a description in a prompt. It is a capability governed by a contract. Each tool needs clearly defined:
- Purpose
- Parameter schema
- Return structure
- Idempotency behavior
- Permissions
- Timeouts
- Rate limits
- Error categories
Register read-only queries separately from write commands. Otherwise, the model may use a shared entry point to modify data as an incidental part of another action.
Parameters that the system can supply—such as the current user, tenant, or default time range—should not be left to the model to invent. Missing information that must come from the user should be listed during planning as an item requiring confirmation, rather than guessed during execution.
Validate parameters before a call and results afterward. Empty results, unauthorized access, partial success, and timeouts require different handling:
- Retry recoverable errors only within a defined limit.
- Stop and explain business-rule rejections.
- For partial success, list completed and incomplete items separately. Never summarize the outcome as “everything was processed.”
Write tools should require idempotency keys to prevent duplicate submissions caused by repeated clicks or network retries.
5. Coordinate Knowledge, Memory, and Tools
Knowledge bases are appropriate for policies, product documentation, and historical cases. They should not serve as strongly consistent sources for orders, inventory, or similar operational data.
During planning, classify the information needed. Use retrieval for relatively stable knowledge and business-system tools for live state. Retrieved content should include sources that can be cited in the plan and final response, helping prevent outdated documents from becoming the basis for execution.
Conversation memory should retain only the state needed for the task: approved plans, key parameters, tool-result summaries, and user corrections. Do not indefinitely accumulate complete tool responses in the model context.
Store long results in object storage or a business database, keeping only summaries and references in context. This supports continued mult turn interaction while reducing drift and cost.
6. Use One Agent or Split Responsibilities?
Most business tasks can be handled by one planner with a set of tools. Split work into collaborating roles only when a task spans different areas of expertise, distinct permission boundaries, or a long execution chain. Possible roles include retrieval, analysis, validation, and execution.
Roles should exchange structured intermediate results rather than informal conversation. A central controller must own plan versions, approval gates, and stopping conditions. Without that control, multiple roles may call tools independently, making accountability difficult to trace.
The value of collaboration lies in permission isolation and specialized instructions, not the number of roles. A validation role should be able to reject clearly contradictory conclusions. An execution role must not have write permissions beyond those declared in the plan.
Any role that proposes a new write step must return it to the controller for replanning and renewed approval.
7. Move from Prototype to an Operational System
During prototyping, use a small set of read-only tools to test whether planning is stable, plans are understandable, and approval gates actually block writes.
Before a pilot deployment, add identity management, tenant isolation, secret management, and least-privilege access. Production operation also requires rate limiting, queues, timeouts, dead-letter handling, idempotency, and human takeover.
A container platform can run the orchestration service, while message queues absorb traffic spikes. Logs, monitoring, and alerts should capture plan identifiers, tool names, durations, error codes, and the approving user. Sensitive information must be redacted from logs.
Release gates should verify that:
- Actual tool calls match the plan.
- Unapproved writes cannot execute.
- Tool failures are not suppressed.
- The final response can be traced to step results.
Use a fixed regression suite covering missing information, user plan changes, tool timeouts, partial success, and permission denials. A one-off demonstration is not a substitute for testing these paths.
8. Common Failures and What to Fix First
Typical failures include:
- Plans too vague for meaningful approval
- Tool calls that bypass planning
- Parameter changes after approval
- Confusion between retrieved knowledge and live data
- Errors presented as successful outcomes
- Constraints forgotten after several conversation turns
Start by tightening tool contracts and binding approval to plan versions. Then improve prompts and examples. Adding more roles is not the first remedy.
An agent’s completeness can be judged by four questions:
- Can users understand and modify the plan before execution?
- Do approval gates block high-risk actions?
- Do failures leave the task in a clear, identifiable state?
- Can the execution be reviewed afterward using its plan identifier?
Meeting these requirements turns an agent into a deployable execution system rather than a demonstration chatbot. In an enterprise cloud environment such as Baidu AI Cloud, the same controls should remain part of the application architecture. Use container, storage, queue, logging, and alerting capabilities to support operation instead of relying on the model to improvise reliability.
