Technical article

The Yin and Yang of Agent Architecture

Attention and Productivity: A Decision Framework for LLM Agents

Author
Jordan Cruz-Tarazona
ORCID
0009-0003-5928-2137
Published
Version
1.0
DOI
10.5281/zenodo.24612775
License
CC BY-NC 4.0
Contents
  1. Abstract
  2. 1The problem
  3. 2The framework on one page
    1. 2.1Three levels
    2. 2.2Decision path
  4. 3Vocabulary
  5. 4Need level
  6. 5Agent level: the two families
    1. 5.1Family criterion
    2. 5.2What changes between families
    3. 5.3Design principles
  7. 6Attention agents: how they are built
    1. 6.1Invariant
    2. 6.2What is prescribed is the process, not the conversation
    3. 6.3Integration patterns
    4. 6.4Complementary pattern: Rail
    5. 6.5Antipattern: rules in the prompt
    6. 6.6Antipattern: God agent
    7. 6.7Selection
    8. 6.8Activation variants
    9. 6.9Forces between In-process and Service-backed
  8. 7Productivity agents: a map of what already exists
    1. 7.1Patterns by degree of delegation
    2. 7.2Opening mechanisms
    3. 7.3Text for preferences, code for limits
  9. 8Product level
    1. 8.1Three types
    2. 8.2The router
    3. 8.3Composition rules
    4. 8.4Protocols
  10. 9Application
    1. 9.1Needs of an organization
    2. 9.2The three levels in two cases
  11. 10Related work
  12. 11Conclusions
  13. 12References
  14. How to cite

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.

3 PRODUCTHow it is composedStandalone · Composite · Mixed composite
2 AGENTWhich family it belongs toAttention · Productivity
1 NEEDWhether an agent is neededConventional software · Model call · Agent
Figure 1. The three levels of the framework.

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

  1. 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.
  2. Which family does it belong to? The family criterion answers it. See Section 5.
  3. Which pattern is it built with? Attention patterns are in Section 6 and productivity patterns in Section 7.
  4. How is it packaged? As a single agent or as several in one product. See Section 8.

3. Vocabulary

Table 1. Vocabulary of the framework.
TermMeaning in this framework
ModelAn LLM or a decision model
Decision modelA model that picks an answer from a closed set and returns its probability. It does not generate text
HarnessThe code around the model: loop, tools, context, permissions
ToolA function the harness exposes to the model through tool calling
Conventional softwareCode with no LLM and no decision model
Model callA call to a model with defined input and output. Code decides what happens before and after
AgentHarness plus model, where the model decides which tool to use and when
GoalWhat the agent must achieve. It fixes its prompt and its tools
NeedA piece of work the organization requires, with a result
ResultWhat ends up done: an answer, a charge, a rejection, a record, a report
RulesWhat decides whether a result is valid
Rule ownerWhoever can change them
LimitsWhat the agent can touch: data, systems, actions
DomainThe part of the system that holds the entities and the business rules. It accepts or rejects each operation
ApprovedSigned off by the organization before the agent uses it: a flow, a source or an operation
VerifierWhat checks an agent’s work before it is accepted: tests or a person’s review
ProductWhat is delivered to the user. It packages one or more agents
RouterThe 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.

Table 2. The three options at the need level.
OptionWho decides the stepsWhat the model doesExample
Conventional softwareCodeThere is no modelRestocking inventory at a reorder point
Model callCodeInterprets an input and returns a defined outputExtracting the fields of an invoice. Classifying an email
AgentThe modelDecides which tool to use and whenScheduling 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.

Table 3. The two forms of a model call.
FormWhat it returnsWhat it is for
LLM callText or data the LLM generatesExtracting, summarizing, drafting
Decision modelAn answer from a closed set, with its probabilityClassifying, 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.

Table 4. The family criterion in ten cases.
CaseWho receives the resultWho sets the rulesFamily
RefundThe customerThe companyAttention
Vacation requestThe employeeThe companyAttention
Rejected résuméThe candidateThe companyAttention
Outbound prospectingThe prospectThe companyAttention
Financial closeThe company before auditor and tax authorityThe accounting standardAttention
Character or tutor defined by a companyThe userThe companyAttention
Code changeThe developerThe developerProductivity
Market reportThe analystThe analystProductivity
Sorted inboxThe owner of the inboxThe owner of the inboxProductivity
Conversation character created by its userThe userThe userProductivity

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

