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 asHow
A command-line agentcargo install adk-cli, then adk-rust in a project; see The harness in your terminal
A libraryadk-rust with the harness feature (in full), or adk-harness directly
A new projectcargo adk new my-harness --template harness; see Configuration
A served agentadk-rust serve, or HarnessLauncher::run_serve_directly; see Serving the harness
An autonomous agentadk-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

CapabilityMechanismPage
Modesread_only, plan, ask (default), auto per session, in a harness-owned store; the model leaves plan mode only through an approved exit_plan_modeModes and approvals
ApprovalsA 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 declarationModes and approvals
Shellbash on the host behind approval, or in the OS sandbox (Seatbelt, bubblewrap); background shells read with shell_output and stopped with shell_killShell and sandbox
Instructions and skillsAGENTS.md after a workspace trust decision; skills loaded on demandConfiguration
TeamLocal, ACP and A2A members under the parent's mode, budget and policyTeam
Plans and goalsAn approved plan runs as a checkpointed graph; goals iterate until a command passes, as durable runsPlans and goals
Snapshots and rewindThe whole workspace is snapshotted before each turn, shell writes included; /rewind restores files, transcript and plan, /redo undoes itSnapshots and rewind
DurabilityA completed call never runs twice; held approvals survive process lossDurability
IdentityRoles per tool class, per-call shell credentials, authenticated servingIdentity
ObservabilitySpans, spend per agent and subject, a loop guard that tightens the modeObservability
MemoryWorking notes outside the workspace, written behind approval; long-term facts with provenance, recalled into each turnMemory
Personal presetA 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 runThe personal preset and take over
Take overA 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 callThe personal preset and take over
Website runtimeThe 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

PageCovers
Modes and approvalsThe mode table, switching modes, prompts, held calls and decisions, standing rules
ConfigurationBuilder options and defaults, .adk/harness.toml, features, the harness template
The harness in your terminaladk-rust, code, goal, ultracode, slash commands, harness.db
Serving the harnessadk-rust serve, request identity, the approval inbox, background runs
Shell and sandboxHost and sandboxed bash, isolation status, unsandboxed retries, output and background shells
TeamMembers, isolation, budgets, discovery, review rounds
Plans and goalsThe plan graph, gates and rewind; loop-until goals, durable and ambient
Snapshots and rewindWhole-workspace snapshots before each turn, /rewind and /redo: files, transcript and plan
DurabilityThe durability invariants, the tests that prove them, and what to run after a crash
IdentityRBAC, credentials, authenticated identity, audit
ObservabilitySpans, spend, the loop guard, evaluation baselines
MemoryWorking notes and long-term facts
PaymentsThe payments pack: purchases under a mandate, approved once each, metered and receipted
Browser and computer useThe browser pack under the web rules; desktop actions through the governed reference graph, approved once each
VoiceThe 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 runtimePreset::Website, the site's two partitions, the autonomy ladder compiled to policy, authoring and onboarding
Migrating from CodingAgentMoving 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.

The Harness - Documentação ADK-Rust | ADK-Rust