Post

AI Agents: The Real Objective

An agent is not a goal in itself. It is a design choice you make when flexible, model-driven decisions are worth the cost — and a mistake when they are not.

AI Agents: The Real Objective

Most writing about AI agents starts with architecture — orchestrators, memory layers, agent swarms. That is the wrong end of the problem. The useful question is not how do I build an agent? but what outcome am I trying to produce, and is an agent the cheapest reliable way to produce it?

Agents add cost, latency, non-determinism, and entirely new failure modes. They earn their place only when their flexibility buys back more than it charges.

Don’t build an agent because you can. Build one because it can reliably accomplish something valuable that simpler software cannot.

Start with the objective

Before frameworks, before orchestration patterns, name the outcome. Agents tend to pay off on problems shaped like these:

  • Researching a question across many sources and reconciling them
  • Reading documents and extracting structured insight
  • Writing code, running it, reading the failure, and fixing it
  • Handling customer requests that branch unpredictably
  • Operating tools and software on someone’s behalf

What these share is that the path to the answer isn’t known in advance. If a function, a SQL query, an API call, or a deterministic workflow gets you there reliably, use that. It will be faster, cheaper, testable, and it will not surprise you at 2 a.m.

What actually makes an agent

Five parts, and each one is a place where real systems break.

ComponentRoleFails as
ModelInterprets the goal, decides the next step, judges resultsConfident wrong decisions
InstructionsObjective, permissions, prohibitions, when to escalateVague scope, silent drift
ToolsThe ability to act — search, query, execute, writeIntelligent but powerless
LoopAct → observe → adjust → repeatInfinite loops, runaway cost
SafetyValidation, permissions, limits, logging, human approvalThe expensive kind of failure

The model is the reasoning, not the system

The LLM interprets context and decides what to do next. That is a component, not an architecture. Everything around it — the validation, the retries, the logging — is ordinary software engineering, and it is where most of the reliability lives.

Instructions are a contract

Good agent instructions state the objective, what the agent may do, what it must not do, how it should behave, and — the part most often skipped — when it should stop and ask a human. An agent that never escalates isn’t autonomous; it’s unsupervised.

Tools turn text into action

On its own, a model produces information. Tools let it search, read files, query databases, call APIs, execute code, and manipulate documents. Tool design is where most agent quality is won or lost: a well-named tool with a tight schema and a clear error message will outperform a clever prompt wrapped around a vague one.

The loop is the actual distinction

A conventional program runs input → rules → output. An agent runs something closer to this:

flowchart TD
    A[User goal] --> B[Instructions + context]
    B --> C[Model reasons]
    C --> D{Decision}
    D -->|Act| E[Tool call]
    E --> F[Observation]
    F --> G[Validate / evaluate]
    G -->|Continue| C
    G -->|Retry| E
    G -->|Escalate| H[Ask human]
    G -->|Complete| I[Result]
    H --> I

In code, the skeleton is unglamorous — and that is the point:

1
2
3
4
5
6
7
8
9
10
11
while not done and steps < MAX_STEPS and cost < BUDGET:
    decision = model.decide(goal, context)

    if decision.needs_human:
        return escalate(decision, context)

    result = tools.run(decision.tool, decision.args)   # permissioned + validated
    context.append(result)

    done = evaluate(goal, context)
    steps += 1

Note what is doing the work: the step ceiling, the budget, the permission check, the evaluation. The model picks the move. The scaffolding keeps the game finite.

Safety is not a later phase

An autonomous system should not be trusted simply because it is capable. At minimum: input validation, output validation, tool-level checks, scoped permissions, hard limits, logging, human approval for irreversible actions, and a defense posture against prompt injection — because any content your agent reads is content someone else may have written for it.

Treat every tool call as untrusted input to your infrastructure and every fetched document as untrusted input to your model.

The one principle that matters most

Start simple → measure → add complexity only when justified.

Do not begin with ten agents, elaborate memory, layered orchestration, and every framework on the shortlist. Begin with:

One objective → one agent → a few well-designed tools → clear instructions → evaluation.

Then ask the only question that earns you the right to add complexity: where does it actually fail? Add the component that fixes that failure. Anthropic’s guidance on this is blunt — the most successful agent systems are usually not the most sophisticated ones. Complexity should be a response to evidence, not to ambition.