Figure 2. The two families are opposite and complement each other. Each one carries a dot of the other.
Table 5. Differences between the two families.
AttentionProductivity
Whom the agent representsThe organizationWhoever delegates the work
What the user writesUntrusted inputLegitimate instruction
Where rules are enforcedIn codeIn the judgment of whoever delegates
CapabilitiesClosed at design timeOpen at run time
Weight of the harnessLight: operational tasks under a prescribed flowHeavy: general purpose, with multiple capabilities
Who answers for itThe organizationWhoever delegates
Main riskGranting what should not be grantedBad work that nobody detects
What is designed firstThe domainThe 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.

Table 6. Responsibility of each piece in an attention agent.
PieceWhat it does
ModelConverses and decides which tool to call
ToolTurns the arguments into a command, invokes the domain and returns the result or the error as text the model can use
DomainAccepts 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.

Table 7. Three meanings of “flow” and the owner of each.
FlowOwnerClassic precedent
Life cycle of the entityThe domainDomain-Driven Design
Process across several operationsThe applicationProcess Manager [19]
Order in which data is requestedThe adapterApplication Controller [20]

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. Agent only references Application. 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.

Table 8. The two types of rail.
Stochastic railDeterministic rail
Who decidesA separate model, with a closed answerA state machine
What it is forRules that require interpreting language, such as R3Processes where a forbidden effect is not acceptable
What it costsOne more call to a model for each decisionDesigning the process as states and transitions
What it guaranteesIt bounds the error. It does not eliminate it, because a model decidesNo 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:

  1. The model does not write state. A tool executes nothing and returns no state. It builds a list of intents.
  2. The rail accepts the whole list or rejects the whole list. If it rejects it, nothing changes and the model receives the reason.
  3. The process advances on evidence. Requesting a booking does not change the stage. The result of having executed it does.
  4. 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.
  5. 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.

Table 9. Rule inventory.
Where it is enforcedWhich rule goes thereExample
DomainThe one that validates an entityR1 and R2
Deterministic railThe one that decides whether the process changes stateA meeting is not confirmed without the result of having scheduled it
Stochastic railThe one that requires interpreting language before a changeR3
Human acceptanceThe one none of the above can guaranteeAn 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

  1. Each rule is assigned a place in the inventory of Section 6.4.
  2. Does any tool write? No: Query.
  3. Does the service exist, or will there be another channel? Yes: Service-backed.
  4. 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.

Table 10. Forces between In-process and Service-backed.
ForceIn-processService-backed
Latency per turnLowAdds a network hop for each tool call
TransactionA tool can group several operations in one unit of workNeeds compensation
PrivilegesThe boundary depends on discipline and architecture testsThe agent only has client permissions
ErrorsThe tool returns the domain error as isNetwork codes must be translated into useful text
ReuseOnly this channelAny 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

Table 11. Productivity patterns by degree of delegation.
PatternWho decides the next stepScopeMain source
CopilotThe person. The agent proposesOne stepWidespread practice
WorkflowCodeOne procedure[2]
Function agentThe modelOne event[27], as ambient agent
Long-horizon agentThe modelOne goal[2], as agent

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.

Table 12. Opening mechanisms.
ConceptWhat it opens at run time
MCPTools
SubagentsWorkers
SkillsProcedures
Browsing and searchSources
Instruction filesRules

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

Table 13. Types of product.
TypeWhat it containsExample
StandaloneOne agentA coding assistant
CompositeSeveral agents of the same familyA bank’s assistant, with inquiries, cards and loans
Mixed compositeAgents of both familiesAn 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.

Table 14. Three agents of a company and their family.
AgentFamily
VacationAttention
ExpensesAttention
DocumentsProductivity

The company decides how to deliver them.

Table 15. Two ways of delivering the same agents.
DecisionResulting products
All three in a single assistantOne mixed composite
Vacation and expenses in one assistant, and documents separatelyOne 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.

Table 16. Subagents versus agents of a product.
SituationWhat it is for the productExample
One agent splits a single request among subagentsOne agent. The product is standaloneA coding assistant that sends a subagent to investigate while it writes the code
Each request is handled by a different agentSeveral agents. The product is compositeThe 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.

