The Harness
The harness is the ready-made agent you run first: file and shell tools, todos, plan mode,
project instructions and skills, approvals and resumable sessions. HarnessAgent
(adk-harness, spec 3.1) builds it as configuration and policy over an LlmAgent, and
every tool call it makes, or any member of its team makes, passes one governed path: the
session's mode, your standing rules, the operator's policy, approvals, and the action
ledger.
| Use it as | How |
|---|---|
| A command-line agent | cargo install adk-cli, then adk-rust in a project; see The harness in your terminal |
| A library | adk-rust with the harness feature (in full), or adk-harness directly |
| A new project | cargo adk new my-harness --template harness; see Configuration |
| A served agent | adk-rust serve, or HarnessLauncher::run_serve_directly; see Serving the harness |
| An autonomous agent | adk-rust goal, or the always-on agent kernel with adk-rust up; see Build an autonomous agent |
Quick start
[dependencies]
adk-rust = { version = "3.0.0", features = ["harness"] }
tokio = { version = "1", features = ["full"] }
anyhow = "1"
use std::sync::Arc;
use adk_rust::futures::StreamExt;
use adk_rust::harness::{HarnessAgent, HarnessMode, Workspace};
use adk_rust::model::GeminiModel;
use adk_rust::session::InMemorySessionService;
use adk_rust::UserId;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let model = Arc::new(GeminiModel::new(std::env::var("GOOGLE_API_KEY")?, "gemini-3.8-flash")?);
let harness = HarnessAgent::builder("harness")
.model(model)
.workspace(Workspace::new(".").allow_bash(true))
.mode(HarnessMode::Plan)
.build()?
.into_harness("my-app", Arc::new(InMemorySessionService::new()))?;
let user = UserId::new("alice")?;
let session = harness.open_session(&user, None).await?;
let mut events = harness.send(&user, &session, "Plan the fix for the failing test").await?;
while let Some(event) = events.next().await {
let _ = event?;
}
println!("todos: {:?}", harness.todos(&user, &session).await?.items);
Ok(())
}
In plan mode the harness reads, keeps todos and proposes a plan with exit_plan_mode;
nothing it runs can change the workspace. Without a prompter, a call that needs a person is
held: Harness::pending_approvals lists it and Harness::decide answers it, and the next
turn runs it once (see Modes and approvals).
What it does
| Capability | Mechanism | Page |
|---|---|---|
| Modes | read_only, plan, ask (default), auto per session, in a harness-owned store; the model leaves plan mode only through an approved exit_plan_mode | Modes and approvals |
| Approvals | A prompter at the terminal, or held calls decided later from any process; "always allow" becomes a standing rule bound to you and to the tool's declaration | Modes and approvals |
| Shell | bash on the host behind approval, or in the OS sandbox (Seatbelt, bubblewrap); background shells read with shell_output and stopped with shell_kill | Shell and sandbox |
| Instructions and skills | AGENTS.md after a workspace trust decision; skills loaded on demand | Configuration |
| Team | Local, ACP and A2A members under the parent's mode, budget and policy | Team |
| Plans and goals | An approved plan runs as a checkpointed graph; goals iterate until a command passes, as durable runs | Plans and goals |
| Snapshots and rewind | The whole workspace is snapshotted before each turn, shell writes included; /rewind restores files, transcript and plan, /redo undoes it | Snapshots and rewind |
| Durability | A completed call never runs twice; held approvals survive process loss | Durability |
| Identity | Roles per tool class, per-call shell credentials, authenticated serving | Identity |
| Observability | Spans, spend per agent and subject, a loop guard that tightens the mode | Observability |
| Memory | Working notes outside the workspace, written behind approval; long-term facts with provenance, recalled into each turn | Memory |
| Personal preset | A workspace of notes and files under the home instead of a repository, no host shell, quiet time and a daily spending limit asked at first run | The personal preset and take over |
| Take over | A tool asks for a password or one-time code; the person types it on the phone or the web home and it reaches that one call | The personal preset and take over |
| Website runtime | The preset, back-office and public toolsets, partitions and signals, the autonomy ladder, authoring, outbound Web Bot Auth and onboarding of an AWP 2.0 website (feature website) | The website runtime |
Pages
| Page | Covers |
|---|---|
| Modes and approvals | The mode table, switching modes, prompts, held calls and decisions, standing rules |
| Configuration | Builder options and defaults, .adk/harness.toml, features, the harness template |
| The harness in your terminal | adk-rust, code, goal, ultracode, slash commands, harness.db |
| Serving the harness | adk-rust serve, request identity, the approval inbox, background runs |
| Shell and sandbox | Host and sandboxed bash, isolation status, unsandboxed retries, output and background shells |
| Team | Members, isolation, budgets, discovery, review rounds |
| Plans and goals | The plan graph, gates and rewind; loop-until goals, durable and ambient |
| Snapshots and rewind | Whole-workspace snapshots before each turn, /rewind and /redo: files, transcript and plan |
| Durability | The durability invariants, the tests that prove them, and what to run after a crash |
| Identity | RBAC, credentials, authenticated identity, audit |
| Observability | Spans, spend, the loop guard, evaluation baselines |
| Memory | Working notes and long-term facts |
| Payments | The payments pack: purchases under a mandate, approved once each, metered and receipted |
| Browser and computer use | The browser pack under the web rules; desktop actions through the governed reference graph, approved once each |
| Voice | The voice surface: the same harness over a realtime session, spoken approvals, one audit trail |
| The personal preset and take over | --preset personal, its first run, and secrets typed by the person for one tool call |
| The website runtime | Preset::Website, the site's two partitions, the autonomy ladder compiled to policy, authoring and onboarding |
Migrating from CodingAgent | Moving from adk_agent::coding to the harness |
Status
adk-harness is Beta (STABILITY.md).
The payments pack (harness-payments) is in Payments; the voice surface
(harness-voice) is in Voice; the managed form
(harness-managed, Experimental like adk-managed) runs the harness on the managed runtime,
see Serving the harness. The browser and computer-use
packs (harness-browser, harness-computer-use) are in
Browser and computer use. The design is
spec 3.1.