The model is not the agent: the layers you still need

Picking the model is the visible 20%. The rest is tools, state, permissions, evaluation, and operations.

Illustration: The model is not the agent: the layers you still need

Besides the model, an application that acts reliably needs actions with a clear contract, a place to store how far the task has got, permissions, a place where the code runs, a way to check whether it came out right, and someone who answers when it fails. The model thinks. The rest is the system. If you only hire the engine, you do not have the car.

It is easy and flashy to stand up a demo: you pick a model, you give it a bit of context, and the answers come out coherent. The people in the room applaud. The following week the copilot calls your system, stops halfway, and nobody knows how many times it retried, which actions it tried before giving up, or what it decided while trying to answer the question. That is the point. The model is the visible part. The rest is the system around it.

A large language model predicts the next piece of text. An agent is an application that uses that model to decide and act: it calls actions, stores how far it has got, and works on one customer's account in your SaaS. Google Cloud draws it like this: the model is the engine that reasons, and around it there are actions, memory, the program that runs the agent, and the place where the code runs. If you only hire the engine, you do not have the car.

Anthropic puts it more dryly. The basic piece is not the model alone, but the model plus search, actions, and memory. They also warn you to start simple. A fixed path is often enough. An agent that decides on its own gets more expensive and fails in a chain if the actions are badly built.

This is the map. It is not the detail of permissions, and it is not the comparison between a shared plug and your own connection. It is knowing which layers exist, what they are for, and which ones you can leave for later without lying to yourself.

What the demo hides

The demo is a chat and one action that comes out right: the person writes, the model asks for the ticket, a summary comes out, and the meeting ends.

What you do not see is which program calls your system, what happens if that call fails twice, which customer's account stores the summary, whether the next step resends a huge amount of text, and who gets up at night if the loop does not stop. It is the same jump we already covered: a demo is not an agent.

The commercial trick is to sell the model as if it were the product. You hear "we put a copilot in", and the reality is a thin layer on top of Claude or Codex. The committee hears a novelty. The team that operates the product hears a gap: the contract of the actions, state, customer separation, a record, and a person in charge. The model does not fill that gap. You can change provider and still have the same hole.

Three things the demo hides, and that a trial with a real customer cannot hide:

  1. The action. The model proposes and the action runs. If the action exists, the risk exists.

  2. Time. A chat message dies when you close the tab. An agent leaves leftovers: memory, half-finished tickets, and money spent on the model.

  3. The neighbor. A SaaS has more than one customer. The demo usually has one.

If you cannot name those three, you do not have an agent in production yet. You have a conversation connected to a system.

A map of the layers

An agent architecture is the list of pieces that turn a model into something that acts, without improvising the system every week. It is not a library and it is not a slide about "orchestration". It is this, from what you see in the demo to what saves you when it fails.

Layer

What it does

If it is missing

1. Model

Thinks and chooses the next step. It does not authorize, it does not store, and it does not retry safely on its own.

You have a chat, not a system.

2. Actions and contracts

The doors into your product: what can be called, with which data, and on which resource.

The agent talks and does not resolve.

3. State, context, and memory

Three different things. Mixing them is how the "it remembered" is born, and later you cannot delete it.

You do not know what happened in this task or what was stored.

4. Permissions

Who the agent is, which customer's account it is, and what it may do. We unpacked that in identity, permissions, and limits.

The rest of the map is theater.

5. A closed space, and execution

Where the code runs and what it can touch: network, disk, your systems, and how long.

The error eats the product.

6. Checking and the record

How you know whether the task came out right, and how you reconstruct it.

"It worked in the demo" is your only proof.

7. What to do if it fails, and who answers

Retries with a cap, and the name of whoever answers for that agent on that customer account.

The process is left without an owner.

Google Cloud splits the drawing into model, actions, memory, and two programs: the one that runs the agent and the one that runs the model. That helps. We put the program and the closed space together, and we separate state from memory, because in a SaaS that confusion costs an incident.

