From Models to Agents: Architecture and Practice of Execution Frameworks

    Agent discussions are shifting from what a model can answer to what a system can reliably complete. This article explains why execution frameworks, often called harnesses, matter: how they turn uncertain model decisions into bounded, auditable workflows through task contracts, context and state management, verification, controlled execution loops, layered domain design, cautious multi-agent collaboration, reusable skills, shared infrastructure, evaluation metrics, and clear responsibility boundaries.

    1. Why Agent Discussions Must Include Execution Frameworks

    Technical discussion around agents is moving from “what can the model answer?” to “what can the system complete reliably?” That distinction is the starting point for understanding an execution framework.

    Models are good at understanding input, generating content, and proposing plans. Business tasks are rarely a single question and answer. Producing a business analysis report may require reading data, checking metric definitions, calculating indicators, explaining anomalies, generating a document, and submitting it for review. Each step involves the external environment, execution state, and failure handling. None of this can be solved by a prompt alone.

    An execution framework is often called a harness. In the agent context, it is not a technical component with one standard definition. It usually means the set of runtime mechanisms built around a model: organizing context, scheduling tools, persisting state, handling exceptions, controlling permissions, and deciding whether a task is actually finished.

    A simplified chain shows where it sits:

    User goal → task constraints → model decision → tool execution → result check → state update → continue or stop

    The model supplies understanding and decision-making. Tools supply the ability to act on the external environment. The execution framework organizes those capabilities into a controllable loop.

    Evaluating an agent therefore means more than checking whether it produced a reasonable plan. The more important questions are whether the plan was executed correctly, whether failure can be recovered, whether results can be verified, and whether operations stayed within authorized scope.

    2. The Core of an Execution Framework: Placing Uncertain Decisions Inside a Deterministic System

    The hard part of an agent system is that model output is uncertain, while business execution usually requires clarity, traceability, and repeatability.

    A reliable architecture does not try to remove all uncertainty. It sets boundaries around uncertain decisions.

    2.1 Make the task contract explicit

    Natural-language goals often hide conditions. “Analyze this month’s sales,” for example, does not specify data scope, metric definitions, delivery format, or acceptance criteria.

    The execution framework should turn the goal into a task contract that at least defines:

    • Input data and accessible resources
    • Allowed tools and operations
    • Output format and required evidence
    • Limits on time, budget, and execution steps
    • Critical points that need human confirmation
    • Conditions for success, failure, and abort

    Not every field should be inferred by the model. Content involving permissions, financial definitions, or compliance requirements should come first from user confirmation or business configuration.

    The value of a task contract is that it reduces goal drift. The system no longer merely tries to “keep producing helpful content.” It runs toward a deliverable that can be accepted.

    2.2 Manage context instead of appending history without limit

    Long tasks keep producing tool results, temporary conclusions, and intermediate files. Putting all of that back into the model context raises cost, dilutes what matters, and accumulates conflicting information.

    A more practical approach is layered information management:

    • Keep the current goal and hard constraints stable
    • Bring recent observations into context only as needed
    • Turn verified facts into structured summaries
    • Store large files and history in external storage
    • Keep sources and generation times for key conclusions

    Summaries are not reliable by nature. If a summary drops a condition, later reasoning may rest on a wrong foundation. Original evidence and compressed understanding should therefore be stored separately, with a way to look back when necessary.

    2.3 Persist business state, not only the conversation

    A conversation can show what the system said. It does not necessarily show how far the system got.

    Production needs independent task state, such as pending steps, completed actions, tool-call identifiers, locations of intermediate artifacts, approval results, and failure reasons.

    After a process exits or the network drops, the system should resume from that state rather than reread the whole conversation and guess which actions already finished.

    External writes need an especially clear distinction among “not yet executed,” “in progress,” “succeeded,” and “result unknown.” A timeout is not the same as failure: the request may already have taken effect in an external system even though the response never returned.

    2.4 Verify results instead of accepting the model’s self-report

    “The task is complete” is only model output. It is not reliable evidence of completion.

    The execution framework should use independent checks wherever possible. Examples include:

    • Whether a document contains the required sections
    • Whether calculations satisfy validation rules
    • Whether a file was actually created and can be read
    • Whether written data meets constraints
    • Whether an external operation returned a confirmable status

    For tasks that cannot be fully verified automatically, the system should output evidence, assumptions, and uncertainty, and keep a path for human review.

    3. How to Design a Reliable Execution Loop

    A simple agent loop calls the model, runs a tool, and returns the result to the model. A production system also needs budgets, approvals, validation, and recovery.

    The pseudocode below only illustrates control structure. It does not represent any specific product interface:

    1. Read task state
    2. Check whether the task has already ended
    3. While the task is still running:
    4. Check time, cost, and step budgets
    5. Assemble the current context
    6. Get the next action proposed by the model
    7. Validate action format, parameters, and permissions
    8. If the action requires approval:
    9. Save state and wait for confirmation
    10. If the action is an external write:
    11. Check the risk of duplicate execution
    12. Execute the action
    13. Record the result and evidence
    14. Validate the deliverable
    15. Update task state
    16. If acceptance criteria are met:
    17. Mark the task complete
    18. If it is not safe to continue:
    19. Mark the task aborted and request human handling

    The most important design principle is this: the model may propose an action, but deterministic rules decide whether that action is allowed to run.

    Retry policy must also distinguish operation types. Read-only queries are usually safer to retry. Writes such as sending a notification, creating an order, or changing configuration need idempotency identifiers, a pre-execution check, or human confirmation.

    For tasks that span multiple systems, do not assume a single rollback is possible. A more realistic approach is to design compensation for critical actions and to state clearly which consequences are irreversible.

    4. Does Stronger Model Capability Make the Execution Framework Obsolete?

    Stronger models can reduce the need for elaborate prompts, fine-grained planning, and repeated correction. That does not mean the execution framework disappears.

    Two kinds of capability should be separated.

    The first is cognitive capability: understanding the task, generating a plan, recognizing anomalies, and choosing tools. More of this may be carried by the model over time.

    The second is system responsibility: authentication, permission isolation, state persistence, audit records, budget control, and failure recovery. These duties cannot be removed just because the model is smarter.

    A model may judge whether an operation looks reasonable, but an organization still needs an independent permission system to decide whether it is allowed to run. A model may explain a failure, but task state still needs to be persisted so the system can resume after restart and support accountability.

    The execution framework may therefore become lighter and more standardized, not vanish. For developers, the point is to avoid freezing large numbers of short-term patches into long-term architecture, while keeping the engineering boundaries that cannot be omitted.

    5. General Agents and Vertical Agents Are Not Simple Substitutes

    A general agent emphasizes breadth of task coverage. It fits situations where requirements change often and the process is not yet fixed. A vertical agent emphasizes domain constraints. It fits businesses with clear rules, sensitive data, and a high cost of error.

    The difference is not only in prompts. It is also in system design.

    Vertical scenarios often need stricter terminology, data definitions, approval chains, and acceptance rules. An inventory adjustment, for example, must specify units, warehouse scope, and change permissions. A contract review must separate fact extraction, risk flags, and a final legal judgment.

    A general system can provide underlying execution capability, but open-ended reasoning alone rarely acquires every business constraint.

    A more practical architecture is layered:

    • A foundation model provides general understanding and reasoning
    • The execution framework provides state, tools, and safety control
    • A domain layer provides rules, knowledge, and process
    • An acceptance layer provides business checks and human approval

    For stable processes with limited branches, prefer a deterministic workflow and introduce a model only where understanding or judgment is required. An agent is not the only form of automation, and it should not be the default answer for every process.

    6. Multi-Agent Collaboration: Prove the Benefit Before Adding Roles

    Multi-agent systems are often designed as a planner, an executor, and a checker. That division can improve handling of complex tasks, but adding roles does not automatically improve reliability.

    Collaboration adds cost: information synchronization, repeated reasoning, conflicting outputs, waiting time, and unclear responsibility. If every role shares the same wrong premise, multiple models can also agree on a wrong conclusion.

    Three conditions help decide whether multiple agents are needed:

    1. Whether subtasks have relatively independent inputs and outputs
    2. Whether parallel execution actually shortens the critical path
    3. Whether there are explicit rules for merging and accepting results

    Tasks that suit parallel work should exchange information through structured artifacts, not through conversations that grow without limit. Each subtask should have a clear owner, a stopping condition, and a failure state.

    Before adopting complex collaboration, establish a baseline with a single agent or a fixed workflow. Compare success rate, total cost, latency, and the number of human interventions. Multi-agent design has engineering value only when the gain exceeds the added complexity.

    7. Turn Personal Experience into Reusable Skills

    Packaging experience as a skill means converting tacit working methods into assets a machine can read, execute, and verify. It is not simply saving a prompt.

    A reusable skill usually needs to include:

    • Applicable scenarios and conditions where it should not be used
    • Input requirements and how missing information is handled
    • Operating steps and callable resources
    • Output specifications
    • Common failure modes
    • Verification methods and escalation paths

    A business-analysis skill, for example, needs more than “aggregate, then compare, then explain.” It should also specify how to handle missing data, outliers, changes in metric definitions, and insufficient evidence.

    Skills also need version control. After business rules change, an old skill may no longer apply. Unverified experience should not go straight into production execution. Skill updates should come with test cases and regression evaluation, so a local improvement does not break existing tasks.

    8. Where Agent Infrastructure Creates Value

    The value of infrastructure is not another wrapper around a model call. It is solving system problems that appear across tasks, models, and businesses.

    Capabilities worth building include:

    • Task scheduling, timeout handling, and resume from checkpoints
    • Tool permission management and credential isolation
    • Execution traces and audit records
    • Data access control and handling of sensitive information
    • Test-set management, regression evaluation, and failure analysis
    • Cost accounting, budget limits, and resource governance

    Object storage can hold task artifacts. A message queue can support asynchronous scheduling. A container environment can isolate some execution tasks. Logs and monitoring can help locate anomalies. These basic components do not automatically make an agent safe.

    Execution isolation, for example, still needs network access limits, resource quotas, and least-privilege credentials. Content from external documents or web pages should be treated as data to be processed, not automatically promoted to system instructions. Permission changes and sensitive writes still require independent checks.

    9. How to Measure Whether an Agent Is Actually Usable

    Evaluating an agent is not only about fluent answers, and it should not rely only on a score the model gives itself.

    Four groups of metrics are useful:

    Task effectiveness: acceptance pass rate, completeness, factual correctness, and whether the deliverable is usable.

    Execution stability: tool-call failure rate, recovery success rate, duplicate operations, and how often a human takes over.

    Resource efficiency: total cost per successful task, end-to-end latency, and resources consumed by failed tasks.

    Safety: unauthorized attempts, exposure of sensitive information, unapproved writes, and irreversible errors.

    The test set should cover normal tasks and also missing inputs, conflicting requirements, tool timeouts, insufficient permissions, and misleading external content. After a framework upgrade, check whether the same set of tasks regresses, rather than only showing a few new successes.

    Traces should also distinguish whether an error came from model judgment, tool implementation, context organization, or the business rules themselves. If errors cannot be located, continuous improvement is hard.

    10. From Automated Execution to Unattended Operation, Responsibility Still Has a Boundary

    High automation can remove a large amount of repetitive work. “The task can run automatically” does not mean “the organization can have no one responsible.”

    Running a business involves setting goals, bearing responsibility, controlling funds, meeting compliance requirements, and handling conflicts of interest. These are not only technical problems. For high-risk decisions, even a system with strong execution capability still needs a clear authorizer, approval conditions, and an accountability mechanism.

    A more workable path is to start with low-risk tasks that can be verified and reversed, then expand the scope of automatic execution step by step. Each expansion should add evaluation, monitoring, and emergency mechanisms at the same time.

    Conclusion: Reliability Comes from Boundaries, Not Only from Capability

    Discussing an execution framework is really discussing how to turn model capability into reliable business execution.

    A mature system does not need the most tools, the longest context, or the most complex multi-agent structure. It does need clarity about what the goal is, where information comes from, who authorizes an action, how state is stored, how results are verified, and how failure is recovered.

    Starting with a limited task, setting acceptance criteria, and then filling in state, permissions, observability, and recovery is usually more effective than first building a large autonomous system. Model capability decides what the system might be able to do. The execution framework decides whether that capability can enter production in a way that is controllable, maintainable, and accountable.