Skip to content

automaton.harness

WARNING

This documentation is almost entirely "vibe coded"; while a helpful resource for humans and agents to understand this codebase, it should not be considered a source of ground truth in the way documentation normally is, and the user is responsible for verifying that all instructions given here are safe.

automaton.harness

Harness management for Automaton.

A harness defines how an autonomous agent is invoked: a run script, prompts, and harness-specific metadata. Container recipes are not owned by the harness directory; they are supplied to :class:~automaton.container.ContainerManager through a :class:~automaton.container.ContainerLayout.

Automaton is content-free: it does not assume any particular on-disk layout for harnesses. A :class:Harness is constructed from an explicit harness directory supplied by the caller.

Harness

Harness(harness_id: str, harness_dir: Path)

Represents an Automaton harness loaded from an explicit directory.

Parameters:

Name Type Description Default
harness_id str

Harness identifier.

required
harness_dir Path

Path to the harness directory containing harness.yaml, the run script, and prompt assets.

required
Source code in automaton/harness.py
def __init__(self, harness_id: str, harness_dir: Path):
    self.harness_id = harness_id
    self.harness_dir = Path(harness_dir).resolve()

    if not self.harness_dir.exists():
        raise FileNotFoundError(f"Harness directory not found: {self.harness_dir}")

    config_file = self.harness_dir / "harness.yaml"
    if not config_file.exists():
        raise FileNotFoundError(f"Harness config not found: {config_file}")

    with open(config_file) as f:
        self.config = yaml.safe_load(f) or {}

container_template property

container_template: str

Container template name for this harness.

run_script property

run_script: Path

Path to run_benchmark.sh script.

system_prompt_file property

system_prompt_file: Path

Path to system_prompt.md file.

validate

validate() -> list[str]

Validate that all required harness components exist.

Source code in automaton/harness.py
def validate(self) -> list[str]:
    """Validate that all required harness components exist."""
    errors = []
    if not self.run_script.exists():
        errors.append(f"Missing run_benchmark.sh: {self.run_script}")
    if not self.system_prompt_file.exists():
        errors.append(f"Missing system_prompt.md: {self.system_prompt_file}")
    return errors