Skip to main content
Custom agents are integrations developed outside Harbor’s built-in registry. They may be local work in progress or private integrations not intended for upstream. A custom agent can be either installed or external.
When adding a new agent locally or integrating one into Harbor, prefer BaseInstalledAgent. Most agent integrations follow this design. Use BaseAgent only when the agent loop must remain outside the task environment.
Choose the base class based on where the agent runs.
Extend BaseInstalledAgent when Harbor should install and run the agent CLI inside the task environment.
my_agent.py
Use exec_as_root for system packages and exec_as_agent for user-level installation and execution. Override populate_context_post_run to parse usage or trajectory data after the logs are synced.

Run a custom agent

Custom agents are not registered by name, so pass module.path:ClassName to --agent (-a). The module must be importable from the Harbor process.
Use --model (-m) if the agent takes a model, --agent-kwarg (--ak) for other constructor options, and --agent-env (--ae) for environment variables.

Custom agent example

See a complete BaseAgent implementation in the Harbor repository.