Field guide · Agents

Agents: write down what it may and may not do

You ask an agent to “handle the ticket”. It looks up the order, changes the address and sends an email. In a demo that looks smart. In production the questions arrive: who allowed the address change, who owns the mistake, and can we replay it? Write the task, permissions, state and stop conditions before talking about multi-agent systems.

For Anyone turning a chatbot into a process that actually does work You leave with A task-boundary card, a tool-permission table and one replayable single-task flow Time 12 minutes to read; about half a day for the first flow Last checked 25 Nov 2026

This is Specul’s decision framework for agents, not a ranking of frameworks or products. Tool capabilities, licences and safety boundaries remain with the linked pages and original sources.

If you only have five minutes
  1. An agent is model + tools + state + loop + permissions. Miss one and it is not one.
  2. Start with one job, one owner and one definition of done.
  3. Being able to call a tool is not permission to call it. Grant each tool separately.

The full guide starts below. Use the tables for reference; you do not need to memorise them.

One concrete job

Take one concrete job: pull 20 tickets a day, decide whether to refund, draft a reply, but require a human click before sending. The flow must stop, be auditable and replayable.

Build a single-task, replayable, approvable agent first. Multi-agent is complexity, not proof of capability.

1 · Five parts: model, tools, state, loop, permissions

The model proposes the next step, tools change the outside world, state remembers what happened, the control loop decides whether to continue or stop, and permissions decide which actions are forbidden. Remove one and the agent collapses into a chatbot that calls functions.

Permissions are the most overlooked part. A model may think about anything, but the system may only let it do explicitly authorised actions. Writing permissions in a prompt is not permission; they must be enforced by runtime code, an identity system or an approval flow.

PartQuestionCommon failure
ModelWhat nextTalks but does not stop
ToolsHow to change the outside worldWrong arguments, excessive permission, untrusted returns
StateWhat happened beforeStale state or no state at all
LoopWhen to continue, retry or stopInfinite loops, duplicate writes, runaway cost
PermissionsWhich actions are forbiddenPrompt-level constraints bypassed

↑ Back to contents

2 · Task boundary: one job, one owner, one definition of done

A shippable agent should have a task describable in one sentence: what it reads, what it does, what it produces and when it stops. The broader the task, the harder it is to know whether it is done and to limit side effects.

Every task needs a human owner. The owner is not the person you call after something breaks; they define done criteria in advance, approve irreversible actions and decide when to stop. An agent without an owner produces blame, not accountability.

List irreversible actions separately: sending externally, paying, deleting, publishing, changing permissions, touching production data. By default these require human confirmation. If they must be automated, they need limits, allowlists, rollback and audit.

Rule of thumb: if the work has no observable result and no one accountable for it, it is not ready for an agent.

↑ Back to contents

3 · Tools and permissions: can call does not mean should call

The vaguer the tool definition, the more likely the model fills in wrong arguments. Each tool should state what it does, its input, its output, its failure return, whether it is idempotent and whether it has side effects. Tools should reject invalid arguments instead of guessing and continuing.

Grant permissions by identity × action × object × scope. For the same agent, reading a knowledge base and sending external email are different permissions; reading one project and reading all projects are different too. Narrow tool permissions is far more effective than writing “do not misbehave” in a prompt.

MCP servers, plugins and third-party tools are also supply chain. Pin versions, verify sources, limit network and file access, keep an inventory — it is no different from adding a dependency. More tools mean more attack surface. Connect one tool you truly need before ten you might need later.

↑ Back to contents

4 · State and memory: replay first, long-term memory later

State is not stuffing the whole chat history into context. Separate at least: temporary state for this task, long-term memory across tasks, and the real state of external systems. Mix them and the agent treats old conclusions as current and guesses as facts.

Build replay first: record each step’s input, model output, tool call, tool return, approval and final result. Replay is not for “looking at logs”; it is for identifying which step failed and whether the same input reproduces. Without replay, evaluation and audit are impossible.

Long-term memory needs write rules, expiry rules and deletion rules. Decide what is worth remembering, for how long, who can read it and how to correct it before writing. Permanently vectorising every conversation is expensive and freezes mistakes.

↑ Back to contents

5 · Control loop: continuing, retrying and stopping all need limits

A healthy loop has at least four gates: maximum steps, maximum duration, maximum cost and maximum retries. Without limits, a loop keeps retrying when a tool fails repeatedly, or burns budget while the model “checks once more”.

Distinguish retryable from non-retryable failures. Network timeouts can be retried; invalid arguments, permission denials and missing objects usually should not. Write actions must be idempotent: repeating the same action must not create two emails, two payments or two records.

Stop conditions must be explicit: task done, limit reached, human approval needed, safety violation, or insufficient evidence. The most dangerous state is not “cannot do it” but “does not know it should stop”.

↑ Back to contents

6 · Evaluation: task, trajectory, tools and safety, not just the final sentence

Agent evaluation cannot look only at the final answer. Record at least: whether the task was completed, whether the steps were reasonable, whether tool calls were correct, whether permissions were exceeded, the cost, and whether it exited safely on failure. An agent with a plausible answer that read data it should not have read has not passed.

Start with a fixed task set: same tasks, same tools, same environment, same budget, repeated. Include normal, edge, failure and adversarial inputs. Testing only happy paths guarantees trouble on abnormal inputs after launch.

Run in shadow mode before launch: let the agent process real inputs without side effects and record what it would do. Compare with human results across four buckets — would do right, would do wrong, would exceed permission, would get stuck — then decide how much authority to grant.

Rule of thumb: if an evaluation reports only a success rate, without failure cases, permission violations and cost, it cannot support a launch decision.

↑ Back to contents

7 · Failure branches: make the system able to stop

Agent failures are often not a wrong sentence but a wrong action. Grade failure branches by side effect: read-only can retry, writes need check-then-compensate, irreversible actions need a human.

FailureFirst actionDo not
Tool errorClassify: retryable / notRetry blindly to the limit
Repeated loopStop, record the trace, return to the previous stepAdd more prompt text to make it “smarter”
Partial writeCheck real state, compensate or roll backAssume the first write failed
Prompt injectionSeparate content from instructions, reduce privilege, reviewTreat web content as system instructions
Runaway costTrigger the budget gate, stop and reportFinish first and count later

↑ Back to contents

8 · A minimum path to deployment

Start with one read-only, single-task, replayable process. After it is stable, add tools, write permissions and automation one at a time. Every added capability must rerun the same task set.

  • Write the task, input, output, done criteria and irreversible actions.
  • Connect one necessary tool; define arguments, returns, failures and idempotency.
  • Enforce permissions in the runtime, not in the prompt.
  • Record every step; make replay possible first.
  • Add four gates: steps, duration, cost, retries.
  • Test normal, edge, failure and adversarial inputs on a fixed task set.
  • Run in shadow mode; compare with human results and permission-violation rate.
  • Grant authority gradually; keep human approval and a stop button.
Four common mistakes: more agents are better; autonomy means no approval; memory means a vector database; a working demo means ready to ship.

↑ Back to contents

Sources and further reading

These links are for checking facts, licences and official scope. External pages may change; cite the original text and check date.

Next

If you get stuck while following it, go back to the matching route instead of rereading the whole guide.

← Back to home Spot an error? Send a correction