Enterprise AI Agents: A Layered Architecture for Execution Runtime and Application Governance
This article explains why a working AI agent execution kernel is not enough for enterprise delivery, and how separating the execution runtime from an application governance layer solves the problem. It breaks down the responsibilities of each layer, outlines the failure modes of relying only on a runtime or building everything in-house, and presents a three-layer target architecture with clear interface contracts. Key design points cover visual orchestration, retrieval-augmented generation, observability, document- and field-level permissions, and cost and version governance, followed by a phased rollout plan and common pitfalls to avoid.
1. Background: Why “It Runs” Is Not the Same as “It Ships”
When teams deploy agent applications inside an enterprise, one debate keeps resurfacing: if you already have an agent execution kernel with tool-calling and trajectory replay, do you still need a separate application orchestration and governance platform? Reduced to engineering terms, the question conflates two distinct layers of capability. One layer is concerned with how a model runs safely and calls external resources; the other is concerned with how business users configure, use, audit, and continuously iterate on applications.
The root cause of stalled pilots is rarely model capability. It is blurred ownership. Prompts live scattered across personal machines and ad hoc scripts, knowledge updates depend on one engineer’s memory, and when something breaks, there is no way to trace which document the model read or which tool it called. The conclusion of this article is clear: these two layers are not substitutes. They are meant to be layered together.
2. Dividing Responsibilities: What Each Layer Actually Solves
2.1 Execution Kernel: Making Agents Able to Act
The execution kernel is developer-facing. It is essentially an agent runtime, and its typical responsibilities include:
- Model invocation and inference orchestration, with multi-turn context management;
- Tool execution, covering file read/write, command-line invocation, and sandbox isolation;
- Execution trajectory logging and replay, to pinpoint the failing step;
- Resource and concurrency control, so long-running tasks do not overwhelm the host environment.
It answers one question: how does an agent run safely and call external capabilities in a controlled way?
2.2 Application Governance Layer: Making the Enterprise Willing to Use It
The application governance layer is oriented toward low-code visual orchestration and enterprise delivery. Its typical responsibilities include:
- Visual flow orchestration, in two paradigms: conversational and task-based;
- Knowledge bases and retrieval-augmented generation (document upload, chunking, recall, reranking, context assembly);
- Multi-model onboarding and switching, to compare quality and cost;
- Application publishing formats (chat applications, backend APIs);
- Logging, permissions, versioning, and canary releases.
It answers a different question: how do business users use, change, and audit applications?
The alignment in one sentence: the execution kernel gives agents the ability to act; the governance layer gives the organization the ability to deliver.
3. Failure Modes of the Two Extreme Paths
3.1 Relying Only on the Execution Kernel: Over-Engineering
Prompts and tool descriptions end up scattered as code constants. Any change to business wording requires a code commit, a review, and a release cycle. Business stakeholders in finance, operations, and internal control cannot participate; they can only file requests and wait in the queue. The result is a demo that impresses and a delivery that never materializes.
3.2 Building Everything In-House: Drowning in Infrastructure
A usable RAG pipeline involves at least document parsing, chunking strategy, vectorization, index storage, recall and reranking, context assembly, frontend interaction, authentication, and auditing. Teams often spend 70% of their effort on glue code unrelated to business value. Timelines are measured in months, and knowledge assets walk out the door when people leave.
4. Target Architecture: Three Layers and Interface Contracts
The recommended design splits the system into three layers that communicate through explicit contracts:
- Model layer: provides inference, accessed through a unified gateway for easy replacement and rate limiting;
- Execution layer: the agent runtime, responsible for tools and sandboxes;
- Application and governance layer: orchestration, knowledge, publishing, and auditing.
An illustrative configuration structure (pseudocode, expressing the layering idea only):
app:name: finance_policy_qaflow: chatflow # conversational or task-basedmodel: {gateway: internal, params: {temperature: 0.2}}knowledge:- dataset: policy_docs # policy document knowledge basetop_k: 5rerank: truetools:- type: runtime # exposed by the execution layersandbox: truetimeout_s: 30governance:audit: full # log inputs, retrieved chunks, tool callsversioned: true
The key constraint: the governance layer does not connect directly to underlying infrastructure, the execution layer does not carry business phrasing, and the model layer is unaware of business flows.
5. Key Design Points
5.1 Orchestration: Packaging Capabilities as Business Nodes
Capabilities exposed by the execution layer, both model and tool, are wrapped as standard nodes that business users combine by dragging and dropping. For a policy Q&A scenario: intent recognition → knowledge recall → permission filtering → answer generation → citation labeling. A prototype can be produced in half a day, with no glue code.
5.2 Retrieval Augmentation: Out of the Box, Not From Scratch
Enterprise documents enter the knowledge base as a streaming pipeline: parsing (tables, headers, and footers need separate handling) → semantic chunking (300 to 600 characters is suggested, preserving heading hierarchy) → vectorization and indexing → hybrid retrieval (keyword plus semantic) → reranking → context trimming. One engineering rule matters: always preserve the mapping of “source chunk — document version — permission label.” This is the foundation for later auditing.
5.3 Observability and Traceability
A single invocation should record at least four things: the input and the rewritten query, retrieved chunks with their scores, tool call parameters with a summary of returns, and the final output with latency. Missing any one of them turns incident review into guesswork.
5.4 Permissions and Data Boundaries
Use dual permission labels at document and field level, and filter during retrieval rather than during generation, to avoid the leak risk of “see first, mask later.” For sensitive scenarios, a fully private deployment is recommended: containerized inside the internal network, with the model, runtime, and application layer all in your own environment, using external services only for generic capabilities such as object storage, logging, monitoring and alerting, and container platforms.
5.5 Cost and Version Governance
Apply quotas and fallback policies at the model gateway. Bring prompts and flow configurations under version control, with canary releases and one-click rollback. For high-frequency Q&A, build caches and evaluation sets, and use offline evaluation to guard iteration quality.
6. Suggested Rollout Path
- Phase one (1 to 2 weeks): pick one high-frequency, low-risk scenario, connect the knowledge base and single-turn Q&A, and establish an evaluation baseline;
- Phase two (3 to 4 weeks): onboard execution-layer tools, complete auditing and permissions, and hand it to business users for a trial;
- Phase three: replicate across scenarios, accumulate enterprise knowledge assets and a prompt template library, and form governance standards.
7. Common Pitfalls
- Treating the governance layer as a low-code toy and neglecting versioning and auditing;
- Filtering permissions at the generation stage;
- Keeping one chunking strategy fixed instead of adapting it to document types;
- Tracking only call volume, not recall hit rate or human correction rate.
8. Conclusion
What enterprises truly need is not a stunning demo but a capability that can be operated sustainably: business teams maintain knowledge themselves, adjust phrasing without a release, trace failures to a specific chunk and tool, and keep data inside the internal network. Layering execution and governance is the shortest path for agents to move from “it runs” to “it ships.”
