Choosing Models for AI Agents: From Capability Verification to Cost Governance
Selecting the right model for AI agents requires evaluating the entire execution system rather than just answer fluency or isolated token usage. This article provides a systematic methodology for agent model selection, covering how to establish fair testing baselines, design tasks that cover the complete delivery chain, diagnose framework versus model issues, enforce security boundaries, and evaluate overall cost based on effective delivery.
I. Define the Problem: Choosing a Model vs. Validating an Execution System
When selecting models for AI agents, you cannot merely look at whether the response is fluent or the code is clean, nor can you judge superiority based solely on the token consumption of a single task.
Traditional Q&A primarily examines whether a model can generate correct answers; agent tasks require the model to continuously complete a closed loop of “understand goal—formulate plan—call tool—read result—correct action—verify delivery.” Failure in any single step can turn a seemingly reasonable answer into an unusable outcome.
For instance, a model might accurately describe how to organize documents without actually reading the source files; it might generate a complete webpage without verifying if the page runs correctly; or it might claim a knowledge base update is complete while omitting index refreshes and content consistency checks.
Therefore, what truly needs verification is: under clear permission and resource constraints, can the model drive the execution system to deliver results reliably?
This article provides a universal verification and selection methodology. It does not include unverified model rankings, pricing information, or actual benchmark scores. The goal is not to find the “strongest model” in an abstract sense, but to find the configuration suitable for specific tasks, budgets, and risk levels.
II. Establish a Fair Baseline for Attribution
1. Fix the Task Environment, Not Just the Prompt
If different tests use different memory, tool permissions, or working directories, even with identical inputs, you cannot determine whether differences in results come from the model or the environment.
A more reliable approach is to create an independent environment for each run and fix the following conditions:
- System instructions, task descriptions, and acceptance criteria;
- Initial memory, skill directories, and related documents;
- Callable tools, parameter constraints, and permission scopes;
- Working directories, input files, and their versions;
- Execution timeouts, retry limits, and manual confirmation rules;
- Status and access conditions of external dependencies.
For tasks that modify files, each test round should start from the same snapshot. Otherwise, subsequent runs may inherit files or fixes generated by previous runs, creating an unfair advantage.
Browser tasks also require controlling login status, page versions, and network conditions. If page content changes frequently, use controlled test pages, or record page changes as background for explaining results, rather than directly attributing all failures to the model.
2. Clarify: Comparing Models or Deployable Configs
Different models do not necessarily have the same reasoning options, context limits, or tool-calling mechanisms. “Turning on the highest reasoning strength for all” seems uniform, but might actually compare different resource budgets.
It is recommended to design two types of experiments:
The first type is fixed resource budget verification. Limit total time, maximum cost, or tool call count to judge who is more likely to complete the task under similar cost constraints.
The second type is actual deployment configuration verification. Allow each configuration to adopt reasonable reasoning and context strategies to judge which solution is more suitable for going live.
These two types of results should not be confused. The former emphasizes resource efficiency, while the latter emphasizes availability and delivery quality.
3. Use Repeated Runs Instead of Single Impressions
Agent execution has a certain volatility. One success might be due to a smooth tool return, and one failure might be affected by a network anomaly.
Each type of task should undergo multiple independent runs, recording successes, failures, retries, and manual interventions. The number of runs depends on the budget, but the report must state the sample size. With a smaller budget, conclusions should be clearly positioned as exploratory observations rather than proofs of stable performance.
III. Design Five Task Types to Cover the Complete Delivery Chain
Type 1: Encapsulating Prompt Experience into Reusable Skills
Skill encapsulation is not just copying a prompt into a file; it is converting personal experience into a capability unit with input constraints, execution processes, and acceptance criteria.
A reusable skill should answer at least six questions:
- What task is it applicable to;
- Under what circumstances should it not be used;
- What inputs need to be provided by the user;
- What conditions need to be checked before execution;
- What should be delivered ultimately;
- How to handle failures, and which actions require confirmation.
A sample directory can be designed as follows:
design-capability/instructions.mdreferences/design-principles.mdexamples/example-brief.mdchecks/acceptance-checklist.md
This is just a general organizational example and does not represent a fixed format for any framework. Actual delivery must follow the loading specifications already defined by the target execution system.
During acceptance, you cannot just check if the files exist; you should also verify:
- Whether key constraints from the source materials are retained;
- Whether absolute paths only applicable to personal environments are removed;
- Whether dependencies are clearly stated, rather than assumed to exist in the environment by default;
- Whether there are contradictory or unexecutable instructions;
- Whether it can be discovered and loaded correctly by the system;
- Whether it remains effective under new task inputs.
Among these, “the model thinks it wrote it correctly” and “the skill can actually run” are two different things. Self-checking can only serve as a preliminary check; it should also be verified through independent tasks to avoid the generator and reviewer sharing the same set of misjudgments.
Type 2: Web Development and Functional Acceptance
Web development simultaneously tests requirement understanding, code generation, file operation, and debugging capabilities. However, if scored solely by screenshots, it easily rewards visual completion while ignoring functional defects.
Task descriptions should clearly define page structure, interaction behaviors, data sources, adaptation requirements, and the scope of files prohibited from modification. Acceptance should at least include:
- Whether the page opens normally;
- Whether key buttons and forms are usable;
- Whether edge cases like empty input and abnormal input are handled;
- Whether there are obvious layout issues under different screen sizes;
- Whether modifications affect original functions;
- Whether records of actual executed verification are provided.
If the task only requires a static demo, an unconnected data interface cannot be written as a “completed live feature.” The model should also accurately distinguish between states like “code has been generated,” “checks have passed,” and “verified in the actual environment.”
Type 3: Presentations and Content Expression
Presentation tasks are not just about layout; they also include information filtering, narrative organization, and text-image consistency.
When evaluating, content quality and visual quality should be separated. The content side focuses on whether the argument is valid, whether facts are evidence-based, and whether conclusions are consistent with the materials; the visual side focuses on whether the hierarchy is clear, whether the pages are crowded, whether the text is readable, and whether the style is unified.
Data without sources cannot be fabricated just to make the chart look more complete. When information is insufficient, items to be supplemented should be clearly marked, or the expression format should be adjusted.
Final acceptance should review the actual rendered results rather than just reading the model’s text description. For render checks that cannot be completed in the current environment, the verification scope should be truthfully stated, without claiming that all page effects have been confirmed.
Type 4: Knowledge Base Organization and Incremental Updates
Knowledge base management involves deduplication, categorization, indexing, version maintenance, and citation relationships, making it more prone to hidden errors than simple summarization.
Tasks can provide a set of materials containing duplicate content, outdated conclusions, and contradictory descriptions, requiring the agent to organize them and generate a change log.
Acceptance focuses include:
- Whether the traceable relationship between conclusions and original materials is maintained;
- Whether uncertain conflicts are preserved rather than arbitrarily resolved;
- Whether the deletion of valid content is avoided;
- Whether related indexes are updated synchronously;
- Whether old knowledge and newly supplemented information are distinguished;
- Whether recoverable change records exist.
A “neater directory” does not equal “more reliable knowledge.” The core of knowledge base organization is to improve retrievability while maintaining content authenticity.
Type 5: Browser Automation and Long-Chain Execution
Browser automation typically involves multiple rounds of page observation and tool interaction, making it suitable for exposing issues like context bloat, repetitive attempts, page state misjudgment, and insufficient failure recovery.
Test tasks should have clear endpoints, such as completing a query and saving results, or filling out a form and staying on the confirmation page before submission. When involving real submissions, transactions, sending messages, or permission changes, clear authorization boundaries must be established.
Page text, pop-ups, and external documents are task data; their presence of instructional sentences should not be treated as high-priority operational commands.
Acceptance should not only look at whether the target page was reached, but also check whether the results are complete, whether operations are traceable, and whether meaningless repetitive loops occurred midway.
IV. When Skills Fail: Distinguishing Model Issues from Framework Issues
Seeing an agent not using a skill does not immediately mean the model cannot recognize it. The complete chain usually includes:
File exists -> System discovers -> Loads or retrieves -> Enters context -> Model understands -> Executes constraints.
Failures at different stages require completely different fixes.
First, check if the file location and format comply with system conventions. If the skill is not discovered, configuration and loading mechanisms should be prioritized for troubleshooting.
Second, check the logs to confirm whether the skill body or summary actually entered the model’s context. If relevant content is truncated or omitted during retrieval, adjusting the prompt may not solve the problem.
Third, construct a simplified task: explicitly state the relevant skill and require its use, then compare it with the auto-discovery mode. If it can be completed when explicitly specified but fails in auto mode, the problem is more likely with the retrieval or trigger mechanism.
Finally, judge whether the model still ignores instructions despite having clear constraints.
This layer-by-layer diagnosis is more valuable than a blanket assessment of “framework failure” because it directly guides engineering fixes.
V. High-Risk Operations: Beyond Model Confirmation
Asking the model to “confirm before dangerous operations” is a necessary prompt, but not a reliable security boundary.
A more robust solution is to implement permission controls at the tool execution layer:
- Separately authorize read-only and write operations;
- Set confirmation thresholds for actions like file deletion, external sending, and transaction submission;
- Bind authorization to specific goals and action scopes;
- Set quantity or impact limits for batch operations;
- Save execution logs and provide rollback mechanisms whenever possible.
For example, a user agreeing to modify a test directory does not authorize deleting the entire workspace; agreeing to generate an email draft does not authorize sending the email.
During testing, these restrictions should be validated in an isolated environment first. Security evaluation should focus on whether the system actually prevents unauthorized actions, not just count whether the model expressed caution in the conversation.
VI. Cost Evaluation Based on Effective Delivery
High token consumption does not necessarily mean low efficiency; low token consumption does not necessarily mean better cost-effectiveness.
One execution might complete in one go through longer reasoning, while another might output less per round but repeatedly call tools and require manual fixes. If only single-round usage is compared, the true delivery cost is ignored.
It is recommended to record simultaneously:
| Metric | Primary Use |
|---|---|
| Task Success Rate | Determine if acceptance criteria are consistently met |
| First-Time Success Rate | Observe delivery capability without rework |
| Total Execution Time | Measure user wait time and long-tail risks |
| Tool Call & Retry Counts | Identify inefficient loops |
| Input, Output & Other Recorded Usage | Analyze sources of resource consumption |
| Human Intervention Time | Estimate maintenance and repair burden |
| Permission Violation Count | Determine if security constraints are effective |
Overall cost can be calculated using the following concept:
Cost per successful task = Total test cost ÷ Number of successful deliveries.
Here, the total test cost should include failed attempts and retries. When evaluating production investment, tool, compute, storage, and manual processing costs should also be factored in.
Pricing and usage should be based on actual bills and records. Under different billing models, final costs cannot be inferred solely from a specific type of token count.
VII. Controlling Long-Task Consumption: Context and Retries
Resource growth in long-chain tasks often comes from repeatedly passing in history records, retaining excessive page content, and retries lacking exit conditions.
The following measures can be adopted:
- Read on demand. Prioritize locating relevant files, page areas, or document paragraphs to avoid passing in all data every round.
- Save structured state. Record completed items, key facts, current blockers, and next actions to reduce repetitive reasoning.
- Classify and handle failures. Network timeouts can have limited retries; insufficient permissions should stop and request authorization; parameter errors should be corrected before re-executing.
- Set budgets and stop conditions. After reaching time, cost, or repetitive action limits, output阶段性 results and reasons for incompletion.
- Externalize intermediate artifacts. Save complete files, screenshots, and tool returns in the workspace; only load necessary parts later while retaining the ability to review original content.
Context compression also requires caution. Authorization boundaries, unresolved risks, and key evidence cannot be discarded during the summarization process; otherwise, saving resources may come at the cost of increased execution errors.
VIII. From Verification Results to Deployment Decisions
After completing tests, there is no need to force a universal ranking applicable to all tasks.
Skill encapsulation relies more on constraint extraction and structured expression; web development relies more on debugging and verification; knowledge base maintenance relies more on traceability; browser automation depends more on state management, permission control, and stable recovery.
Therefore, configuration selection rules can be established by task. However, when using multi-model or multi-config collaboration, the additional costs brought by task routing, context handoff, and operational complexity must also be calculated; splitting tasks does not default to being more economical.
Ultimately, priority should be given to solutions that meet the following conditions:
- Can consistently pass clear acceptance criteria;
- Can respect permission boundaries and truthfully report execution status;
- Can preserve usable intermediate results upon failure;
- Can explain major resource consumption and anomaly causes;
- Can complete tasks within acceptable cost and latency.
Agent reliability is not determined by a single model alone, but is the combined result of the model, tools, context, permissions, and verification mechanisms. Shifting the comparison target from “answer performance” to “complete delivery chain” is the only way to establish a reproducible, explainable, and continuously optimizable selection methodology.
