Velamuvi AIAcademy

Lesson 3 of 5 · Agency

Reliability vs Flexibility

Fixed workflows are reliable but rigid; agents are flexible but less predictable. Simulate both and learn how hybrids and guardrails get the best of each.

  • 5 min read
  • Intermediate
  • Reviewed
In this lesson you will learn
  • Explain the trade-off between reliability and flexibility
  • Show how the mix of routine and unusual cases changes the best design
  • Combine a reliable workflow with a flexible agent
  • Increase an agent's reliability with structure and checks

Two kinds of failure

A fixed workflow is very reliable on the cases it was built for, and fails completely on the ones it wasn't. An agent copes with surprises, but each of its many decisions is a small chance to go wrong. Which matters more depends on your mix of cases.

A simulation

This program runs 1,000 cases three ways: a workflow with four highly reliable steps that can't handle unusual cases, an agent that handles everything but with less reliable steps, and a hybrid that sends only unusual cases to the agent:

Try it yourselfPython
import random

# Simulate 1,000 runs of a task done two ways.
# Fixed workflow: 4 known steps, each 99% reliable, but it can't handle "unusual" cases.
# Agent: adapts to unusual cases, but each of its ~7 steps is 96% reliable.
random.seed(5)

def workflow_run(unusual):
    if unusual:
        return False                           # rigid: no step for this case
    return all(random.random() < 0.99 for _ in range(4))

def agent_run(unusual):
    steps = 9 if unusual else 6
    return all(random.random() < 0.96 for _ in range(steps))

for unusual_share in [0.05, 0.30]:
    cases = [random.random() < unusual_share for _ in range(1000)]
    wf = sum(workflow_run(u) for u in cases)
    ag = sum(agent_run(u) for u in cases)
    hy = sum(agent_run(u) if u else workflow_run(u) for u in cases)    # hybrid: route unusual cases to the agent
    print(f"{unusual_share:.0%} unusual cases: workflow {wf / 10:.1f}%, agent {ag / 10:.1f}%, hybrid {hy / 10:.1f}%")
  • With 5% unusual cases, the workflow beats the agent (90.5% against 77.5%): routine cases dominate, and the agent's extra steps cost reliability on all of them.
  • With 30% unusual cases, the agent overtakes the workflow, which fails every unusual case.
  • The hybrid beats both in both situations: reliable steps for routine work, flexibility only where it's needed.

Making agents more reliable

When you do need an agent, structure narrows its room for error:

  • Fewer, better tools with clear descriptions and validated arguments.
  • Plans that are checked before execution, and checks after each step.
  • Specialists (routing) instead of one agent that does everything.
  • Critics and tests that catch mistakes before they matter (reflection).
  • Evaluation on a fixed test set after every change.

Common mistakes

Practice exercise

Compare reliability of a rigid workflow, a flexible agent and a hybrid of both.

Your solutionPython
usual_share = 0.8           # 80% of cases are routine
workflow_success = 0.96     # on routine cases (it fails on all unusual ones)
agent_success = 0.78        # on any case

# Work out the overall success rate (as a whole-number percentage) of:
#   the workflow alone, the agent alone, and a hybrid (workflow for routine, agent for unusual)
# Print like: workflow 12%, agent 34%, hybrid 56%
Knowledge check

95% of your cases are routine and a workflow handles them very reliably. What is usually the best design?

Summary

  • Workflows are reliable but rigid; agents are flexible but less predictable.
  • The best design depends on your mix of routine and unusual cases.
  • Hybrids route routine cases to workflows and unusual ones to agents.
  • Increase agent reliability with structure: good tools, plans, checks, specialists and evaluation.

Next: the cost and latency trade-offs of agentic designs.

Finished reading? Tick it off to track your progress.