Skip to main content
Harness is a VeADK execution enhancement extension that provides two mutually exclusive integration modes: an in-process plugin mode and a managed Sidecar mode. The in-process mode loads Harness plugins into the application process to prepare context, compact tool results, and verify answers for each turn. The managed Sidecar mode runs all enhancement behavior in a separate managed runtime, and the application process does not load the related plugins.
The two modes cannot be combined. When managed Sidecar mode is enabled, HarnessExtension.plugins() always returns an empty list, and the application process does not load any veadk.extensions.harness.plugins implementation.

When to use

Installation

The base Harness extension is bundled with VeADK and requires no additional installation. To use the Headroom compression provider, install the harness extra:

In-process plugin mode

The in-process mode builds a plugin list via build_harness_plugins() and attaches it to the Runner:
app.py
Complete model configuration, save as app.py, and run python app.py. It should print plugin names followed by an agent response. Response verification uses rules and does not guarantee factual correctness. Compression can remove detail, so evaluate it for your task

Plugin capabilities

Configuration via environment variables

Use build_harness_plugins_from_env() to build plugins from environment variables:
Related environment variables: Components and profile prefer HARNESS_ENHANCE_COMPONENTS and HARNESS_ENHANCE_PROFILE, then their counterparts without ENHANCE. Character limits, storage path, compression provider, and verifier mode prefer the variables without ENHANCE. There is no single prefix-precedence rule for all settings

Managed Sidecar mode

The managed Sidecar mode starts a managed runtime via HarnessExtension. The runtime is responsible for executing all Harness enhancement behavior. HarnessExtension only starts the runtime, applies model and MCP bindings, and manages its lifecycle.

Enable via environment variables

Set HARNESS_SIDECAR_ENABLED=true and HarnessExtension.from_env() reads the relevant environment variables and starts the Sidecar:
HarnessExtension supports the context manager protocol and automatically closes the Sidecar on exit:

Enable via constructor parameter

You can also enable the Sidecar directly via the sidecar parameter:
The sidecar parameter accepts a boolean or a configuration dict. When a dict is provided, its fields are used to resolve the Sidecar plan; when True is provided, default configuration is used.
When Sidecar mode is enabled, the components parameter cannot be passed. Component selection is controlled through component_overrides in the Sidecar configuration.

Enable via configuration object

Use HarnessSidecarConfig to build a complete configuration, then pass it to HarnessExtension:
HarnessSidecarConfig.from_env() can also build a configuration object from environment variables.

Sidecar status

Sidecar environment variables

The managed Sidecar mode is configured through the following environment variables. Defaults are used when not explicitly set.

General configuration

Model proxy configuration

MCP gateway configuration

HarnessExtension parameters

When profile is ops, the in-process mode default components include long_run_control.
The managed Sidecar mode requires an AgentKit-managed cloud runtime environment. Enabling it in an environment without the Sidecar Runtime causes a startup error or degraded operation, depending on the value of HARNESS_SIDECAR_FAIL_OPEN.

Direct module usage

Individual modules from the in-process mode can also be used directly:

Checking Sidecar status

After setting the environment, create HarnessExtension before constructing the agent. Call close() when finished or use a context manager. Inspect sidecar_status_payload(): ok indicates successful startup; degraded indicates fallback and does not prove enhancements are active. HARNESS_SIDECAR_FAIL_OPEN=true allows execution to continue after startup failure by default. Set it to false if Sidecar is mandatory See Harness deployment for the standalone service’s HTTP API, sessions, and deployment. Sidecar bindings affect model and MCP request destinations; confirm upstream endpoints and credential sources before use
Last modified on September 19, 2026