Choosing and Evaluating LLMs for Agent Workflows
Public leaderboards are a weak guide once a model becomes the decision maker inside an agent. This article outlines a reusable evaluation method: hold the agent framework constant, test five representative task types, and judge models on task success, engineering usability, cost per successful task, stability, and safety controls. It also explains how to interpret results as a model mix rather than a single winner, and what to govern before production.
Choosing and Evaluating LLMs for Agent Workflows
Once a large language model moves from a chat tool into an agent system, the logic of model selection changes. In single-turn question answering, teams can often start from public leaderboards, average scores, and response speed. In agent scenarios, the model must keep understanding the goal, break work into steps, call tools, read and write memory, handle exceptions, and stay consistent across a long task chain. It is not only answering questions. It is a core decision maker inside an execution flow. The useful question is therefore not which model has the highest overall score, but which kind of model is better suited as the controller, the executor, the reviewer, or a low-cost node for subtasks.
To keep this as an engineering evaluation rather than a product review, this article does not discuss any specific vendor or model. It presents a reusable method: isolate variables inside the same agent framework, test capability with five typical task types, and combine success rate, cost, stability, and safety compliance into one judgment. The method applies both to internally built agents and to automated workflows that an enterprise runs in the cloud.
1. Why general leaderboards are not enough
Public leaderboards usually emphasize knowledge questions, code-snippet generation, or short-text reasoning. Agent failures often come from a different set of problems: incorrect tool parameters, lost context, repeated trial and error, failure to recognize high-risk actions, stopping halfway through a long task, unparseable output, and no self-check when something goes wrong. End-to-end success is the product of model capability, tool design, memory quality, process constraints, and safety guardrails. A single metric rarely covers all of that.
A more reasonable approach is to place each model in the same agent workflow and observe whether it can reliably finish the task end to end. The evaluation should cover at least four dimensions:
- Task completion: Can the model go from a natural-language goal to an acceptable result, rather than only producing intermediate content that looks correct?
- Engineering usability: Is the output parseable, reproducible, and maintainable, and does it follow the defined tool contract?
- Cost and stability: Measure cost per successful task, not only unit price. In long tasks, does the model stall, time out, or retry excessively?
- Safety and controllability: Does it ask for confirmation before irreversible actions, recognize permission boundaries, and know when to refuse or stop?
2. Controlling variables so comparisons resemble production
The most common flaw in multi-model evaluation is that the model changes and the surrounding setup changes with it. Extra prompts for one model, a private tool, or a human fix to an intermediate result measure how well the team tuned that run, not how the models differ. To keep results comparable:
- Use the same agent framework, the same system prompt, and the same tool definitions and permission settings.
- Run isolated copies with the same memory snapshot, knowledge-base version, and skill-pack version.
- Fix task inputs, attachments, timeouts, retry limits, and rules for human intervention.
- Where the models allow it, use the same reasoning budget, output length, and structured-format requirements.
- Record the full trace of every run, including the plan, tool calls, observations, retry reasons, and final output.
- Repeat each task several times so a lucky success is not treated as stable capability.
In engineering terms, a model adapter layer can wrap chat, tool calling, structured output, and multimodal input. The adapter should only translate protocols and map errors. It should not add private solving steps for one model, or the comparison stops being fair.
A simplified evaluation record can look like this:
{"task_id": "skill_packaging_01","run_id": "run_003","success": true,"steps": 9,"tool_calls": 14,"retries": 1,"manual_interventions": 0,"cost_per_success": 0.42,"safety_violations": 0,"final_score": 86}
Scores do not need to be perfectly precise, but they must be explainable. Teams can set weights from business goals. Complex planning tasks can weight success rate more heavily. Batch processing can weight unit cost more heavily. Tasks that touch external systems can weight a safety veto more heavily. Unconfirmed high-risk actions, unauthorized calls, and leakage of sensitive information should be hard failures, not defects that a high total score can offset.
3. Five task types, from skill packaging to browser automation
3.1 Skill packaging: abstraction and self-checking
The first task asks the model to turn existing prompts, operating experience, and constraints into a skill pack that can be published. The goal is not to copy a long prompt. It is to package experience as a capability that someone else can install and use. A qualified skill pack should at least include a purpose statement, an input and output contract, applicable boundaries, examples, failure handling, permission requirements, and version information.
Evaluation focuses on whether the model can find implicit constraints in the source material, turn vague descriptions into executable steps, fill in exception branches, avoid hard-coding temporary context, and, after producing the pack, check itself and point out where it might fail. A common failure is documentation that looks polished but cannot be executed: missing input validation, undeclared tool dependencies, examples that conflict with the rules, and no fallback when something fails.
A practical scoring checklist:
- Structural completeness: purpose, contract, examples, and boundaries are all present.
- Reusability: the pack does not depend on a specific environment or hidden context.
- Verifiability: it includes a self-check list and acceptance examples.
- Robustness: it explains how to handle timeouts, empty input, and format errors.
- Safety awareness: it states the permission scope and limits on high-risk actions.
3.2 Web development: planning, coding, and a repair loop
The second task gives a requirements description and asks the agent to produce a web page that runs and can be maintained. Evaluation should not stop at whether the page opens. It should check core interactions, basic tests, behavior across screen sizes, and a baseline of security and accessibility.
Suggested acceptance criteria:
- Functional correctness: the core flow works, and boundary inputs are handled.
- Code quality: the structure is clear, without large amounts of duplication and hard-coding.
- Maintainability: dependencies are restrained, and critical logic is commented.
- Responsiveness and accessibility: the layout is stable, and keyboard use and semantic markup are reasonable.
- Security: input is validated, and unsafe content injection is avoided.
- Repair ability: after a first-run failure, the model can use the error to locate and fix the problem.
In this task, the self-repair loop matters. A strong result is not perfect code on the first try. It is the ability to read a runtime error, narrow the problem, change the relevant part, and verify again. A model that keeps rewriting the entire codebase or ignores test results is a poor long-term execution node, even if the page eventually opens.
3.3 Presentations and copy: information structure and editability
The third task covers presentation design and copywriting. These tasks are subjective, so a human scoring sheet is required. The point is not how much text is produced. It is whether the structure is clear, the narrative holds together, the information is accurate, the visual style is consistent, and the output can still be edited later.
Review can focus on:
- Information architecture: a clear through-line, with sections that build on each other.
- Audience fit: tone, depth, and terminology match the intended reader.
- Factual consistency: data, conclusions, and citations have sources, and nothing is invented.
- Visual consistency: layout, color, and hierarchy stay uniform.
- Editability: the output keeps a modifiable structure instead of becoming a hard-to-maintain full-page image.
- Content density: filler is avoided, and each slide has a clear point.
In an enterprise setting, also check handling of sensitive information, use of copyrighted assets, and brand rules. A model can help generate the draft, but key figures and external statements still need human review.
3.4 Knowledge-base management: retrieval, citation, and updates
The fourth task is knowledge-base management: ingesting documents, chunking, indexing, retrieval, answering, citation, and updates. The agent should not only find material. It should judge whether a source is authoritative, outdated, or in conflict with another source, and it should give a traceable basis for the answer.
Evaluation focuses on:
- Citation coverage: key conclusions are supported by sources.
- Answer consistency: when documents conflict, the model explains the difference instead of forcing a merge.
- Update freshness: after a document changes, the answer reflects the new version.
- Permission isolation: users or tenants can access only authorized content.
- Memory hygiene: polluted or stale context is not written into long-term memory.
- Explainability: when retrieval fails, the model states clearly that information is missing.
The main failure mode is fluent text with no basis. If the model invents an answer when no source exists, or if citations do not match the conclusion, strong wording is not enough. That model should not be the controller of a knowledge agent.
3.5 Browser automation: long-chain execution and risk awareness
The fifth task is browser automation, such as multi-step navigation, information extraction, form filling, file download, and recovery from errors. This is closest to production. Pages change, elements load late, and flows break. The model must track state and handle exceptions.
Acceptance is not only whether the task finishes, but whether the process stays under control:
- The current state and the next step are recorded as the run proceeds.
- Common exceptions such as pop-ups, load delays, and changed elements are handled.
- Failures produce an understandable error reason.
- Repeated submission and unbounded retries are avoided.
- Confirmation is requested before irreversible actions.
- Domain allowlists, permission boundaries, and rate limits are respected.
For high-risk actions such as submit, payment, delete, and authorization, the agent must have an explicit confirmation point. Unconfirmed high-risk actions, unauthorized access, and attempts to bypass permissions should fail the run outright. Run automation in a sandbox, isolate credentials, and keep an audit log of every external action.
4. Reading the results: there is no single strongest model
After the five tasks, teams usually find that no model is best for every scenario. Stronger reasoning can mean higher cost and longer latency. A cheaper model may be fine for batch extraction and format conversion, but unstable on long-chain planning. Multimodal capability can improve page understanding and document handling, but it also needs stricter output checks.
A more practical strategy is a model mix:
- A controller model breaks down the goal, makes the plan, and performs the final review.
- A lower-cost model handles classification, extraction, summarization, format conversion, and similar subtasks.
- High-risk actions go through a separate rule engine or human approval. Safety is not left entirely to the model.
- Critical tasks keep a fallback model so a single integration failure does not stop the flow.
- Budget against cost per successful task, not the price of a single call.
Model version changes also change agent behavior. After launch, keep a small golden evaluation set and rerun it automatically when the model is upgraded, prompts change, or tools change. The set does not need to be large, but it must cover the core flow, typical exceptions, and safety boundaries.
5. Safety governance and rollout
Treat skill packs like code: review them, version them, make them reversible, and state their permissions and dependencies. Agent tools should follow least privilege, with allowlists, rate limits, and audit logs for external actions. For the knowledge base and memory, separate temporary context from long-term facts so unverified information does not enter long-term memory. For browser automation, run in an isolated environment, inject sensitive credentials through a controlled path, and require a second confirmation for irreversible actions.
Roll out in stages. Start with a small set of representative tasks to establish a baseline, then increase task complexity and the share of automation. Watch four core metrics first: success rate, human-intervention rate, cost per successful task, and the number of safety incidents. Expand traffic only after those numbers are acceptable. If the workflow runs in a cloud environment that already provides logging, monitoring and alerting, object storage, and a container platform, store run traces, cost records, and security audits in one place so the system can keep improving.
Closing
Choosing a large language model for agent work is an engineering evaluation problem, not a leaderboard ranking. Only by controlling variables, designing tasks close to real work, using an explainable metric set, and including safety and cost in the decision can a team find a model mix that is fit for long-term operation. For most teams, building a mechanism that can be retested, replaced, and governed matters more than picking one strongest model. That mechanism is what lets an agent system enter production and stay there.