Table 17. Who can fill the router role.
Who fills the roleHow the agent is chosenWhen it worksExample
A menuThe person picks from a listThere are few options and they are clearButtons for “Inquiries” and “Complaints”
A fixed ruleCode chooses based on a piece of data it already knowsThe destination depends on the channel or the type of userWhoever writes from the employee channel goes to the internal assistant
A classifierA model reads a message and assigns it to an agent from a list. It cannot askThe request arrives complete: an email, a form, a ticketAn email arrives at support. The classifier sends it to the complaints agent
An agentIt converses with the person and hands off the request when it belongs to another agentA chatA 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

  1. Whoever routes does not execute operations. It hands them off to the right agent.
  2. 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.
  3. Context does not cross families as an instruction. What passes is the identity and a structured request.
  4. 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.
  5. 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].

Table 18. The criterion applied to twenty-one needs of an organization.
AreaNeedWho receives the resultSets the rules?What is needed
StrategyCompetitor reportManagementYesProductivity, Long-horizon
ProductsWriting and fixing codeThe teamYesProductivity
SalesQuoting a prospect who writes inThe prospectNoAttention
SalesOutbound prospectingThe prospectNoAttention
MarketingDrafting a campaignMarketingYesProductivity
DeliveryRestocking inventory at a reorder pointNot applicableNot applicableConventional software
DeliveryOptimizing delivery routesNot applicableNot applicableConventional software
ServiceScheduling an appointmentThe customerNoAttention
ServiceProcessing a refundThe customerNoAttention
ServiceAnswering frequently asked questionsThe customerNoAttention, Query
ServiceSuggesting replies to the operatorThe operatorYesProductivity, Copilot
PeopleVacation requestThe employeeNoAttention
PeopleRanking résumés for the recruiterThe recruiterYesProductivity
PeopleDiscarding résumés without reviewThe candidateNoAttention
TechnologyResetting a passwordThe employeeNoAttention
TechnologyTriage of security alertsThe analystYesProductivity, Function agent
FinanceRecording a supplier invoiceNot applicableNot applicableModel call inside a flow in code
FinanceFinancial closeThe company before auditor and tax authorityNoAttention
ComplianceReviewing a contract against policyThe lawyerYesProductivity
ComplianceBlocking a suspicious transactionNot applicableNot applicableModel call (decision model) inside a flow in code
External relationsNegotiating terms with a supplierThe supplierNoAttention

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?

Table 19. Claude Code, need level.
NeedWho decides the stepsOption
Fixing a bug in a repositoryThe model. The steps are not known in advanceAgent
Formatting the code after each editCode. It is always the same stepConventional 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.

Table 20. Claude Code, design principles.
PrincipleHow it shows in this agent
Text for preferences, code for guaranteesPreferences go in instruction files. Limits go in hooks and permissions
Open capabilitiesIt adds tools through MCP, skills and subagents while it runs
ResponsibilityIt 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?

Table 21. Clinic, need level.
NeedWho decides the stepsOption
Reminding the patient of the appointment one day beforeCodeConventional software
Reading the data of an order the patient sends as a photoCode. The model interpretsModel call
Answering about hours, locations and coverageThe modelAgent
Scheduling, moving or canceling an appointmentThe modelAgent
Analyzing for management why appointments get canceledThe modelAgent

Of five needs, three call for an agent.

Level 2. Agent. Are the rules set by whoever receives the result?

Table 22. Clinic, agent level.
AgentWho receives the resultSets the rules?Family and pattern
InquiriesThe patientNoAttention, Query
SchedulingThe patientNoAttention, Service-backed if scheduling already exists as a service
Cancellation analysisManagementYesProductivity, 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.

Table 23. Clinic, product level.
ProductWhat it containsType
Patient assistantThe inquiries agent and the scheduling agent. The inquiries agent fills the router roleComposite
Management analystOne agentStandalone

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.

Table 24. Pieces of the framework that appear in other sources.
PieceSource
Workflows versus agentsAnthropic [2]
The model understands and business logic runs in codeRasa CALM [14]
A mix of deterministic execution and model reasoningSalesforce [15], Decagon [16], Intercom [17]
Deciding among closed answers as a model capability in its own rightJev [11], OpenAI [12], Google [13]
Agents activated by eventsLangChain [27]
Customer agents versus employee agents, as a market segmentGoogle [37], identity providers [38]
Principal and agent applied to AI agents, from a legal perspectiveKolt [39]
Personal agent versus brand, from an identity perspectivePACT [35]
Where the model goes in a hexagonal architectureSeveral blogs, each with a different position [40]–[42]
Business logic in the interface as a valid path only in simple projectsEvans [43]

