Four Hard Architectural Boundaries for Enterprise AI Agent Platforms
Enterprise AI agent platforms often fail not because models are not smart enough, but because the core data model is designed wrong. This article explains four architectural boundaries that keep an agent platform thick yet coherent: a single agent domain model instead of type enums, three isolated version tracks for editing, publishing, and execution, unidirectional layering with a zero-framework compile-time gate, and a five-level identity model with two aggregate roots for auditing and cost accounting. It also covers how governance and capability evolution follow from these boundaries rather than being bolted on afterward.
Building an enterprise agent platform carries a risk that has little to do with how capable the underlying models are. The bigger danger is getting the very first core table wrong.
A common approach is to add a type enum to the agent master table: Q&A, knowledge retrieval, deterministic workflow, multi-agent orchestration—and then build separate backends, permission models, and release pipelines for each type. It looks clean in a prototype. Two weeks of real business usage will prove the point: enterprise assistants are almost never a single type.
Consider a “production troubleshooting assistant.” An employee asks, “Why did the order service have hiccups last night?” The system must first search incident manuals and change records—that is retrieval. Then it invokes log and monitoring tools to pull exception stacks—that is tool calling. After finding a slow query, it spins up a database diagnostics sub-agent to investigate in parallel—that is multi-agent. Finally, it follows the change-approval workflow for scale-up or rollback—that is a deterministic workflow.
All four things happen within the same task, under the same identity, on the same audit trail. If they belong to four separate entities, permissions fracture into four systems, canary releases run independently, a change to one tool’s parameters must be synchronized in multiple places, and month-end cost accounting cannot be tied back to the same business request.
To make the platform thick without letting it descend into chaos, you need four hard boundaries:
- A single agent domain model
- Three non-interfering version tracks
- Unidirectional layering plus a zero-framework compile-time gate
- A five-level state identity model and a two-aggregate-root data foundation
The discussion below focuses on engineering trade-offs rather than feature checklists.
1. Reject type enums and establish a single domain model
A type enum essentially mistakes a “combination of capabilities” for a “species classification.” Once the species are separated, what is shared is no longer just one table—it is identity, quotas, auditing, publishing, and observability. A composite assistant gets sliced into multiple handoffs: the retrieval product returns a piece of text, a human pastes it into the workflow product, and the tool-calling step may run under a different service account. The troubleshooting conclusion can no longer be traced back to a single authorization.
The more robust modeling is: the platform has only one kind of agent. Differences live in capability assembly, not in a species field. An agent definition includes its goal and persona constraints, the knowledge scopes that can be mounted, the tool list it may call, the sub-agents it may delegate to, optional workflow nodes, and the policies that run through all of it (who can use it, when human confirmation is required, how failures degrade). A run lights up whichever of these capabilities it needs; unconfigured capabilities are simply empty sets, not a different product.
A minimal structure can look like this:
Agentid, tenant, name, policy_refcapabilities:knowledge_scopes[]tools[]delegates[] # sub-agents, still Agentsworkflow_ref? # nullable, not another entity typeruntime_binding # points to a published version, not a draft
Under this model, the “production troubleshooting assistant” is simply an agent with a rich assembly: knowledge scopes point to ops runbooks, tools point to controlled log and monitoring adapters, delegates point to the database diagnostics agent, and the workflow points to change approval. A pure Q&A assistant is just one whose knowledge, tools, delegates, and workflow are empty or minimal. The admin console can offer scenario-based templates, but when a template is expanded it must land on the same domain object. Templates are not a second master-data system.
A single model also solves cost attribution. Every model call, retrieval, and tool request is attached to the same run. At month end you aggregate by tenant, agent, version, and run—no reconciling four billing ledgers. Permissions likewise need to be interpreted only once: whether a principal can use this agent, whether it can use a particular tool, and whether a high-risk action requires approval. One interpreter, possibly many rules, but only one ledger.
The trade-off to accept: the domain layer gets thicker. Retrieval relevance, workflow state machines, and sub-agent concurrency must not each invent their own notion of a “session.” They are all steps within a run. Thick in the domain, thin at the entrance, is cheaper than thin in the schema and thick in after-the-fact patches.
2. Three version tracks that never interfere
The three things most easily conflated in an agent platform are: the definition being edited, the definition currently in effect, and a specific real execution. Merge them into a single “current configuration” table and editing pollutes production, rollback becomes impossible, and canary release cannot express “two immutable versions of the same agent serving traffic simultaneously.”
The three tracks should be physically or logically isolated, with one-way flow.
The editing track serves only authors. Drafts can be saved frequently and are allowed to be incomplete—for example, a tool has not yet had credentials bound, or a workflow node is missing an approver. Drafts are never read directly by production traffic.
The publishing track holds only immutable versions. When a draft is explicitly published, integrity checks run: do the knowledge scopes exist, are tool contracts closed, does delegation form cycles, and is every high-risk action bound to a confirmation policy? After validation, a version number is generated and the content is frozen. Fixes must ship as new versions; overwriting the body of an old version is forbidden. Rolling back after a production incident means pointing the binding back to an old version, not editing history in the database.
The runtime track records only which published version a given execution was bound to, plus how canary or experimental rules routed the request to that version. Runtime context, tool results, and human confirmations are all written to the runtime track and never written back to the publishing track. Otherwise a failed tool retry would modify the “definition,” and auditing would lose its meaning.
Canary release becomes simple: rules act on the agent-to-version binding, not on separate switches for retrieval, workflow, and Q&A. For example, 90% of one agent’s traffic goes to version 12 and 10% to version 13. A tool parameter change exists only in version 13’s immutable snapshot—there is nowhere else it needs to be synchronized. If a permission change is policy rather than capability, it should follow a policy version, still referenced by the same run, so that “capability version” and “who can use it” don’t end up with two misaligned timelines.
The cost of three tracks is that publishing is no longer a one-line config change. This friction is intentional: enterprise assistants can invoke production systems and initiate changes, so immutability and rollback matter more than “save means live.”
3. Six unidirectional layers and a zero-framework compile-time gate
Agent frameworks, retrieval components, workflow engines, and model gateways all iterate quickly. If domain objects directly depend on some framework’s session classes, annotations, or callbacks, replacing that framework six months later means rewriting the platform.
The zero-framework compile-time gate means: the core domain modules are forbidden, at compile time, from referencing concrete frameworks, specific model vendor SDKs, and concrete retrieval implementations. Dependencies point only downward, through ports and adapters.
The recommended six unidirectional layers:
- Access layer: conversation entry points, open APIs, identity pass-through. It only converts protocols; it does not decide how capabilities are combined.
- Orchestration layer: expands a request into a plan and steps—retrieve first, then call tools, when to delegate, when to enter workflow waiting. Orchestration depends on the domain model, not on framework-private objects.
- Capability layer: implementations of the four capability ports—retrieval, tools, delegation, workflow. Upward, they expose only a uniform step result: success, failure, needs-human, produced-sub-run.
- Policy layer: authorization, quotas, canary routing, confirmation, data masking. Orchestration asks policy before every side-effecting step; policy never calls back into orchestration, avoiding cycles.
- State layer: persistence for drafts, versions, runs, steps, and audit. It accepts only domain events or repository interfaces and does not understand any framework’s in-memory session.
- Infrastructure adapter layer: documents in object storage, log and monitoring queries, message queues, execution sandboxes in containers, model inference access. Only this layer may contain concrete protocols and SDKs.
The concrete test for unidirectionality: starting from a domain module, the dependency graph must not return to the access layer and must not enter infrastructure packages. This is enforced at build time through compilation boundaries—the domain package’s build script may depend only on itself and pure language-level abstractions, while adapter packages depend on domain ports in the reverse direction. That is the “compile gate”: not a manual pre-launch review checklist, but a build that fails when dependency direction is violated.
The troubleshooting assistant therefore never writes a “log-platform client” into the agent definition. The definition stores only a tool identifier and a parameter contract. The actual client lives in the adapter layer, subject to policy constraints on principal, environment, timeouts, and field masking. When the log query method changes, what gets published is an adapter plus a tool contract version—not a new kind of agent.
Six layers do not require six deployment units. A small team can implement them as package boundaries within a single process. What deserves separate processes are high-side-effect execution sandboxes and model inference—not splitting retrieval and workflow into two products that call each other just to make the architecture diagram look nicer.
4. Five-level state identity and two aggregate roots
When the books don’t reconcile, it is usually because the same business action has no stable primary key in the system. At minimum, fix five levels of identity—and never use display names as identifiers.
- Tenant identifier: divides data and quota boundaries.
- Agent identifier: represents the logical assistant, stable across versions; user authorization attaches here.
- Version identifier: represents an immutable definition.
- Run identifier: represents one task; cost, audit, and human confirmation all attach here.
- Step or trace identifier: identifies retrieval, tool, delegation, and workflow nodes inside a run, used for retry, idempotency, and debugging.
If the trace identifier flows from the access layer through the infrastructure layer, troubleshooting can align a model call, a retrieval hit, and an external API response to the same step—instead of to four log entries in four backends.
Identity should be layered, but aggregation roots must not proliferate. Two roots suffice.
The definition aggregate has the Agent as its root and internally contains drafts and published versions. A version is an entity, not another root. Deleting an agent is a business decision; deleting a version is generally allowed only if it has never been referenced by a run. The subject of permissions is always “which assistant,” never “which workflow table.”
The run aggregate has a single run as its root and internally contains steps, tool requests, sub-run references, pending confirmations, and usage details. When a sub-agent co-investigates, it creates a new run—but it must record the parent run and the delegating step, forming a tree rather than four disconnected conversations. Workflow approval waiting and resumption are run state transitions: suspended, confirmed, continued, cancelled. The approval system can remain external; the platform stores only the correlation ID and status, and does not promote the workflow engine’s internal tables to a third aggregate root.
Between the two roots, only identifiers are referenced: a run records the agent ID and version ID, and does not embed mutable fields beyond a copy of the definition for its own use. If a snapshot is needed for post-mortem analysis, the snapshot is a read-only attachment of the run aggregate and can never become an editable draft again.
Idempotency also lands on these two roots. Publishing the same draft twice must not produce two indistinguishable “latest” versions with identical content. Duplicate tool callbacks must be deduplicated by step identifier. Otherwise side effects like scale-up or rollback get executed twice—and the smarter the platform, the more dangerous that becomes.
5. Derive governance from these boundaries—don’t bolt concepts on top
Permissions, canary release, and cost are not three additional projects; they are projections of boundaries held firm.
Permissions answer only: can this principal start a run on this agent; is a given tool or workflow action allowed during the run; and must a human confirm it? Because there is only one kind of agent, the authorization UI does not need a separate role system for each of four products. Tool-level permissions are capability policy, not another “tool product” membership table.
Canary release acts only on version bindings. Capability changes and prompt/policy changes follow a version or an independent policy version, but there is only one routing table. It must never happen that “retrieval canary has switched but workflow canary hasn’t” while the system still claims to be the same assistant.
Cost aggregates on the run: model usage, retrieval counts, tool calls, and sub-run usage roll up to the parent run, then are billed by agent and tenant. If a sub-agent is reused by multiple parent agents, the details stay with the sub-run and are allocated at summary time by parent run or billed to the caller—the rule can be chosen, but the primary key cannot be missing. Calls without a run identifier should be treated as architectural defects, not as ignorable “internal debug” traffic.
The rollout order should also follow the boundaries:
- First merge master data: historical assistant types are mapped to different capability assemblies of the same aggregate; legacy entrances remain as templates.
- Freeze live configuration into versions; move editing to the draft track—even if the only action at first is “publish.”
- Give every conversation a run ID and step ID, and link the logs together. Get the books to reconcile before optimizing orchestration quality.
- Split the compile boundaries last, expelling concrete frameworks and external system clients from domain packages.
Do not start by rolling out a complex multi-agent canvas. A canvas is just one view of the editing track; without a single model and immutable versions, a canvas makes the chaos look prettier.
6. Evolving capabilities within the boundaries
A single model does not mean capabilities stay homogeneous forever. Retrieval can evolve from keywords to vectors and re-ranking. Tools can evolve from synchronous HTTP to long-running tasks with callbacks. Delegation can evolve from a fixed roster to role-based selection. Workflows can evolve from linear approval to branching state machines. These evolutions happen inside capability ports’ implementations and version snapshots.
The port’s result shape stays stable: output, error, whether a human is needed, whether a sub-run was produced, and how much usage was consumed. The orchestration layer depends only on that shape, so swapping the retrieval algorithm does not touch the permission model or the billing model.
Be equally clear about what not to do:
- Don’t pre-build four lifecycles just to “look complete.”
- Don’t give sub-agents their own independent tenant system.
- Don’t modify a published version mid-run to “hot-fix” a prompt.
- Don’t use a framework’s private session ID as the platform’s run identifier—replacing the framework would break the audit chain.
An enterprise platform’s competitiveness lies in safely combining retrieval, tools, collaboration, and workflow under the same identity, the same version, and the same run—not in piling more disconnected agent species into the back office.
Write these four boundaries into your review checklist: is a new capability still an assembly rather than a new species; does every change generate an immutable version; are dependencies unidirectional with the domain package independently compilable; and can every external call be traced back to a tenant, agent, version, run, and step. Hold these lines, and the platform will grow thicker—but it will not split into several irreconcilable systems three months from now.
