---
product: "AG Studio"
title: "Harness Overview"
description: "Learn what a harness does, how to choose between the one AG Studio ships and one of your own, and which runner to drive each agent with."
framework: angular
version: "3.0.0"
related:
    - title: "Built-in Harness"
      url: "https://www.ag-grid.com/studio/angular/ai-builtin-harness/"
    - title: "Direct LLM Runner"
      url: "https://www.ag-grid.com/studio/angular/ai-direct-llm-runner/"
    - title: "Client Tool Runner"
      url: "https://www.ag-grid.com/studio/angular/ai-client-tool-runner/"
    - title: "Custom Runner"
      url: "https://www.ag-grid.com/studio/angular/ai-custom-runner/"
    - title: "Custom Harness"
      url: "https://www.ag-grid.com/studio/angular/ai-custom-harness/"
llms: "https://www.ag-grid.com/studio/llms.txt"
---

# Harness Overview

The harness manages the conversation with the user, orchestrates the agents within AG Studio, and exposes what a UI needs to render.

## How it Works

A harness manages four things:

- **Conversations:** A conversation is a session. The UI reads it through session APIs such as `addEventListener`, so it is told whenever something changes that the user should see.
- **Agents:** The harness holds the roster, names the primary agent, and owns the delegation between them.
- **Persistence:** Conversations live in the harness, not in AG Studio state. They are kept in memory by default. Supply a `history` store to make them durable.
- **Observability:** The harness emits a typed stream of boundary events, such as a tool call starting and finishing, or a turn completing. Register observers to drive metrics, cost meters or an eval harness.

## Choosing a Harness

There are two options. Use the harness AG Studio ships, built with `createAiHarness`, or [write your own](https://www.ag-grid.com/studio/angular/ai-custom-harness/) against the `AgAiHarness` interface. Most integrations use the first.

Writing your own replaces the conversation itself, including threads, history and sessions. It is worth doing only when that machinery is already yours.

## Choosing a Runner

Within Studio's harness, each agent is paired with a **runner**. The runner decides how much of each turn Studio runs for you:

- **[Direct LLM Runner](https://www.ag-grid.com/studio/angular/ai-direct-llm-runner/)** - you bring a model, reached through an adapter you supply.
- **[Client Tool Runner](https://www.ag-grid.com/studio/angular/ai-client-tool-runner/)** - you bring a request that answers one turn at a time.
- **[Custom Runner](https://www.ag-grid.com/studio/angular/ai-custom-runner/)** - you bring a whole loop that already resolves its own tool calls.

> **Note**
>
> For most use cases, the Direct LLM Runner is the fastest way to integrate AI into AG Studio. Use the others when you have existing infrastructure, or an agent framework you have already built on.

### Comparing the Options

The picker below shows how the harness, the runner, the agents and the chat UI combine, and the code for each combination:

## Changing Approaches

Moving between combinations is mostly additive:

- **Swap the agents.** Change their instructions and tool sets, or replace the built-ins with your own. The harness and the panel are unaffected.
- **Change the runner.** Re-pair the same definitions with `directLlmRunner`, `clientToolRunner`, or a plain `{ ...definition, run }`.
- **Move to a harness of your own.** Keep listing the same tools, and implement `AgAiHarness` around your own loop.
- **Drop the harness.** Stop providing one and keep the tools. See [Without a Harness](https://www.ag-grid.com/studio/angular/ai-tools/#without-a-harness).

Adopting Studio's chat UI after building your own is the one move that costs real work, because your UI's state model has to be reconciled with the session snapshot the panel reads. If you may want the panel eventually, keep the panel and replace the agents instead.

## Next

- [Built-in Harness](https://www.ag-grid.com/studio/angular/ai-builtin-harness/) - configuring the one Studio ships
- [Custom Harness](https://www.ag-grid.com/studio/angular/ai-custom-harness/) - replacing it with your own
- [Agent Overview](https://www.ag-grid.com/studio/angular/ai-agents/) - what an agent is, and the three runners in full