Think in levels

Most “agent” projects belong on a lower rung than their authors assume.

LevelShapeUse whenExample
0 — Ordinary softwareRules → outputThe problem is deterministicCompute tax from known rules
1 — LLM applicationPrompt + context → responseInterpretation or generation is the hard partSummarize this document
2 — Tool-using agentGoal → reason → act → observeThe sequence of steps can’t be known upfrontResearch a company across sources, produce a report
3 — Agentic workflowOrchestrated stagesThe process is predictable but multi-stepResearch → analyze → verify → write → review
4 — Multi-agent systemSpecialists + coordinationSpecialization and delegation genuinely improve resultsPlanner delegating to researcher, analyst, coder, reviewer

Level 3 deserves more attention than it gets. When the process is reasonably predictable, an explicit workflow beats an autonomous loop: it is easier to control, easier to debug, and easier to explain when it goes wrong. Level 4 is real and useful — modern frameworks support handoffs and agents-as-tools — but it is a destination, not a starting point.

Here is the decision in one picture:

flowchart TD
    A[What outcome do I need?] --> B{Fully deterministic?}
    B -->|Yes| L0[Level 0 — write the program]
    B -->|No| C{Just needs interpretation<br/>or generation?}
    C -->|Yes| L1[Level 1 — LLM call]
    C -->|No| D{Is the step sequence<br/>knowable in advance?}
    D -->|Yes| L3[Level 3 — explicit workflow]
    D -->|No| L2[Level 2 — tool-using agent]
    L2 --> E{Does specialization<br/>measurably help?}
    E -->|Yes| L4[Level 4 — multi-agent]
    E -->|No| L2

What a beginner should actually learn

In this order. Frameworks come last, not first — they are an implementation of these ideas, and they change faster than the ideas do.

  1. LLM fundamentals — prompts, context, tokens, structured output, reasoning, and above all the model’s limitations.
  2. Tool calling — how a model selects and invokes functions, APIs, databases, and services.
  3. Agent loops — decide, act, observe, repeat, and how to terminate.
  4. Context and state — what the agent carries across steps, and when it needs to carry something across sessions.
  5. Workflows — sequential and parallel execution, routing, retries, evaluation, human approval.
  6. Guardrails and security — permissions, validation, prompt-injection defense, tool restrictions, sensitive-action approval.
  7. Evaluation and observability — the discipline that separates a demo from a system.

That last one deserves its own question: how do you know your agent works? Measure task success, accuracy, tool-call correctness, latency, cost, failure rate, and safety violations. Agent runtimes increasingly ship tracing for exactly this reason — debugging an autonomous system is impossible without visibility into what it actually did.

When you should not build an agent

This is the most valuable list in the article, so it is worth stating plainly. Skip the agent when:

  • The workflow is completely deterministic
  • A single API call or database query solves it
  • A conventional program would be more reliable
  • The cost of a mistake is unacceptable and you don’t yet have the controls
  • The agent adds complexity without a measurable benefit

Automation is not the same thing as an agent. A traditional workflow can be superb automation. An agent becomes worth its overhead only when the system genuinely needs flexible, model-driven decisions about how to reach a goal.

The mental model to keep

Stop thinking “I am building an AI agent.”

Start thinking “I am building a reliable software system that uses an LLM at the points where flexible reasoning is valuable.”

That shift changes what you build. It puts validation, permissions, budgets, evaluation, and escalation paths on the critical path — where they belong — and it demotes the model to what it actually is: one component among several, and rarely the one that determines whether the system is trustworthy.

The objective, restated

The goal of agent engineering is not maximum autonomy, maximum agents, maximum tools, or the most impressive architecture diagram. It is:

Maximum useful outcome with minimum necessary complexity.

Or, as a working checklist:

  • Give the system a valuable goal
  • Give it enough intelligence to reason
  • Give it the right tools to act
  • Let it adapt when the path is unclear
  • Keep it inside safe boundaries
  • Measure whether it actually works
  • Add complexity only when the evidence demands it

Everything else is detail.

This post is licensed under CC BY 4.0 by the author.