Skip to content
Naditu

Agent harness vs ontology: what each layer solves

An agent harness runs the model loop, tool calls and retries. An ontology defines what company data means, how tables join and what the agent is allowed to do.

Naditu7 min read

Teams connecting AI to company databases often blur the line between an agent harness and an ontology, expecting one piece of software to do the job of both. In any agent harness vs ontology comparison, the boundary is architectural. An agent harness runs the model loop: it manages context windows, dispatches tool calls, handles retries and streams progress. An ontology defines what your business data means: which records form a customer or a work order, how tables join across separate systems, what local status codes stand for, and who is allowed to read or change each field.

Buying or building a strong harness gives a model reliable hands and working memory, as we break down in what an AI agent harness does inside enterprise software. Without an ontology on the other side of the connection, that same capable agent still guesses table joins, misreads ERP status columns and inherits whatever broad database credentials someone handed to its connector.

Why teams confuse the agent harness and the ontology

Over the past year, engineering teams have standardized around capable agent harnesses: coding and terminal harnesses such as Claude Code and Codex, graph frameworks such as LangGraph, and internal tool-calling loops built in Python or TypeScript. In Anthropic research on building effective agents with simple composable loops, the core pattern is straightforward: a model calls tools against an environment, inspects the returned observations, and iterates until its task is done.

On codebases, that loop feels nearly self-sufficient. Source files carry descriptive names, a compiler or test suite tells the harness immediately when an edit is wrong, and the harness can search the repository until it finds every reference to a function. Teams see how well a harness navigates fifty thousand lines of code and assume it will navigate fifty enterprise database tables the same way.

A production ERP or CRM gives the harness none of those signals. A SQL query that joins the wrong two columns or filters on the wrong status number still returns valid rows with zero syntax errors. Nothing fails loudly. The harness receives a clean table of numbers, formats a confident summary, and hands back an answer that counts shipped orders as closed or drops every customer whose account code carries a leading zero in one system and not the other. The loop worked as designed. What was missing was never a smarter loop.

Two distinct jobs in one stack. The harness runs the agent loop on the left, while the ontology governs business meaning, cross-system joins and permissions on the right.

What an agent harness solves well

None of this diminishes the harness. Calling a raw language model endpoint directly in production leaves every operational failure mode to application code. A well-engineered agent harness takes ownership of how the model runs from turn to turn.

Orchestrating the loop and retries

A real business question rarely finishes in one tool call. The harness decides when the model should call another tool, catches malformed JSON arguments or transient timeouts, feeds structured error messages back to the model so it can self-correct, and sets hard ceilings on steps, wall-clock time and token spend so a stuck loop terminates cleanly.

Managing context windows and compaction

Tool outputs fill a context window fast. Twenty rows of wide ERP columns or three long document excerpts can crowd out the original instructions. The harness tracks token usage, truncates oversized payloads, compacts older turns into summaries, and keeps working state coherent across multi-step tasks without dropping constraints set at the start of the session.

Sandboxing tool execution

When an agent writes Python to aggregate numbers, parses a file or invokes local utilities, the harness isolates that execution inside an operating system sandbox or container, enforces timeouts, and streams step-by-step progress to the person waiting for a reply. Notice what all three jobs have in common: every one of them governs runtime mechanics inside the session, and none of them knows anything about how your company runs its orders, inventory or finance.

What an ontology solves that no harness can infer at runtime

An ontology is the recorded, human-confirmed model of how a specific business stores and governs its reality across software systems. If the term itself feels abstract, our guide to what an ontology is in AI and how companies use it breaks down its four parts in plain terms. None of those four parts can be guessed reliably inside an agent loop at query time.

Company objects and undeclared cross-system joins

People ask questions about customers, sales orders, items, work orders, shipments and invoices. Databases store tables named CUST, ORD_HDR, ORD_LIN and WO_HDR in an ERP alongside an account table in a CRM. Legacy ERP schemas declare only a fraction of their own internal foreign keys, and no database declares a foreign key into another vendor database. Knowing that CRM account.erp_code matches ERP CUST.CODE, or that production work orders in WO_HDR join back to order lines through LINREF because planning reports have used that column for ten years, requires evidence gathered with the people who run those systems and written down once.

Local status codes and department terms

Suppose ORD_HDR has a column named STAT containing the values 1, 2 and 4. A harness that inspects the schema and samples ten rows sees integers. Left to guess, a model routinely treats 4 as closed or cancelled, when in that plant 4 means shipped and awaiting invoice. Likewise, sales teams ask whether an order is out yet, while production asks about a job card and finance asks about unbilled dispatches. An ontology records those exact codes and everyday phrases after a domain owner confirms them, so no model improvises a definition on the fly.

Role-scoped permissions and human write approval

In an enterprise, whether a question may be answered depends on who is asking. Sales and finance may see quoted prices on an order, only finance may see whether an invoice is paid, purchasing and finance alone may see unit cost on an item, and payroll tables stay closed to every role including administrators. Enforcing those rules deterministically before data ever enters the model context window, and requiring a named person to approve any write back to an operational system, belongs in the data governance layer, not in a prompt instruction that a model might overlook.

Why putting ontology logic inside system prompts fails

When teams first hit bad joins and misread status codes, the tempting shortcut is to paste table descriptions, join hints and access rules straight into the agent harness system prompt or tool wrappers. For one prototype and five tables, that patch appears to work. In production, it breaks in three predictable ways.

  • Prompt logic splinters the moment a second AI tool arrives. Finance adopts a spreadsheet assistant, engineering runs Claude Code, operations uses ChatGPT, and an internal Python worker runs a morning schedule. If business definitions live inside one harness repository, every new client gets a copied, slightly different version of the truth. When sales corrects what status code 4 means, three other prompts keep serving the old answer.
  • Context limits fight schema size. A real plant or distributor has hundreds of tables and thousands of coded columns across ERP, CRM, warehouse and quality software. Stuffing the whole dictionary into every prompt wastes tokens and degrades model attention, while letting the harness grep raw schemas at runtime brings back guessing.
  • Prompts cannot enforce security boundaries. Telling a model in text not to show unit costs to a user outside finance is a suggestion, not an access control. If the underlying database connection can read the column, prompt injection or a confused multi-step loop can expose it.

How MCP separates the harness from the governed ontology

The Model Context Protocol specification gives enterprise teams a clean wire boundary between these two layers. Any MCP-compatible agent harness acts as the client: it owns the conversation, the reasoning loop, context compaction and user interface. Behind the MCP server sits the governed ontology layer, connected once to your ERP, CRM, quality and warehouse systems.

Because MCP itself is only a transport and tool contract rather than a built-in security engine, the server side has to carry real identity checks, least-privilege rules and full invocation logs, as covered in our MCP security checklist for enterprise IT. When the ontology sits behind that controlled boundary, every harness you plug in inherits the same verified object definitions, cross-system table links, confirmed status codes, role-based read filters and human write-approval gates. Swapping one AI assistant or agent framework for another next quarter changes nothing you have taught your company ontology. You can inspect how Naditu runs as a governed ontology layer on your own infrastructure without locking your data model inside a single assistant.

Sources

  1. Building effective agents, Anthropic
  2. Introduction to the Model Context Protocol, Model Context Protocol
  3. Model Context Protocol (MCP): Security Design Considerations for AI-Driven Automation, National Security Agency

More on AI agent governance: Permissions, approval, audit and security for AI agents that read and act on company systems, including agents that work through MCP.

Keep reading

Follow what we ship.

New connectors, product updates and what we learn rolling AI out in enterprises, sent to your inbox.