Skip to main content

Harness Worker Agents

Last updated on

Harness Worker Agents are Harness-managed automation workers. Each agent is defined by a wrapper YAML file whose spec key carries the agent pipeline definition, which means you can keep agent definitions in version control and apply them from the CLI. The commands live in the platform module.

This page covers all Harness Worker Agent resources and actions available in the CLI.


What you will learn in this topic

By the end of this page, you will know how to:

  • List the Harness Worker Agents in scope.
  • Retrieve an agent definition in a form you can edit and reapply.
  • Create an agent from a wrapper YAML file.
  • Update an existing agent definition.

Before you begin

  • Harness CLI installed and authenticated: For setup steps, see Install and upgrade and Authenticate.
  • Scope configured: Worker Agents resolve against the scope in your profile. Pass --account, --org, or --project to override it for a single command.

The wrapper YAML

An agent definition is a wrapper document with three parts:

  • name: The display name of the agent.
  • description: A short summary of what the agent does.
  • spec: A string that carries the agent pipeline definition.

Because spec is a string, the agent pipeline is nested inside the wrapper rather than merged into it. Retrieve an existing agent with -o yaml to get a valid wrapper that you can edit and pass straight back to create or update.


Worker Agents

List agents

harness list agent
harness list agent --all --format json
harness list agent --columns "name,id"

Get agent details

Use -o yaml to produce a valid wrapper document for editing.

harness get agent <agent_id>
harness get agent <agent_id> -o yaml
harness get agent <agent_id> --format json

Create an agent

Create an agent from a wrapper YAML file.

harness create agent <agent_id> -f <agent_file>.yaml

Update an agent

Update an agent from a wrapper YAML file. To round-trip a definition, retrieve it, edit it locally, and apply it back.

harness update agent <agent_id> -f <agent_file>.yaml
harness get agent <agent_id> -o yaml > <agent_file>.yaml
$EDITOR <agent_file>.yaml
harness update agent <agent_id> -f <agent_file>.yaml