You do not need to stand up all seven on day one. You do need to know which ones you are leaving out on purpose. A trial that "leaves permissions for later" is not leaving them. It is waiting for the first customer that is not yours.

Actions and contracts

An action is a door into your system, built so an agent can use it. Without actions, an assistant can only answer with what it already carries inside. With actions it can resolve. With actions on your own system is when you offer AI features to your customers.

The contract is what you can review afterwards: the name, what it does, on which resource, with which data, and with which cap. "Search this customer's help articles, maximum 5, without the raw HTML" is a contract. "Query the database" is not. Anthropic spends an appendix on this and says that, on SWE-bench, they spent more time polishing the actions than the instructions: the format, the full paths, and how easy it is to get them wrong. They treat the door between the agent and the tool with the same care as a screen for a person.

How you expose that action is a contract decision, not a fashion. A shared plug (MCP, the Model Context Protocol) helps when you want the same connector across several agents and several servers. A door of your own helps when that action already exists in the product as a stable verb, create a ticket or read an order, and you want the same data to produce the same effect, without the model inventing the path. A command line helps on someone's machine or in a scheduled job. We do not choose here. We require that, whatever you choose, the model does not see a free menu.

Three rules of the map, not of how you program it:

  • A closed list. If it is not on the list for that flow, it does not exist.

  • Narrow data. The identifier of a ticket on that customer's account, not a free query to the database or any web address.

  • A cap. Rows, amount, number of calls. A loop with no cap is an invoice and a risk.

If the demo opened administrator access "so it would look good", the demo is not ready. The model is not the problem. The menu is.

State, context, and memory are not the same

These three words get used as if they were the same, and they are not. If the team does not tell them apart, the trial mixes "what happened in this task" with "what the model read" and with "what we stored for next month".

State is what the system knows about this task right now: which ticket, which customer, which step it is on, what the last action returned, and whether it is waiting for a person. It lives outside the instructions. A record can read it and a switch can delete it. If the state only exists in the chat, you do not have state. You have a thread.

Context is what you put into this question: instructions, the list of actions, the latest messages, and the piece of document you cut. You pay for it, and you pay again on the next step. It is not memory. It is the briefcase for this trip. If you inflate it just in case, you pay on every step, and you can also mix customers if the cut is vague.

Memory is what remains between one task and the next: a summary of preferences, an index of articles, a fact the customer already settled. It has to be split by customer and it has to be forgettable. A shared memory where customer B's contract shows up in customer A's answer is not ready. It is a leak.

The typical failure is to store "memory" by pasting the whole thread into the next question and calling it state. You cannot revoke that, you cannot review it, and you cannot say which part belonged to which customer. The model "remembered" because you told it the secret again.

In the trial, explicit state (identifiers, step, result) is worth more than elegant memory. Memory gets added when there is something worth remembering and a place to separate it by customer.

Where the code runs, and what it must not touch

The closed space is the enclosure. Execution is the fact of running code or an action inside it. Together they answer where this runs and what it must not touch.

The model does not run your server. It runs, or it fires, a program. That program has a network or it does not, it can write to disk or it cannot, it can go out to the internet or only to your systems, and it has a maximum time and a service account. Google Cloud calls that the agent's program, distinct from the model's program. The distinction matters: you can change model and still have a process that calls anywhere.

The demo usually runs on the presenter's laptop, or in a notebook with the environment's keys. The trial runs next to customer data. If the agent can execute code, the enclosure is not a security extra. It is the difference between "it proposed a program" and "it wrote to that customer's disk".

Three questions that fit in a short meeting:

  1. Does this agent go out to the internet, or only to a list of allowed sites?

  2. Can it write, or only read?

  3. How long, and how many calls, does it last before it stops?

If the answer is "the model already knows it must not", there is no enclosure. There is a wish. Anthropic recommends testing agents that decide on their own in bounded environments, because the error accumulates. The enclosure is the place where that error does not eat the product.

