# Harness overview

> Define Loops, assemble a Rig, run and restore Sessions, observe events, add gates and hooks, delegate work, and serve clients.

- Path: `Guides > Harness > Overview`
- Human: https://looprig.com/docs/guides/harness
- Machine index: https://looprig.com/llms.txt

Harness is the composition runtime. A Loop freezes one agent's model, instructions, tools, and limits. A Rig combines Loops with session storage, workspaces, gates, hooks, and delegation policy. A Session owns live turns, events, control commands, and shutdown.

```go
assistant, err := loop.Define(
	loop.WithName("assistant"),
	loop.WithInference(client, selectedModel),
)
runtime, err := rig.Define(
	rig.WithLoops(assistant),
	rig.WithPrimers("assistant"),
	rig.WithSessionStore(sessions),
)
session, err := runtime.NewSession(ctx)
```

## Explore the Harness runtime

Follow the runtime from its public control surface into reusable configuration and live execution:

1. [Commands](/docs/guides/harness/commands/index.md) control a live Session, including submit, interrupt, approval, compaction, and shutdown.
2. [Events](/docs/guides/harness/events/index.md) expose the durable record emitted by those commands and by runtime execution.
3. [Step](/docs/guides/harness/step/index.md) is one model request followed by any tool calls and their results.
4. [Turn](/docs/guides/harness/turn/index.md) begins with one admitted user input and ends with a durable terminal event.
5. [Loop](/docs/guides/harness/loop/index.md) freezes one agent's model, instructions, tools, limits, and delegation choices.
6. [Rig](/docs/guides/harness/rig/index.md) assembles loops, storage, hooks, workspaces, gates, and Hustles.
7. [Session runtime](/docs/guides/harness/session-runtime/index.md) owns the live controllers, queues, subscriptions, resources, and shutdown boundary.
8. [Skills](/docs/guides/harness/skills/index.md) load reusable instructions on demand from curated embedded catalogs or gated project workspaces.
9. [Hustles](/docs/guides/harness/hustles/index.md) run bounded auxiliary inference for facilities such as compaction and permission review.
10. [Compaction](/docs/guides/harness/compaction/index.md) replaces an older transcript prefix with a validated summary tied to the exact context basis.

Start with [Build an agent with Harness](/docs/start/first-run.md), then build the [Weather Assistant](/docs/examples/weather-assistant.md) or [Research Assistant](/docs/examples/research-assistant.md). Use the [complete Harness module guide](/docs/modules/harness.md) for repository and dependency details.
