HarnessProfile

org.llm4s.agent.harness.HarnessProfile
See theHarnessProfile companion object
@Experimental
final case class HarnessProfile

A harness for an agent (design ยง4.37): file tools over a backend, optionally execute over a sandbox, and the middleware that plan, manage context, load skills and instructions and check permissions - assembled in a fixed order by AgentBuilder.withHarness. Start from HarnessProfile.deepAgents, or from HarnessProfile() (the file tools alone), and change it with the with* setters; org.llm4s.config.HarnessConfigLoader loads the preset's settings from llm4s.agent.harness.

build() installs, outermost first and before the builder's own middleware: a PermissionMiddleware over permissions (none when they are empty, since a PermissionMiddleware denies every call no rule matches), then summarisation, offload, skills, instructions and todos, each when set. The selected file tools run over backend, or over a CompositeBackend that also mounts OffloadBackend at /large_tool_results when offload is set; skills and instructions read through the same backend. execute is added only when sandbox is set. Each tool of the profile that declares no timeout is bounded by toolTimeout. The system prompt follows systemPrompt. After each turn, as it is admitted, the root agent prunes the thread to retention (RunConfig.withRetention), which bounds the full-snapshot checkpoints it keeps.

build() refuses an invalid setting (a limit a component refuses, a blank PromptMode.Replace), a tool name the selection does not know, execute selected without a sandbox, and withSystemPrompt beside a harness: set the prompt through systemPrompt.

Value parameters

backend

where the file tools, skills and instructions read and write

instructions

instruction memory (AGENTS.md); None for none

offload

offload of large tool results; None for none

permissions

permission rules, first match wins; empty for no permission checks

retention

what a thread keeps of its checkpoints and events, applied as each turn is admitted

sandbox

where execute runs commands; None adds no execute tool

skills

Agent Skills; None for none

summarization

summarisation of older messages; None for none

systemPrompt

the system prompt

todos

the plan (write_todos); None for none

toolTimeout

the bound on each run of a profile tool that declares none

tools

which of the file tools and execute the agent gets

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def toolNames: Vector[String]

The names of the tools this profile can give: the file tools, and execute when it has a sandbox.

The names of the tools this profile can give: the file tools, and execute when it has a sandbox.

Attributes

def withToolTimeout(t: FiniteDuration): HarnessProfile
def withToolTimeout(t: Option[FiniteDuration]): HarnessProfile

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product