Technical article
The Yin and Yang of Agent Architecture
Attention and Productivity: A Decision Framework for LLM Agents
Contents
Abstract
Components for agents are published every day (models, tools, retrieval, protocols, memory), along with patterns for coordinating agents with each other. Very little is published about a prior question: what kind of agent is needed and how it integrates with the rest of the system.
This framework answers that question with a classification criterion and the design principles that derive from it. It distinguishes two families of agents, attention (as in attending to a request) and productivity, and separates them with one question: are the rules set by whoever receives the result? What is a serious defect in one family is the correct practice in the other. They are opposite and they complement each other: a single product may need both. The framework decides at three levels that do not mix: need, agent and product.
The productivity family already has abundant literature. The attention family has almost none outside closed platforms, which is why this article develops it in more detail.
Keywords: LLM agents, software architecture, design patterns, business rules, attention agents, productivity agents.
1. The problem
Classic software has architecture styles with names and literature: monolith, modular monolith, microservices, event-driven. Whoever designs picks one knowing what it gains and what it costs [1].
For agents, the following exist:
- Internal flow patterns. Anthropic separates workflows, where the path is in code, from agents, where the model directs its own process [2].
- Coordination patterns between agents. Azure, Google and AWS catalog sequential, parallel, handoff, loop and variants [3]–[5].
- Internal design catalogs. Data61 gathers 18 architectural patterns for the inside of an agent [6].
- Descriptions along other axes. Forms of application [7], cognitive function by execution topology [8], and autonomy, efficacy, goal complexity and generality [9].
None of those sources says how the agent integrates with the domain of a business. Nor do they say when a piece of advice applies and when it does not.
The practical effect is that contradictory advice circulates. “Write the rules in an instructions file” is correct for a coding assistant. It is a defect for an agent that approves refunds. Without a prior classification there is no way to know which of the two cases is at hand.
2. The framework on one page
2.1 Three levels
Decisions go from the bottom up. First the need, then the agent and finally the product.
The order is one of decision, not of size. A product contains agents, but its type is defined by them: it cannot be known whether it is a mixed composite before knowing the family of each agent. The idea of a product may exist from the start. Its composition is decided at the end.
Each question is answered at its level. The most common mistake is answering it at another.
- “Which family is this product?” is the wrong question. The family is decided at the agent level. A product can contain agents of both families.
- So is “does this product need agents?”. That is decided at the need level. The same product solves some needs with conventional software and others with an agent.
- The harness and the platform are not levels. They are the material an agent is built with and they do not define its family. The same harness builds a coding assistant or a support agent [10].
2.2 Decision path
- Is an agent needed? If code can decide every step, conventional software is enough. If all that is missing is interpreting an input, a model call suffices. See Section 4.
- Which family does it belong to? The family criterion answers it. See Section 5.
- Which pattern is it built with? Attention patterns are in Section 6 and productivity patterns in Section 7.
- How is it packaged? As a single agent or as several in one product. See Section 8.
3. Vocabulary
| Term | Meaning in this framework |
|---|---|
| Model | An LLM or a decision model |
| Decision model | A model that picks an answer from a closed set and returns its probability. It does not generate text |
| Harness | The code around the model: loop, tools, context, permissions |
| Tool | A function the harness exposes to the model through tool calling |
| Conventional software | Code with no LLM and no decision model |
| Model call | A call to a model with defined input and output. Code decides what happens before and after |
| Agent | Harness plus model, where the model decides which tool to use and when |
| Goal | What the agent must achieve. It fixes its prompt and its tools |
| Need | A piece of work the organization requires, with a result |
| Result | What ends up done: an answer, a charge, a rejection, a record, a report |
| Rules | What decides whether a result is valid |
| Rule owner | Whoever can change them |
| Limits | What the agent can touch: data, systems, actions |
| Domain | The part of the system that holds the entities and the business rules. It accepts or rejects each operation |
| Approved | Signed off by the organization before the agent uses it: a flow, a source or an operation |
| Verifier | What checks an agent’s work before it is accepted: tests or a person’s review |
| Product | What is delivered to the user. It packages one or more agents |
| Router | The role of deciding which agent handles a request |
The difference between rules and limits is necessary. An internal search tool imposes permissions the employee cannot change, and that is a limit. What counts as a good answer is decided by the employee, and that is the rule.
4. Need level
Before choosing a family, it must be confirmed that an agent is needed. The question is who decides the steps.
| Option | Who decides the steps | What the model does | Example |
|---|---|---|---|
| Conventional software | Code | There is no model | Restocking inventory at a reorder point |
| Model call | Code | Interprets an input and returns a defined output | Extracting the fields of an invoice. Classifying an email |
| Agent | The model | Decides which tool to use and when | Scheduling an appointment. Fixing a bug |
All three options involve code. An agent is a model plus its harness, and the harness is code. What changes from one option to another is whether there is a model and who decides the steps.
A model call comes in two forms.
| Form | What it returns | What it is for |
|---|---|---|
| LLM call | Text or data the LLM generates | Extracting, summarizing, drafting |
| Decision model | An answer from a closed set, with its probability | Classifying, checking a condition, scoring |
An LLM can also choose among closed options. The decision model is built only for that [11]–[13].
Three clarifications:
- Validating business rules is conventional software. An agent does not change that.
- A chatbot is not an agent just because it converses. If code retrieves the documents and the model only writes the answer, it is a sequence of model calls. It becomes an agent when the model decides what to look up or which operation to request.
- Several model calls chained by code are still model calls. It is what Anthropic calls a workflow [2].
5. Agent level: the two families
5.1 Family criterion
Are the rules set by whoever receives the result?
- Yes: productivity.
- No: attention.
The criterion applies to a need. The need fixes the result and who receives it. What the agent reads or reviews is material, not a rule. If whoever receives the result changes, it is a different need and the criterion is applied again.
Each family in one sentence:
- Attention. The agent applies rules that whoever receives the result cannot change.
- Productivity. The agent works for the rule owner.
The name of each family is a label. What defines it is the criterion. Attention is used here in the sense of attending to a request, not in the sense of the attention mechanism of language models.
| Case | Who receives the result | Who sets the rules | Family |
|---|---|---|---|
| Refund | The customer | The company | Attention |
| Vacation request | The employee | The company | Attention |
| Rejected résumé | The candidate | The company | Attention |
| Outbound prospecting | The prospect | The company | Attention |
| Financial close | The company before auditor and tax authority | The accounting standard | Attention |
| Character or tutor defined by a company | The user | The company | Attention |
| Code change | The developer | The developer | Productivity |
| Market report | The analyst | The analyst | Productivity |
| Sorted inbox | The owner of the inbox | The owner of the inbox | Productivity |
| Conversation character created by its user | The user | The user | Productivity |
The criterion does not depend on three things:
- The audience. The employee who requests vacation is internal and is still served by an attention agent.
- Whether someone converses. The rejected candidate never talks to the agent.
- The line of business. Sales, education, companionship and entertainment are uses, not families. Each use has agents of both. A character the user defines for themselves works for the rule owner. A tutor defined by an institution evaluates what the student submits with rules the student cannot change.
5.2 What changes between families
Dark half
Attention
- Represents the organization
- Rules enforced in code
- Capabilities closed at design time
- The domain is designed first
Light dot inside the dark halfThe conversation is not prescribed
Light half
Productivity
- Represents whoever delegates
- Rules enforced by the delegator's judgment
- Capabilities open at run time
- The verifier is designed first
Dark dot inside the light halfHard limits live in code
| Attention | Productivity | |
|---|---|---|
| Whom the agent represents | The organization | Whoever delegates the work |
| What the user writes | Untrusted input | Legitimate instruction |
| Where rules are enforced | In code | In the judgment of whoever delegates |
| Capabilities | Closed at design time | Open at run time |
| Weight of the harness | Light: operational tasks under a prescribed flow | Heavy: general purpose, with multiple capabilities |
| Who answers for it | The organization | Whoever delegates |
| Main risk | Granting what should not be granted | Bad work that nobody detects |
| What is designed first | The domain | The verifier |
5.3 Design principles
All five derive from the family criterion.
1. One agent, one family. If an agent serves both, it is two agents. In a single context, the user’s text cannot be treated as an instruction and as untrusted input at the same time.
2. Text for preferences, code for guarantees. In attention, every rule that can be written as code is enforced in code, and the process follows an approved flow. In productivity, text serves the preferences of whoever delegates and hard limits go in code. The principle is about where the rule is enforced, not about how it is written. Several platforms write procedures in natural language and run them with validations in code [14]–[17].
3. Closed or open capabilities. An attention agent does not discover tools while it runs. Its set of operations is approved. A productivity agent can add tools, sources and subagents at run time.
4. Responsibility. In attention, the organization is accountable. A Canadian tribunal held Air Canada responsible for the wrong information its chatbot gave [18]. In productivity, whoever delegates is accountable, and configures the agent as they wish.
5. Human acceptance. If no mechanism can enforce a rule, its owner accepts the result before it takes effect. If whoever accepts is whoever receives the result, it is a different need and the agent is a productivity agent. If someone in the organization accepts within the process, the agent remains an attention agent. Ranking résumés for a recruiter to decide is productivity. Discarding them without review is attention. An exception approved by a supervisor before answering the customer is still attention.
6. Attention agents: how they are built
This section uses one fixed example: scheduling a meeting with a specialist. It has three rules.
- R1. No meeting is scheduled without an available specialist.
- R2. A meeting requires a reason and a contact.
- R3. An urgent reason gets priority.
R1 and R2 can be written as code. R3 cannot, because “urgent” requires interpreting language.
6.1 Invariant
Neither the model nor the tool validates business rules. The domain validates.
| Piece | What it does |
|---|---|
| Model | Converses and decides which tool to call |
| Tool | Turns the arguments into a command, invokes the domain and returns the result or the error as text the model can use |
| Domain | Accepts or rejects |
A business condition written in the prompt or in the tool’s code is a defect.
The prompt may repeat a rule as a hint to save turns. It cannot be the only place where the rule exists.
The identity of whoever is asking comes from the authenticated session and not from a tool argument.
Check. Delete the prompt. The agent may lose efficiency: it asks more than needed or attempts operations the domain rejects. What cannot happen is that an invalid meeting gets recorded. If it does, the rule lived in the prompt.
6.2 What is prescribed is the process, not the conversation
“Flow” names three things with different owners.
A web wizard is the third kind. The agent replaces the wizard, not the domain. The domain exposes preconditions (what is missing to schedule), not steps. A shortened process for one channel is legitimate if it only changes the third flow [21].
If the order of the conversation is also fixed, the result is the dialog tree that breaks when the user goes off script [14].
6.3 Integration patterns
There are three. What separates them is where the tool ends.
Query
The agent only reads. The model decides what to look up and with which tool.
Agent/ harness, prompt, read-only tools
Knowledge/ index of approved documents (RAG), files, read API
- Typical tools.
search_knowledge_base(query),read_document(id),check_status(id). - Distinctive trait. No tool writes.
- Choose it when the need is to inform.
- Do not choose it when the user needs something to get done.
- Caution. What the agent states commits the organization. Sources must be approved and the answer must be traceable to one of them.
Without lookup tools there is no Query pattern. There is a chatbot, which according to Section 4 is not an agent.
In-process
A single deployment unit. The agent layer takes the place of the presentation layer. Tools invoke use cases through method calls.
Solution/
Domain/ entities, R1 and R2
Application/ ScheduleMeeting, CheckAvailability
Infrastructure/ persistence
Agent/ harness, prompt, tools
- Distinctive trait. A tool call does not cross a process boundary.
- Dependency rule.
Agentonly referencesApplication. It is verified with an architecture test. - Choose it when there is one channel, one team and a new domain.
- Do not choose it when the domain is already exposed as a service or there will be another consumer.
Service-backed
The agent is a separate deployment unit. Each tool is a client of a service that works without the agent.
Agent/ harness, prompt, tools, SchedulingClient
SchedulingService/
Domain/ entities, R1 and R2
Application/ ScheduleMeeting, CheckAvailability
API/ contracts
- Distinctive trait. Each tool crosses the network to a service with its own contract.
- Choose it when the domain already exists, there are other channels, or the domain and the agent change at different paces.
- Do not choose it when it forces the creation of a service that only the agent will consume.
- Migration. If In-process respected the dependency rule, moving to Service-backed means replacing the body of each tool with a network client. The prompt does not change.
Common walkthrough. The model calls schedule_meeting(date, specialist, reason, contact). The domain rejects because of R1. The tool returns NO_AVAILABILITY. Free: 10:00, 15:30. The model offers those times. The model cannot tell whether the domain was in the same process or behind an API.
6.4 Complementary pattern: Rail
The model that converses proposes. A rail decides. It is a component added to In-process or to Service-backed. It is not a fourth integration pattern and it is not a type of product.
There are two types.
| Stochastic rail | Deterministic rail | |
|---|---|---|
| Who decides | A separate model, with a closed answer | A state machine |
| What it is for | Rules that require interpreting language, such as R3 | Processes where a forbidden effect is not acceptable |
| What it costs | One more call to a model for each decision | Designing the process as states and transitions |
| What it guarantees | It bounds the error. It does not eliminate it, because a model decides | No forbidden effect reaches the system. Deterministic code prevents it, not a model |
Stochastic rail
What it is. An interface the application defines to ask the model a single question with a fixed number of answers. The model answers with one value from a closed list. Code decides what that value triggers.
Domain/ Urgency { HIGH, NORMAL, UNDETERMINED }
Application/ ScheduleMeeting uses IUrgencyClassifier
Infrastructure/ UrgencyClassifier, which is a model call
- Direction of the call. In the integration patterns, the model calls the application. Here the application calls the model.
- Distinctive trait. The model judges and never acts through this path. With R3, it classifies the reason and the use case applies the priority.
- Escape value. The list includes an option such as
UNDETERMINED. Code decides what to do with it, for example routing to a person. - What it is built with. With an LLM call or with a decision model.
- Cost. Each rail of this type adds a call to a model. With an LLM call it is best reserved for critical points. A decision model responds faster [11]–[13] and costs less [11][13], so it can be used at more points.
- Limit. Whether an LLM or a decision model, it is still a model. Attacks against decision models used as guardrails have already been published [22]. The guarantee comes from the deterministic rail.
Deterministic rail
The usual approach in a transactional agent is to write the process rules in the prompt and trust the model to obey them. The deterministic rail removes that trust. The model converses and proposes. A state machine decides. The change in the system is issued by the machine, not by the model or the tool.
Model converses and proposes
Tool reads and builds a list of intents. It does not write
Rail state machine. Accepts or rejects the list
Executor writes to the business system and returns the result to the rail
It rests on five ideas:
- The model does not write state. A tool executes nothing and returns no state. It builds a list of intents.
- The rail accepts the whole list or rejects the whole list. If it rejects it, nothing changes and the model receives the reason.
- The process advances on evidence. Requesting a booking does not change the stage. The result of having executed it does.
- Every piece of data has provenance. The rail evaluates each intent before accepting it. A piece of data the customer must provide only counts if it arrived in a customer turn. If the contact for the meeting did not arrive that way, the rail rejects the list even if it is complete: the model may have invented it or taken it from a tool result.
- The message about a critical effect is not written by the model. In a transition marked as critical, the rail issues the message with a predefined text. The model does not assert an effect that did not happen.
The design of the deterministic rail is developed in a follow-up article.
Rule inventory
Every rule of the system appears in a list that says where it is enforced.
| Where it is enforced | Which rule goes there | Example |
|---|---|---|
| Domain | The one that validates an entity | R1 and R2 |
| Deterministic rail | The one that decides whether the process changes state | A meeting is not confirmed without the result of having scheduled it |
| Stochastic rail | The one that requires interpreting language before a change | R3 |
| Human acceptance | The one none of the above can guarantee | An exception approved by a supervisor |
With the inventory complete, no business rule is left in the prompt. A rule without a row is a defect: it exists only as text. It is fixed by assigning it one of the four.
6.5 Antipattern: rules in the prompt
Definition. A business rule exists only as text in the prompt.
Symptoms.
- The prompt says “never”, “always” or “only if” about business data.
- Tools read and write with no possible rejection.
- Two identical runs leave different states.
Evidence. A rule that exists only in the prompt fails in two ways, and both have been measured.
- The model gets confused. In the τ-bench benchmark the agent receives the domain policies as text along with API tools. With that setup, in the original 2024 measurement, GPT-4o solved fewer than half of the tasks and its consistency over eight repetitions fell below 25% in the retail domain [23]. The figure changes with each model and the argument does not depend on it: a failure rate above zero is not a guarantee. Another evaluation, on six models, found that placing an instruction in the system prompt does not ensure it prevails over what the user writes [24].
- The model gets attacked. A 2025 study tested twelve published defenses against prompt injection and jailbreak with attacks adapted to each one, and bypassed most of them with a success rate above 90% [25]. The United Kingdom’s National Cyber Security Centre warns that the problem may never be fully mitigated, because an LLM does not separate instructions from data, and recommends deterministic safeguards outside the model [26].
How to fix it. Each rule written in the prompt is taken out of it and assigned one of the four places of the inventory in Section 6.4: domain, deterministic rail, stochastic rail or human acceptance.
6.6 Antipattern: God agent
Definition. A single agent that performs every function: it informs, it operates and it also works for the user.
Why it fails. Each goal needs its own prompt and its own tools. Together, the prompt becomes a list of cases, and the agent holds tools it does not need for what it is doing at that moment.
Symptoms.
- The prompt says “if the user wants this, do that” for many unrelated cases.
- The same agent has tools to look up documents, to change data and to do open-ended work.
- It handles requests from both families. That already breaks principle 1.
How to fix it. One agent per goal. If they must be delivered together, they are combined in a composite product, as Section 8 describes.
What it is not. An agent that covers several domains is not a God agent. An In-process agent can span several bounded contexts if they all serve the same goal. That decision belongs to whoever designs the solution.
6.7 Selection
- Each rule is assigned a place in the inventory of Section 6.4.
- Does any tool write? No: Query.
- Does the service exist, or will there be another channel? Yes: Service-backed.
- One channel, one team, a new domain? In-process, with the dependency rule.
6.8 Activation variants
- Event-driven. An email arrives in which a customer asks to change an appointment and nobody converses live. It is still attention and it is built the same way: the model decides which tool to use and the domain accepts or rejects. Two things change. There is no session, so the state of the case lives in the system and not in the conversation. And what to do when a piece of data is missing is defined by the domain rules: reply asking for it, leave the case pending, reject it or route it to a person.
- Outbound. The agent initiates the contact. Whoever receives it cannot change prices or conditions. It is still attention.
- Retries. A redelivered event can produce a different decision from the model. Protection against duplicates goes in the effect, with an idempotency key per event, and not in the model.
6.9 Forces between In-process and Service-backed
What is gained and what is paid with each one.
| Force | In-process | Service-backed |
|---|---|---|
| Latency per turn | Low | Adds a network hop for each tool call |
| Transaction | A tool can group several operations in one unit of work | Needs compensation |
| Privileges | The boundary depends on discipline and architecture tests | The agent only has client permissions |
| Errors | The tool returns the domain error as is | Network codes must be translated into useful text |
| Reuse | Only this channel | Any channel |
7. Productivity agents: a map of what already exists
This family has literature. The framework only puts it in order.
7.1 Patterns by degree of delegation
Notes:
- Workflow. Strictly speaking it is not an agent, because code decides the steps [2]. It appears here because it is the real alternative to the other three.
- Function agent. It stays idle until an event activates it. It handles that event and ends. It is defined by its scope, not by its activation. In attention, event-driven activation is a variant because it does not change the integration pattern (Section 6.8).
- Swarm. It is a variant of Long-horizon: a lead agent creates subagents at run time, tries paths and gathers results. Anthropic calls it orchestrator-worker [28]. It needs a criterion for choosing among paths. Without one it only multiplies the cost.
- Operator. It acts on screens instead of APIs. More than a separate pattern, it is a surface that any of the four can use when there is no API.
- Verifier. The degree of delegation is chosen by the quality of the verifier. Without tests or review, Copilot or Workflow. With them, Function agent or Long-horizon.
7.2 Opening mechanisms
Almost every concept promoted today opens capabilities at run time. By principle 3 they belong to this family.
| Concept | What it opens at run time |
|---|---|
| MCP | Tools |
| Subagents | Workers |
| Skills | Procedures |
| Browsing and search | Sources |
| Instruction files | Rules |
Filter for any new concept: does it open capabilities at run time? If the answer is yes, it serves productivity and not attention.
7.3 Text for preferences, code for limits
Instruction files are the normal channel for the rules of whoever delegates [29]. The reason is that those rules change per project and whoever builds the harness cannot know them. The mechanism is the same in closed harnesses and in open-source harnesses [29][30].
The vendors themselves acknowledge that text is not a guarantee. That is why deterministic mechanisms exist for what must always happen [31].
8. Product level
No agents are designed at this level. What is decided is how they are delivered: which ones go together in one product. Each agent arrives here with its family and its pattern already decided.
8.1 Three types
| Type | What it contains | Example |
|---|---|---|
| Standalone | One agent | A coding assistant |
| Composite | Several agents of the same family | A bank’s assistant, with inquiries, cards and loans |
| Mixed composite | Agents of both families | An internal assistant, with vacation, expenses and documents |
The type describes the composition, not the size. A standalone product can be enormous.
The same agent can go in different products.
A company has three agents for its employees.
| Agent | Family |
|---|---|
| Vacation | Attention |
| Expenses | Attention |
| Documents | Productivity |
The company decides how to deliver them.
| Decision | Resulting products |
|---|---|
| All three in a single assistant | One mixed composite |
| Vacation and expenses in one assistant, and documents separately | One composite and one standalone |
The agents are the same in both cases. What changed is the product.
Subagents do not count.
Some agents split their work. The person makes a request, the agent divides it, and other agents solve each part. Those are called subagents. The lead agent puts the parts together and delivers a single result.
That is internal orchestration. The person never talks to a subagent and never picks one. For the product there is a single agent.
| Situation | What it is for the product | Example |
|---|---|---|
| One agent splits a single request among subagents | One agent. The product is standalone | A coding assistant that sends a subagent to investigate while it writes the code |
| Each request is handled by a different agent | Several agents. The product is composite | The bank’s assistant. An inquiry goes to one agent and a card block goes to another |
8.2 The router
When a product has several agents, something has to decide which one handles each request. That is routing.
Router is not an agent pattern and it is not a family. It is a role. Any of these four pieces can fill it.
| Who fills the role | How the agent is chosen | When it works | Example |
|---|---|---|---|
| A menu | The person picks from a list | There are few options and they are clear | Buttons for “Inquiries” and “Complaints” |
| A fixed rule | Code chooses based on a piece of data it already knows | The destination depends on the channel or the type of user | Whoever writes from the employee channel goes to the internal assistant |
| A classifier | A model reads a message and assigns it to an agent from a list. It cannot ask | The request arrives complete: an email, a form, a ticket | An email arrives at support. The classifier sends it to the complaints agent |
| An agent | It converses with the person and hands off the request when it belongs to another agent | A chat | A bank’s inquiries agent answers about requirements and rates. When the customer asks to block a card, it hands off to the cards agent |
A classifier cannot ask. It receives a message and answers once. If the message is not enough to decide, it returns “undetermined” and code sends it to a default destination, for example a person.
The classifier can be a decision model or an LLM call. Which one fits is decided by whoever designs the solution. It is the same mechanism as the stochastic rail of Section 6.4, and it is what Anthropic describes as routing [2].
When the role is filled by an agent, that agent is Query.
- Its tools only read. That is why it cannot operate. When something must be executed, it hands off.
- Handing off is not writing. It hands the conversation to another agent and changes nothing in a business system.
- It can be an agent dedicated to choosing or the product’s own inquiries agent. In the second case it also resolves business topics. That decision belongs to whoever designs the solution.
Three things hold for all four pieces.
- Handoffs only go to the agents on a fixed list.
- After the handoff, whoever routed does not take part. The person converses directly with the other agent.
- It steps in again when the request changes and belongs to another agent.
8.3 Composition rules
- Whoever routes does not execute operations. It hands them off to the right agent.
- An attention agent hands off and does not nest. An attention agent follows a prescribed process and nests nothing outside that process. If the request belongs to an agent of the other family, it hands it off. The attention agent talks directly to whoever receives the result.
- Context does not cross families as an instruction. What passes is the identity and a structured request.
- Every call between agents is classified with the family criterion from the side of the callee. A personal assistant that asks a company’s agent for something is treated like any other requester. Responsibility for that assistant lies with whoever configured it.
- A productivity agent does not trigger transactions on its own. It queries data, investigates and produces. For that work it can nest subagents, but the process of a transaction lives outside it. When its work requires a change in a system with business rules, it asks through the same door as any requester: an attention agent or the layer that enforces the rules. It has no direct access to a transactional interface. An API that accepts any data in the right format is an interface of that kind. It is the other half of rule 4. That way, if the router picks it by mistake, what does not belong gets rejected.
Rule 3 deals with the crossing between families and only applies to a mixed composite. Rule 2 applies to every attention agent and rule 5 to every productivity agent.
8.4 Protocols
- MCP. It serves productivity, where whoever delegates adds third-party systems without touching the harness. It has a context cost that its own author documents [32]. In attention, what is forbidden is opening capabilities at run time: discovering tools while the agent runs contradicts principle 3. With the list of tools and their descriptions fixed at design time, MCP remains as transport and adds nothing over a direct client. An attention agent can still expose a port to outside agents.
- A2A. It covers one agent calling another. Version 1.0 is published [33]. It does not carry the identity of the person on whose behalf the action is taken [34]. There are proposals that fill that gap [35]. What those protocols do not define is how the agent that receives the call must be built. Rules 4 and 5 cover that.
9. Application
9.1 Needs of an organization
The areas come from APQC’s process framework, a neutral catalog used to compare companies in any line of business [36].
| Area | Need | Who receives the result | Sets the rules? | What is needed |
|---|---|---|---|---|
| Strategy | Competitor report | Management | Yes | Productivity, Long-horizon |
| Products | Writing and fixing code | The team | Yes | Productivity |
| Sales | Quoting a prospect who writes in | The prospect | No | Attention |
| Sales | Outbound prospecting | The prospect | No | Attention |
| Marketing | Drafting a campaign | Marketing | Yes | Productivity |
| Delivery | Restocking inventory at a reorder point | Not applicable | Not applicable | Conventional software |
| Delivery | Optimizing delivery routes | Not applicable | Not applicable | Conventional software |
| Service | Scheduling an appointment | The customer | No | Attention |
| Service | Processing a refund | The customer | No | Attention |
| Service | Answering frequently asked questions | The customer | No | Attention, Query |
| Service | Suggesting replies to the operator | The operator | Yes | Productivity, Copilot |
| People | Vacation request | The employee | No | Attention |
| People | Ranking résumés for the recruiter | The recruiter | Yes | Productivity |
| People | Discarding résumés without review | The candidate | No | Attention |
| Technology | Resetting a password | The employee | No | Attention |
| Technology | Triage of security alerts | The analyst | Yes | Productivity, Function agent |
| Finance | Recording a supplier invoice | Not applicable | Not applicable | Model call inside a flow in code |
| Finance | Financial close | The company before auditor and tax authority | No | Attention |
| Compliance | Reviewing a contract against policy | The lawyer | Yes | Productivity |
| Compliance | Blocking a suspicious transaction | Not applicable | Not applicable | Model call (decision model) inside a flow in code |
| External relations | Negotiating terms with a supplier | The supplier | No | Attention |
A general internal assistant is not a need. It is a product that brings together several of these rows: a mixed composite.
What the table shows:
- Four of the twenty-one needs are solved without an agent.
- None required a third family.
- Evaluating résumés appears twice and in different families. If the agent ranks them and the recruiter decides, it is productivity. If the agent discards them without review, it is attention. What changes is who receives the result. It is principle 5.
- Negotiating is attention with no extra components. The floor, the ceiling and the target are in the domain. The model does not know the floor or the ceiling. The model chooses the moves and the domain validates each offer.
9.2 The three levels in two cases
They are walked through from the bottom up, as in Section 2.1. Each level answers its question.
Case 1. A product that already exists: Claude Code
Level 1. Need. Who decides the steps?
| Need | Who decides the steps | Option |
|---|---|---|
| Fixing a bug in a repository | The model. The steps are not known in advance | Agent |
| Formatting the code after each edit | Code. It is always the same step | Conventional software, with a hook [31] |
Level 2. Agent. Are the rules set by whoever receives the result?
Yes. The developer receives the change and defines what “done” means. It is productivity, with the Long-horizon pattern. Its verifier is the tests.
| Principle | How it shows in this agent |
|---|---|
| Text for preferences, code for guarantees | Preferences go in instruction files. Limits go in hooks and permissions |
| Open capabilities | It adds tools through MCP, skills and subagents while it runs |
| Responsibility | It lies with the developer who configures it |
Level 3. Product. How many agents does it contain and of which families?
It contains one. It is a standalone product and needs no routing. Its subagents are internal orchestration.
Three level mistakes the walkthrough avoids.
- “It is multi-agent.” That confuses the internal orchestration of an agent with the composition of a product.
- “It is attention, because the company imposes policies on it.” Those policies are limits, not rules. They say what the agent can touch. They do not say what good code is.
- “The SDK is for productivity.” The harness does not define the family. The same one builds a support agent [10].
Case 2. A design from scratch: a clinic
Level 1. Need. Who decides the steps?
| Need | Who decides the steps | Option |
|---|---|---|
| Reminding the patient of the appointment one day before | Code | Conventional software |
| Reading the data of an order the patient sends as a photo | Code. The model interprets | Model call |
| Answering about hours, locations and coverage | The model | Agent |
| Scheduling, moving or canceling an appointment | The model | Agent |
| Analyzing for management why appointments get canceled | The model | Agent |
Of five needs, three call for an agent.
Level 2. Agent. Are the rules set by whoever receives the result?
| Agent | Who receives the result | Sets the rules? | Family and pattern |
|---|---|---|---|
| Inquiries | The patient | No | Attention, Query |
| Scheduling | The patient | No | Attention, Service-backed if scheduling already exists as a service |
| Cancellation analysis | Management | Yes | Productivity, Long-horizon |
The rules of the scheduling agent are assigned using the inventory of Section 6.4.
Level 3. Product. How many agents does it contain and of which families?
The result is two products, not one.
| Product | What it contains | Type |
|---|---|---|
| Patient assistant | The inquiries agent and the scheduling agent. The inquiries agent fills the router role | Composite |
| Management analyst | One agent | Standalone |
The reminder and the reading of the order live inside the patient assistant and are not agents.
There is no reason to join the two products. They serve different people, and joining them would produce a mixed composite that brings the cross-family rules of Section 8.3 into play.
10. Related work
Other sources reach pieces of this framework by different paths.
| Piece | Source |
|---|---|
| Workflows versus agents | Anthropic [2] |
| The model understands and business logic runs in code | Rasa CALM [14] |
| A mix of deterministic execution and model reasoning | Salesforce [15], Decagon [16], Intercom [17] |
| Deciding among closed answers as a model capability in its own right | Jev [11], OpenAI [12], Google [13] |
| Agents activated by events | LangChain [27] |
| Customer agents versus employee agents, as a market segment | Google [37], identity providers [38] |
| Principal and agent applied to AI agents, from a legal perspective | Kolt [39] |
| Personal agent versus brand, from an identity perspective | PACT [35] |
| Where the model goes in a hexagonal architecture | Several blogs, each with a different position [40]–[42] |
| Business logic in the interface as a valid path only in simple projects | Evans [43] |
What this framework contributes:
| Contribution | What it includes | Section |
|---|---|---|
| Family criterion | A single criterion that separates the two families by who sets the rules. It does not depend on the audience, on whether someone converses or on the line of business. It comes with the difference between rules and limits, needed to apply it, and five design principles that explain why the same practice is correct in one family and a defect in the other. Applied to twenty-one needs of an organization, no third family was needed | 3, 5 and 9.1 |
| Three levels | The separation into need, agent and product, with the question answered at each level and the mistakes of answering it at another | 2 and 9.2 |
| Building attention agents | An invariant and a check to verify it: delete the prompt. Three patterns for integrating with one’s own domain, outside a platform: Query, In-process and Service-backed, each with its layer blueprint, its distinctive trait and its forces. The rail as a complementary pattern, in two types: the deterministic one takes away from the model the decision to change state. The rule inventory, with four places where a rule is enforced, none of which is the prompt. Two antipatterns with their symptoms and their fix: rules in the prompt and God agent | 6 |
| Filter for new concepts | If a concept opens capabilities at run time, it serves productivity and not attention | 7.2 |
| Product and composition | Three types of product by their composition, the router defined as a role and five composition rules. Two of them cover what protocols between agents do not define: how the agent that receives the call is built | 8 |
11. Conclusions
The framework starts from one question: are the rules set by whoever receives the result? The answer separates two families of agents and explains why the same practice is correct in one and a defect in the other.
The decision is made at three levels. At the need level, it is confirmed whether an agent is needed. At the agent level, the family is chosen and, with it, the construction pattern. At the product level, it is decided how the already defined agents are delivered.
For the attention family, the article sets an invariant (the domain validates, not the model or the tool), three integration patterns, the rail as a complementary pattern and an inventory that assigns each rule to a place where it is enforced. For the productivity family, it orders the existing patterns by degree of delegation.
The work that follows is the deterministic rail, which will have its own article.
12. References
Links were accessed on November 27, 2026.
- Richards, M. and Ford, N. Fundamentals of Software Architecture. O’Reilly, 2020. Part II, “Architecture Styles”. https://www.oreilly.com/library/view/fundamentals-of-software/9781492043447/part02.html
- Anthropic. Building effective agents. December 19, 2024. https://www.anthropic.com/engineering/building-effective-agents
- Microsoft. AI agent orchestration patterns. Azure Architecture Center. https://learn.microsoft.com/azure/architecture/ai-ml/guide/ai-agent-design-patterns
- Google Cloud. Choose a design pattern for your agentic AI system. Cloud Architecture Center. https://docs.cloud.google.com/architecture/choose-design-pattern-agentic-ai-system
- AWS. Agentic AI patterns and workflows on AWS. AWS Prescriptive Guidance. https://docs.aws.amazon.com/prescriptive-guidance/latest/agentic-ai-patterns/introduction.html
- Liu, Y. et al. Agent Design Pattern Catalogue: A Collection of Architectural Patterns for Foundation Model based Agents. arXiv:2405.10467, 2024. https://arxiv.org/abs/2405.10467
- Weber, I. Forms of LLM-Integrated Applications from LLM-Chats to Autonomous AI Agent Systems. arXiv:2610.11899, 2026. https://arxiv.org/abs/2610.11899
- Huang, J. and Zhou, J. T. A Two-Dimensional Framework for AI Agent Design Patterns: Cognitive Function × Execution Topology. arXiv:2605.13850, 2026. https://arxiv.org/abs/2605.13850
- Kasirzadeh, A. and Gabriel, I. Characterizing AI Agents for Alignment and Governance. arXiv:2504.21848, 2025. https://arxiv.org/abs/2504.21848
- Anthropic. Building agents with the Claude Agent SDK. September 29, 2025. https://claude.com/resources/articles/building-agents-with-the-claude-agent-sdk
- DeepLearning.AI. Models Built to Do One Thing Well (on Jev, by TypeSafe). The Batch, September 25, 2026. https://www.deeplearning.ai/the-batch/models-built-to-do-one-thing-well
- OpenAI. Decisions. API guide. https://developers.openai.com/api/docs/guides/decisions
- Google. Gemini Decisions API: Fast, calibrated multimodal decisions. November 11, 2026. https://blog.google/innovation-and-ai/technology/developers-tools/gemini-decisions-api/
- Rasa. CALM. Rasa documentation. https://rasa.com/docs/learn/concepts/calm/ See also Bocklisch, T., Werkmeister, T., Varshneya, D. and Nichol, A. Task-Oriented Dialogue with In-Context Learning. arXiv:2402.12234, 2024. https://arxiv.org/abs/2402.12234
- Salesforce. Hybrid Reasoning with New Agentforce Builder and Agent Script. Salesforce Architects. https://architect.salesforce.com/docs/architect/fundamentals/guide/hybrid-reasoning-agentforce-builder-agent-script
- Decagon. Why Decagon built Agent Operating Procedures. April 8, 2025. https://decagon.ai/resources/why-we-built-aop
- Intercom. Fin Procedures: Building AI Agents for Multi-Step Business Workflows. March 12, 2026. https://fin.ai/learn/fin-procedures-guide
- Moffatt v. Air Canada, 2024 BCCRT 149. Summary by the American Bar Association, February 2024. https://www.americanbar.org/groups/business_law/resources/business-law-today/2024-february/bc-tribunal-confirms-companies-remain-liable-information-provided-ai-chatbot/
- Hohpe, G. and Woolf, B. Process Manager. In Enterprise Integration Patterns. Addison-Wesley, 2003. https://www.enterpriseintegrationpatterns.com/ProcessManager.html
- Fowler, M. Application Controller. In Patterns of Enterprise Application Architecture. Addison-Wesley, 2002. https://martinfowler.com/eaaCatalog/applicationController.html
- Newman, S. Backends For Frontends. November 18, 2015. https://samnewman.io/patterns/architectural/bff/
- Azizi, S., Baghaei Potraghloo, E. and Pedram, M. One Word Opens the Gate: The Option-Channel Attack on Typed Decision Models as Agent Guardrails. arXiv:2610.12292, 2026. https://arxiv.org/abs/2610.12292
- Yao, S. et al. τ-bench: A Benchmark for Tool-Agent-User Interaction in Real-World Domains. arXiv:2406.12045, 2024. https://arxiv.org/abs/2406.12045
- Geng, Y. et al. Control Illusion: The Failure of Instruction Hierarchies in Large Language Models. AAAI-26. arXiv:2502.15851, 2025. https://arxiv.org/abs/2502.15851
- Nasr, M., Carlini, N., Sitawarin, C. et al. The Attacker Moves Second: Stronger Adaptive Attacks Bypass Defenses Against LLM Jailbreaks and Prompt Injections. arXiv:2510.09023, 2025. https://arxiv.org/abs/2510.09023
- Chismon, D. Prompt injection is not SQL injection (it may be worse). National Cyber Security Centre (United Kingdom), December 8, 2025. https://www.ncsc.gov.uk/blog-post/prompt-injection-is-not-sql-injection
- LangChain. Introducing ambient agents. January 14, 2025. https://www.langchain.com/blog/introducing-ambient-agents
- Anthropic. How we built our multi-agent research system. June 13, 2025. https://www.anthropic.com/engineering/multi-agent-research-system
- Agentic AI Foundation. AGENTS.md: A simple, open format for guiding coding agents. https://agents.md/
- OpenAI. Codex CLI, Apache 2.0 license. https://github.com/openai/codex
- Anthropic. Automate actions with hooks. Claude Code documentation. https://code.claude.com/docs/en/hooks-guide
- Anthropic. Code execution with MCP: Building more efficient agents. November 4, 2025. https://www.anthropic.com/engineering/code-execution-with-mcp
- A2A Project. Agent2Agent (A2A) Protocol Specification, version 1.0. https://a2a-protocol.org/v1.0.1/specification/
- Boston Identity. A2A 1.0 connects agents across companies and leaves out the person they act for. May 28, 2026. https://insights.bostonidentity.com/research/a2a-protocol-2026-05-28-a2a-protocol
- PACT. Specification, version 1.0. https://openpactprotocol.org/spec
- APQC. Process Classification Framework (PCF), Cross-Industry, version 8.0. 2026. https://www.apqc.org/pcf-pdf
- Google. Customers are putting Gemini to work (six types of agents). September 24, 2024. https://blog.google/products/google-cloud/gemini-at-work-ai-agents/
- Okta. The Future of AI Security: The Right Architecture for Agents. March 13, 2026. https://www.okta.com/blog/ai/future-ai-security-agents/
- Kolt, N. Governing AI Agents. arXiv:2501.07913, 2025. https://arxiv.org/abs/2501.07913
- Ciodaro, G. Why AI makes architectural patterns more important. Recall Space, October 20, 2026. https://www.recall.space/blog/why-ai-makes-architectural-patterns-more-important
- Dinacode. Hexagonal Architecture Applied to AI Agents. April 17, 2026. https://www.dinacode.com/en/blog/hexagonal-architecture-ai-agents
- Oliphant, J. Hexagonal Agents: What If Your App’s Business Logic Was an AI Agent? March 18, 2026. https://anoliphantneverforgets.com/notes/2026-03-18-hexagonal-agents
- Evans, E. Domain-Driven Design: Tackling Complexity in the Heart of Software. Addison-Wesley, 2003. Chapter 4, “Smart UI”.
How to cite
Citation
Cruz-Tarazona, J. (2026). The Yin and Yang of Agent Architecture: Attention and Productivity: A Decision Framework for LLM Agents (Version 1.0). Zenodo. https://doi.org/10.5281/zenodo.24612775
BibTeX
@misc{cruztarazona2026yinyang,
author = {Cruz-Tarazona, Jordan},
title = {The Yin and Yang of Agent Architecture: Attention and Productivity: A Decision Framework for LLM Agents},
year = {2026},
month = nov,
version = {1.0},
publisher = {Zenodo},
doi = {10.5281/zenodo.24612775},
url = {https://doi.org/10.5281/zenodo.24612775},
note = {CC BY-NC 4.0}
}