Overview
TheBaseAgent abstract class defines the interface that all Harbor agents must implement. Extend this class to create custom agents that can be evaluated using Harbor’s framework.
Import: from harbor.agents.base import BaseAgent
Class Attributes
bool
default:"False"
Whether the agent supports Harbor’s Agent Trajectory Interchange Format (ATIF). Set to
True in subclasses that can produce trajectory data.Path
required
Directory where agent logs should be written.
str | None
The model identifier in format
provider/model-name (e.g., anthropic/claude-opus-4-1).logging.Logger
Logger instance for the agent.
list[MCPServerConfig]
MCP (Model Context Protocol) servers available to the agent from task configuration.
str | None
Path to the skills directory in the environment.
Constructor
Path
required
Path where logs should be written.
str | None
Model identifier. If it contains
/, it’s split into provider and model name.logging.Logger | None
Optional logger. If not provided, uses the global Harbor logger.
list[MCPServerConfig] | None
MCP servers from task config to register with the agent.
str | None
Skills directory path in the environment.
Abstract Methods
These methods must be implemented by all subclasses.name
"claude-code", "openhands").
str
required
The agent’s identifier name.
version
str | None
required
Version string or None if version is unknown.
setup
- Install agent dependencies
- Register MCP servers from
self.mcp_servers - Copy skills from
self.skills_dirto the agent’s expected location - Configure the agent
BaseEnvironment
required
The environment in which to setup the agent.
run
str
required
The natural language task instruction for the agent.
BaseEnvironment
required
The environment in which to complete the task.
AgentContext
required
Context object to populate with execution results (tokens, cost, trajectories, metadata). Should be populated during execution to preserve data even on timeout.
Instance Methods
to_agent_info
AgentInfo object for result tracking.
AgentInfo
Information about the agent including name, version, and model details.
import_path
str
Formatted as
'some.module.path:AgentClass'.Example Implementation
Related Types
- BaseEnvironment - Environment interface
- AgentContext - Context for agent execution data
- AgentConfig - Agent configuration