How you know it came out right, and how you reconstruct it

Checking is how you decide whether the task was acceptable. The record is the trail for reconstructing it. Without both, "it worked in the demo" is your only proof.

Text that reads well is not a check. The agent may have called the wrong action, mixed another customer's data, and still written a clean paragraph. You do not see that in the chat. You see it in the record: which action, which data, which decision, and which version of the instructions and of the model.

On the map, this layer asks for the minimum so you are not flying blind.

A definition of "correct" per case: the ticket was resolved, the result has the expected shape, a person did not have to rewrite it.

A record joined by a task identifier, tying the person, the agent, the customer, and the actions.

The ability to see the failure again. If you cannot look at it again, you cannot fix it.

You do not need a test lab on day one. You do need not to throw the trail away. A record that joins two customers' data in the same file is not visibility. It is another leak. If you cannot recount the task, you cannot operate the agent.

What happens when it fails, and who answers

Recovery is what happens when the action fails, the model invents an identifier, or the task stops halfway. The owner is the name of the person who answers for that agent on that customer account.

Without recovery, the agent retries with no cap or stops in silence, and both exits are bad. A serious task has a maximum time, a maximum number of retries, and a rule so the same request does not run twice.

Without an owner, the agent is an orphan process. When an alert fires, the question will be whether this belongs to platform, to product, or to the model provider. If there is no owner, there is no switch with permission. There is a debate.

The owner is not a twelve-box org chart. It is a sentence someone can say out loud: this support copilot, on the trial account, is operated by Marta. If it has to be switched off, Marta switches it off. The model does not operate. People do.

In the trial, name the owner before you open memory. What has no owner does not need more layers. It needs someone responsible.

How to sequence this in a trial

Do not build the whole map to impress. Build what avoids the first incident and what lets you measure. Date the rest.

Day one, or there is no trial. Actions with a contract and a closed list, the customer on every call, a switch, and an owner. Without that you are in the demo with a real customer.

The next two weeks. Explicit state: identifiers, step, and last result. A person in the middle only where the failure is expensive to undo, as in permissions. A record with a task identifier. A cost cap and a call cap.

Later, if the case holds. Memory separated by customer. A check that lets you drop to a smaller model without guessing. A tighter enclosure, with no network and no disk, if the agent executes code. The shared plug or an extra door, when the contract already exists and repeating it hurts.

Before you open the second customer's account, the team should be able to answer yes to this.

Is the model separate from the program that runs it, and can you change it without rewriting the actions?

Does every action have a contract, a closed list, and a cap, or does the model choose from the whole system?

Do state, context, and memory have an owner and a place, or does everything live in the instructions?

Does the agent have an identity and a customer account, or does it reuse María's session?

Do you know where it runs and what it must not touch?

Can you reconstruct the last task that went wrong?

Is there a name that switches this off today?

If two or more are missing, you do not have an agent architecture. You have a model with accessories. The instructions can be good, but they are not the system.

Once those lines exist, the rest is engineering. At Devic those layers, the actions, the rules, the record, and the program that runs, are operated in the system around the model. The model changes. The contract does not. The plans are there to measure one case on one customer account before you pretend the map is complete.

The model that convinces in the demo speaks well. The agent that holds up in a SaaS has layers.

Alberto Iglesias

CEO

Turn your SaaS AI-Native

Get a free trial just by signing up


Ready to turn your platform AI-Native?

Centralize agents, tools, and flows in one platform and start scaling with less friction.

Build and run agents without friction

Connect your current infrastructure

  • Devic AI

  • Devic AI

  • Devic AI

Ready to turn your platform AI-Native?

Centralize agents, tools, and flows in one platform and start scaling with less friction.

Build and run agents without friction

Connect your current infrastructure

  • Devic AI

  • Devic AI

  • Devic AI