AI Agent Execution Design: From Tool Descriptions to Background Tasks

    Reliable AI agent workflows require more than tool integration. This article explains how to separate tool guidance, human confirmation, and background execution, with practical considerations for authorization, resumable state, retries, cancellation, and model evaluation. A batch translation workflow illustrates how these elements work together and why failure paths should be tested before deployment.

    1. Tool Integration Is Not the Goal—Controlled Execution Is

    A single tool call can complete a query or calculation, but enterprise workflows rarely end there. To produce multilingual documentation, for example, a system may need to read files, confirm target languages and terminology requirements, translate content in batches, check formatting, and deliver the results. If the user has not specified whether the translation is for internal reference or external publication, the system must decide whether a default is appropriate or whether it needs to pause for confirmation. Even with all parameters available, a large batch may take longer than a single interaction can reasonably wait.

    These workflows require three separate design responsibilities:

    • Tool descriptions help the model determine what to call.
    • Interaction workflows determine when human input is required.
    • Task systems determine how execution continues beyond the current session.

    These elements work together, but none can replace the others. Detailed tool descriptions do not replace permission checks. Support for background execution does not allow a task to bypass publication approval.

    2. Maintain Tool Descriptions Alongside Interfaces, but Keep Documentation Separate from Authorization

    Tool interfaces typically use structured definitions to describe parameters, including field types and whether inputs are required. However, valid parameters do not necessarily make a call appropriate. A “submit” action might save a draft or send content to an external recipient. If the description lists only fields without explaining the consequences, the model may struggle to distinguish those operations.

    Useful tool descriptions should address at least three areas:

    • Scope. Explain what the tool can and cannot do. A translation tool, for example, converts language; it does not verify the factual accuracy of source material. If a page cannot be parsed, the tool should identify the missing content rather than infer it.
    • Preconditions and side effects. Specify the inputs required before a call and whether the operation writes data, overwrites existing results, or triggers external delivery. When confirmation is required, explain exactly what the user must confirm and the scope of that confirmation—not simply “ask the user first.”
    • Result and failure semantics. Distinguish between “request accepted,” “processing completed,” and “partially successful.” If only some files in a batch are processed, return enough information to identify the failures and retry them selectively, rather than treating the entire batch as though it never ran.

    These descriptions should be maintained alongside tool definitions. When fields, default behavior, or side effects change, update the interface and its description together, and test the critical behavior.

    Descriptions are guidance for tool selection, not authorization credentials. The tool service must enforce access control, including caller identity, resource scope, and operation permissions. Documents or text returned by tools must also be treated as data to process. Their contents must not expand access privileges or change execution rules.

    3. Ask Mid-Workflow Questions Only When the Answer Matters

    An agent should be able to pause during execution, but it does not need to ask about every missing field. The deciding principle is whether the cost of a wrong assumption exceeds the cost of asking.

    For low-cost, reversible choices with established defaults, the system can use the default and disclose it in the result. Decisions involving external data transmission, overwriting existing content, or a significant expansion of processing scope require confirmation. The model’s interpretation of user intent is not a substitute for approval.

    A useful question identifies what is missing, why it matters, and what choices the user has. For example:

    “Is this translation for internal reference or external publication? The terminology checks and review requirements differ. For external publication, I will generate a draft for review rather than send it directly.”

    This is easier to answer than “Please provide more information.” It also makes clear that confirming the intended use does not authorize external delivery.

    When a workflow pauses, the system must save resumable execution state rather than rely solely on the chat history. This typically includes completed steps, input versions, pending confirmations, and their validity periods.

    Before resuming, the system must recheck relevant conditions. If the source file has been replaced or the output recipient has changed since confirmation, the earlier approval may no longer apply. Tasks that receive no response within the defined time limit should end, retain a draft, or remind the user according to predefined rules—not treat silence as consent.

    4. Background Execution Separates Processing Time from Interaction Time

    When a task involves many files or waits on external dependencies, the system can return a task identifier and hand processing over to background workers. Users do not need to keep the session open; status queries or result notifications can provide updates.

    The essential distinction is that successful submission means the task has been accepted—not that processing is complete or that the result meets acceptance criteria.

    Background tasks need an explicit lifecycle. At a minimum, users should be able to distinguish between queued, running, awaiting confirmation, completed, failed, and canceled states. When a task enters the awaiting-confirmation state, the system should save a checkpoint and release execution resources. After the user responds, processing can resume from the appropriate stage.

    For tasks that can be divided into smaller units, progress should use verifiable measures, such as completed file counts, items awaiting review, and failed items, rather than an unexplained percentage.

    Design Retries Around Idempotency

    Retries are an easily underestimated part of background execution. A worker may write a result and then stop before updating the task status. On recovery, the same step may run again.

    Idempotency mechanisms should therefore reflect the business operation. Task identifiers, step identifiers, and input versions can identify the same processing attempt and help prevent duplicate writes or notifications. Temporary failures can receive a limited number of retries. Insufficient permissions or invalid inputs should produce explicit failure reasons rather than repeated execution attempts.

    Make Cancellation Boundaries Clear

    The system can prevent steps that have not started and request that running steps stop. However, cancellation may not reverse external operations that have already occurred.

    Where rollback is required, compensating actions should be defined in advance. Users should be able to see which steps stopped and which results still exist.

    For long-running tasks, or tasks that may continue across permission changes, authorization should be checked again before critical operations. Permission granted at submission time must not be treated as permanently valid.

    5. Connect the Workflow Through a Multilingual Document Example

    Batch translation of internal knowledge documents is a practical starting point. The user selects the file scope, and the system checks read permissions and whether the files can be parsed. If target languages or publication scope are unclear, it asks a focused follow-up question.

    Once the parameters are complete, the system records the file versions and submits a background task. During execution, it divides work by file or section, preserves the correspondence between source text and translations, and flags unparseable passages, terminology conflicts, and formatting problems. Results first enter a review area. They proceed to publication only after review and authorization requirements are satisfied.

    This example also highlights the distinction between model selection and workflow design.

    The value of a specialized translation model should be evaluated through target-language coverage, terminology consistency, preservation of numbers and units, and coherence across long documents.

    A mixture-of-experts model, by contrast, is an architectural approach. In models with expert layers, routing typically selects only a subset of experts to process each token. Total parameter count is not the same as the number of parameters activated during an inference pass. It also cannot directly establish deployment cost, response latency, or translation quality. Evaluating large models requires considering how weights are stored and loaded, the inference resources available, and throughput under the actual workload.

    There is therefore no need to begin by deciding whether one large model should handle the entire workflow. Representative samples can first establish which model is suitable for translation and which is suitable for clarifying requirements and explaining results. Constraints that can be checked explicitly—such as terminology, numbers, and formatting—should preferably be handled by rule-based checks.

    Models handle interpretation and generation. The application records and enforces workflow state, approvals, and delivery conditions. This separation makes it easier to determine whether a problem comes from model output, tool behavior, or task scheduling.

    6. Validate Failure Paths Before Deployment

    The most valuable acceptance tests often examine what happens after something goes wrong, rather than whether an entire batch completes successfully:

    • If permissions are revoked after user confirmation, can the task prevent subsequent external delivery?
    • If a background worker stops after writing a result, will recovery cause duplicate delivery?
    • If one file cannot be parsed, can the system preserve valid results from other files and clearly identify the missing content?

    Early deployments should focus on low-risk workflows whose results can be reviewed. Track the rate of human intervention, partial failures, recovery after retries, and the reasons reviewers reject results.

    If follow-up questions are frequent, first check whether default rules are clear. If retries often create duplicate results, fix the idempotency design first. Measuring these issues separately helps determine whether the next improvement belongs in the model, tool descriptions, or execution mechanism.

    System maturity is not just a matter of how many tool calls it can complete. It also depends on where it stops, whether it resumes correctly, and whether the final delivery stays within the scope the user confirmed.