Xenovia Labs
← All essays Also published on Substack ↗
May 6, 20265 min read

The Architecture of Agent Behavior: Why the System Prompt Is Not Enough

Governing AI agents at runtime requires more than instructions. It requires infrastructure.

The gap everyone is ignoring

Most teams building AI agents spend enormous effort on the model: prompt quality, fine-tuning, evals. That effort is not wasted. But it is incomplete.

The model is one part of a deployed agent system. Around it sits an execution environment, a behavioral contract, and, if you are serious about production, a runtime governance layer. Most teams have the first. Some have the second. Very few have the third.

This article is about all three, why they are distinct, and why the third one is where most governance actually breaks down.


Layer 1: The harness

An agent harness is the execution environment that wraps around an LLM call. It is not the model. It is everything the model operates inside.

The harness defines what tools the agent can call, what memory it can access across turns, what gets logged, what triggers an alert, and what hard constraints persist regardless of how the model reasons. Think of it as the difference between handing someone a task and handing them a task inside a workspace with a rulebook, a supervisor, and an audit trail.

The insight most teams miss: behavioral failures in deployed agents are usually harness failures, not model failures. A capable model placed in a poorly designed harness will behave unreliably. A less capable model in a well-designed harness will behave predictably. The question worth asking is not “is this model safe?” It is “is this deployment environment governed?”


Layer 2: The system prompt is not a prompt. It is a contract.

The term “system prompt” creates a misleading mental model. It sounds like a configuration tweak. A few lines that set the tone. In practice, for any serious agentic deployment, the system prompt is the primary behavioral contract between the organization and the AI system.

It specifies the agent’s identity, scope of authority, ethical constraints, escalation thresholds, and how it should behave when things go wrong. When written carelessly, as a vibe-setting exercise, it produces governance failures. Constitutions written carelessly work the same way.

The shift that serious teams are making: treating system prompts like legal documents. Versioned. Tested against edge cases. Reviewed before changes ship. The distinction that matters most is specificity. “Be helpful and honest” is a philosophy. “Do not execute write operations on external APIs without explicit user confirmation in the current session” is a contract clause. The best system prompts read as if a regulator will eventually inspect them. Because they will.


Why the system prompt is still not enough

Here is the structural problem.

The system prompt defines what the agent is supposed to be. But at runtime, the agent accumulates context: tool outputs, retrieved documents, conversation history, and in multi-agent pipelines, instructions from other agents. With each addition, the system prompt becomes a smaller fraction of what the model actually sees. It has not changed. But its effective authority over the model’s behavior has eroded, because the surrounding context has changed what the model is reasoning from.

A retrieved document with contradictory framing can pull behavior off spec. A long conversation history can dilute earlier constraints. A message from another agent in the pipeline can introduce instructions that were never part of the original contract. The governance was set at design time. The agent is operating at runtime. Those are two different moments, and most systems only govern the first one.

This is the gap that Layer 3 addresses.


Layer 3: Xenovia and runtime governance

Xenovia operates at the moment of action. Before an agent executes a capability, makes an API call, or takes any consequential step, Xenovia intervenes with a question: does this fall within what this agent was actually declared to do?

The evaluation is not against a list of prohibited behaviors. It is against the declared intent registered in the Xenovia platform when the agent was configured, combined with the behavioral contract in the system prompt. Together, these form a stable reference for what this agent is authorized to be and do. That reference is maintained independently of the agent’s runtime context, so it cannot be diluted by accumulated conversation, contradicted by retrieved documents, or manipulated by instructions introduced mid-session.

When a capability invocation diverges from that reference, Xenovia responds with proportionate force. It blocks, flags, or escalates, depending on severity and configured policy:

This graduated response is what makes runtime governance usable in production. A binary block-or-allow system is too blunt for real agent workflows. The ability to distinguish between a minor capability overstep in a low-stakes context and an agent attempting an irreversible unauthorized action is what separates governance from a kill switch.

Most governance systems check actions against what was explicitly forbidden. Xenovia checks against the positive definition of what the agent is: its declared purpose, authorized capability scope, and intended operating boundaries. This means it can surface violations that were never anticipated when the rules were written, because the evaluation is grounded in intent, not just enumerated prohibitions.


The stack, assembled

These three layers are not alternatives. They are layers of a single governance architecture, each doing work the others cannot:

The harness defines the operational envelope: what the agent can access, what is logged, what triggers intervention at the infrastructure level.

The system prompt defines the behavioral contract: identity, authority, constraints, failure-mode handling, declared at configuration time.

Xenovia ensures the contract holds at runtime: evaluating actions against declared intent, maintaining governance integrity as context accumulates, and responding with proportionate force when behavior diverges from the spec.

Governance written only at design time is not governance. It is intent. The harness and the system prompt express intent. Xenovia enforces it.


What this means in practice

Most agents deployed today are governed at the first two layers and ungoverned at the third. They have capable models and carefully written system prompts. They do not have runtime governance infrastructure.

As agents take on more consequential tasks, with longer time horizons, more tool access, and more autonomy, that gap becomes a liability. The model’s capability is not the limiting factor. The surrounding system’s ability to govern that capability at runtime is.

The models are ready to be agents. The question is whether the infrastructure around them is ready to govern them.

Runtime governance is not a workaround for bad models. It is the serious work of deploying good ones.