What this framework contributes:

Table 25. Contributions of the framework.
ContributionWhat it includesSection
Family criterionA 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 needed3, 5 and 9.1
Three levelsThe separation into need, agent and product, with the question answered at each level and the mistakes of answering it at another2 and 9.2
Building attention agentsAn 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 agent6
Filter for new conceptsIf a concept opens capabilities at run time, it serves productivity and not attention7.2
Product and compositionThree 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 built8

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.

  1. 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
  2. Anthropic. Building effective agents. December 19, 2024. https://www.anthropic.com/engineering/building-effective-agents
  3. Microsoft. AI agent orchestration patterns. Azure Architecture Center. https://learn.microsoft.com/azure/architecture/ai-ml/guide/ai-agent-design-patterns
  4. 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
  5. AWS. Agentic AI patterns and workflows on AWS. AWS Prescriptive Guidance. https://docs.aws.amazon.com/prescriptive-guidance/latest/agentic-ai-patterns/introduction.html
  6. 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
  7. 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
  8. 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
  9. Kasirzadeh, A. and Gabriel, I. Characterizing AI Agents for Alignment and Governance. arXiv:2504.21848, 2025. https://arxiv.org/abs/2504.21848
  10. Anthropic. Building agents with the Claude Agent SDK. September 29, 2025. https://claude.com/resources/articles/building-agents-with-the-claude-agent-sdk
  11. 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
  12. OpenAI. Decisions. API guide. https://developers.openai.com/api/docs/guides/decisions
  13. Google. Gemini Decisions API: Fast, calibrated multimodal decisions. November 11, 2026. https://blog.google/innovation-and-ai/technology/developers-tools/gemini-decisions-api/
  14. 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
  15. 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
  16. Decagon. Why Decagon built Agent Operating Procedures. April 8, 2025. https://decagon.ai/resources/why-we-built-aop
  17. Intercom. Fin Procedures: Building AI Agents for Multi-Step Business Workflows. March 12, 2026. https://fin.ai/learn/fin-procedures-guide
  18. 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/
  19. Hohpe, G. and Woolf, B. Process Manager. In Enterprise Integration Patterns. Addison-Wesley, 2003. https://www.enterpriseintegrationpatterns.com/ProcessManager.html
  20. Fowler, M. Application Controller. In Patterns of Enterprise Application Architecture. Addison-Wesley, 2002. https://martinfowler.com/eaaCatalog/applicationController.html
  21. Newman, S. Backends For Frontends. November 18, 2015. https://samnewman.io/patterns/architectural/bff/
  22. 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
  23. 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
  24. 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
  25. 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
  26. 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
  27. LangChain. Introducing ambient agents. January 14, 2025. https://www.langchain.com/blog/introducing-ambient-agents
  28. Anthropic. How we built our multi-agent research system. June 13, 2025. https://www.anthropic.com/engineering/multi-agent-research-system
  29. Agentic AI Foundation. AGENTS.md: A simple, open format for guiding coding agents. https://agents.md/
  30. OpenAI. Codex CLI, Apache 2.0 license. https://github.com/openai/codex
  31. Anthropic. Automate actions with hooks. Claude Code documentation. https://code.claude.com/docs/en/hooks-guide
  32. Anthropic. Code execution with MCP: Building more efficient agents. November 4, 2025. https://www.anthropic.com/engineering/code-execution-with-mcp
  33. A2A Project. Agent2Agent (A2A) Protocol Specification, version 1.0. https://a2a-protocol.org/v1.0.1/specification/
  34. 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
  35. PACT. Specification, version 1.0. https://openpactprotocol.org/spec
  36. APQC. Process Classification Framework (PCF), Cross-Industry, version 8.0. 2026. https://www.apqc.org/pcf-pdf
  37. 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/
  38. Okta. The Future of AI Security: The Right Architecture for Agents. March 13, 2026. https://www.okta.com/blog/ai/future-ai-security-agents/
  39. Kolt, N. Governing AI Agents. arXiv:2501.07913, 2025. https://arxiv.org/abs/2501.07913
  40. 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
  41. Dinacode. Hexagonal Architecture Applied to AI Agents. April 17, 2026. https://www.dinacode.com/en/blog/hexagonal-architecture-ai-agents
  42. 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
  43. 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}
}