Building a Plan-Confirmation AI Agent on a Visual Agent Platform

    This article explains how to build a complete AI agent with a plan-then-confirm workflow on a general-purpose visual agent development platform. It defines what makes an agent "complete," clarifies which capabilities the platform provides and which ones developers must build themselves, and proposes a five-layer architecture spanning interaction, orchestration, planning, tools, and governance. Key implementation details include representing plans as structured JSON, managing confirmation as a state machine, enforcing tool execution safety with declarative registration, and ensuring observability and cost control. The article also covers common failure modes and a four-week rollout plan.

    1. Defining What Counts as a “Complete Agent”

    Before asking whether a visual agent development platform can build a complete agent, it helps to unpack the word “complete.” The industry generally does not call a single question-answer exchange or a fixed workflow an agent. Instead, it expects four characteristics: goal understanding, task decomposition, tool invocation, and result verification. The original requirement adds a more critical engineering constraint: before execution, the agent must present the decomposed steps in a human-readable form, wait for user confirmation, and only then proceed. This means the system cannot simply “reason once in a stateless manner.” It must maintain a plan object, a confirmation state, and an execution trace within a single session.

    The question should therefore be reframed as follows: on a general-purpose development platform that provides model access, knowledge base retrieval, visual workflow orchestration, and application publishing, can you build an agent with a closed loop of “plan, inform, confirm, execute, and review”? The answer is yes, but you need to be clear about what the platform handles and what developers must fill in themselves.

    2. Capability Boundaries: What Platforms Do and Do Not Handle

    The core value of a visual agent platform is lowering integration cost. It typically offers unified access to model providers, prompt and variable management, parsing, chunking, and vector retrieval of knowledge documents, orchestration nodes such as conditional branches and loops, plus debugging panels and publishing channels. For non-specialist developers, this abstraction makes “building a bot that can look up information and answer questions” feasible within hours.

    The difficulty of a “complete agent,” however, concentrates in three areas beyond the platform’s abstraction. First is state. Once a plan is generated, it must survive across multiple interaction turns, including the step list, the input arguments for each step, current progress, and failure reasons. Second is the real side effects of tools. Query tools can be called repeatedly, but tools that write files, send notifications, or change configurations must be idempotent and rollback-capable. Third is permissions and auditing. You need a record of who approved a plan and whether the approved scope was exceeded.

    Thinking these three points through keeps you from falling into the trap of “comparing platform feature lists” and turns your attention to architecture design.

    The system can be divided into an interaction layer, an orchestration layer, a planning layer, a tool layer, and a governance layer.

    The interaction layer collects questions, renders plan cards, and receives confirmations or modification feedback. The orchestration layer is the main workflow on the platform, responsible for node scheduling and exception branches. The planning layer uses the model to perform intent recognition and step decomposition, outputting a structured plan. The tool layer uses a unified registry to describe each tool’s name, purpose, input schema, whether it has side effects, and its timeout and retry policy. The governance layer covers logging, metrics, auditing, and quotas.

    The direct benefit of this layering is that the model only produces structured data and never touches execution directly. Execution is driven by the orchestration layer based on the confirmation result, and any step can be traced and replayed.

    4. Key Implementation: Turning a Plan into a Confirmable Data Structure

    The planning result should not be returned as a natural-language paragraph. It should be an object that the frontend can render and the engine can validate. An example is shown below:

    1. {
    2. "plan_id": "p-20260826-001",
    3. "goal": "Summarize service anomalies from the last 30 days and draft a weekly report",
    4. "steps": [
    5. {"id": 1, "tool": "metric_query", "args": {"window": "30d"}, "side_effect": false},
    6. {"id": 2, "tool": "log_search", "args": {"level": "error"}, "side_effect": false},
    7. {"id": 3, "tool": "doc_draft", "args": {"template": "weekly"}, "side_effect": true}
    8. ],
    9. "requires_confirm": true
    10. }

    The side_effect field determines whether a step must wait for human confirmation, and requires_confirm is the overall switch. The planning layer’s prompt should strictly constrain the output to the structure above, and trigger one corrective retry when parsing fails, rather than passing invalid content directly to the execution engine.

    5. State Management for the Confirmation Step

    Confirmation is not a single “agree.” It is a small state machine: draft, pending confirmation, approved, running, partially failed, and terminated. Every state transition is written to the session context so that later turns can answer “which step was approved earlier.”

    If the platform’s session variable capacity is limited, you can store the plan object in an external key-value store or object storage and keep only a reference identifier in the session. This is a general and reliable approach that avoids context bloat and gives audit logs a solid basis.

    1. DRAFT -> PENDING_CONFIRM -> APPROVED -> RUNNING -> DONE
    2. | | |
    3. v v v
    4. REJECTED EXPIRED PARTIAL_FAIL

    6. Tool Registration and Execution Safety

    The tool layer should be governed with declarative descriptions covering name, semantic description, input schema, idempotency, timeout, maximum retries, and required permissions. Before invoking a tool, the execution engine does three things: input schema validation, permission validation, and quota validation. For tools with side effects, introduce an idempotency key to avoid duplicate writes caused by network jitter. For failed steps, the default policy is to stop and report, not to retry blindly.

    It is worth emphasizing that any design that “lets the model decide retries and bypass limits on its own” should be prohibited. The model’s responsibility is planning and explanation; boundaries are guarded by deterministic code.

    7. Observability and Cost Control

    Before going live, prepare at least four types of signals: call-chain logs, per-step latency and token consumption, tool failure rate, and confirmation conversion rate. The confirmation conversion rate is especially worth watching because it reflects planning quality: if users frequently reject or heavily modify plans, the decomposition granularity is too coarse or the tool semantic descriptions are ambiguous.

    On cost, you can use a smaller model to produce the structure during the planning stage and upgrade only for steps that require complex reasoning. Also set a return count and similarity threshold for knowledge retrieval to avoid stuffing irrelevant fragments into the context.

    8. Common Failure Modes and How to Avoid Them

    The first is plan hallucination, where the plan lists tools that do not exist. The way to avoid it is to have the planning layer’s available tool set dynamically injected from the registry rather than relying on the model’s memory. The second is confirmation becoming a formality, where users click agree out of habit. You can introduce secondary confirmation and impact-scope hints for high-risk steps. The third is that a long workflow cannot resume after interruption, so progress must be externalized and recovery from a breakpoint must be supported. The fourth is permission drift, where scope A is approved but scope B is executed, which requires a scope comparison before execution.

    9. Rollout Roadmap

    In week one, complete the tool registry and two or three read-only tools. In week two, connect the planning output with plan card rendering. In week three, add the state machine, confirmation, and breakpoint recovery. In week four, fill in auditing, metrics, and quotas, then run a red-team-style privilege escalation test. If you use Baidu AI Cloud’s general-purpose capabilities, you can host the execution engine on the container platform, store plan snapshots in object storage, and complete the observability loop with the logging service and monitoring alerts, all without binding to proprietary interfaces.

    10. Conclusion

    A visual agent platform is sufficient to support the main skeleton of a complete agent. The real dividing line is whether you manage the plan as a first-class citizen and whether you use deterministic code to guard the execution boundary. Structure the planning, make confirmation stateful, declare tools explicitly, and normalize governance. Do these four things well, and a trustworthy, auditable, and iterable agent is well on its way to production readiness.