How dflippojr/agent-harness works
Agent Harness is a self-hosted platform for running coding agents through a daemon, with browser, CLI, SDK, and app-API clients. The main workflow is: a client submits a task; the session manager coordinates the agent loop; policy gates tool calls; tools execute in a sandbox or remote runner; model and tool results return to the session, whose work is persisted for review. The graph also includes documented GPU/image scheduling, configuration, search, skills, and benchmarking capabilities. Several implementation links rely on README architecture statements because the corresponding source was not sampled.
Main entry points: runner.py Agent Loop · manager.py Session Manager · api.py REST APIs · policy.py Approval Policy
Components 24
Client Interfaces
- PWA
harness/web/app.js - CLI
harness/cli.py - Python SDK
sdk/harness_client.py
Agent Runtime
- REST APIs
harness/api.py - App API
harness/apps.py - Session Manager
harness/manager.py - Agent Loop
harness/runner.py - Approval Policy
harness/policy.py
Execution and Models
- Workspace File Tools
harness/fileops.py - Docker Sandbox
harness/sandbox.py - Remote Runner
harness/remote.py - Mac Runner
macrunner/harness_runner.py - Hosted CLI Backends
harness/cli_backends.py - GPU Scheduler
harness/scheduler.py - Local Model Interface
harness/llm.py - Image Generation
harness/images.py
Platform Services
- SQLite State
harness/db.py - Session Search
harness/search.py - Projects and Branches
harness/projects.py - Settings Service
harness/settings_service.py - Configuration
harness/config.py - Agent Skills
harness/skills.py
Evaluation
- Agent Benchmarks
bakeoff/tasks.py
Other components
- Owner / User
Connections 26
- Owner / User → PWA: uses
README.md - Owner / User → CLI: uses
README.md - Owner / User → Python SDK: uses
README.md - PWA → REST APIs: requests
README.md - CLI → REST APIs: requests
README.md - Python SDK → REST APIs: requests
README.md - REST APIs → Session Manager: dispatches
harness/apps.py - App API → Session Manager: drives sessions
harness/apps.py - Session Manager → Agent Loop: coordinates
harness/manager.py - Agent Loop → Approval Policy: classifies calls
README.md - Approval Policy → Owner / User: requests approval
README.md - Agent Loop → SQLite State: persists events
README.md - Agent Loop → GPU Scheduler: requests inference
README.md - GPU Scheduler → Local Model Interface: schedules model
README.md - GPU Scheduler → Image Generation: schedules images
README.md - Agent Loop → Docker Sandbox: executes tools
README.md - Agent Loop → Hosted CLI Backends: dispatches backend
README.md - Approval Policy → Docker Sandbox: authorizes execution
README.md - Agent Loop → Remote Runner: dispatches remotely
README.md - Remote Runner → Mac Runner: runs worker
README.md - Docker Sandbox → Workspace File Tools: uses workspace tools
- Session Manager → Projects and Branches: prepares project
harness/manager.py - SQLite State → Session Search: indexes sessions
README.md - Settings Service → Configuration: applies configuration
harness/settings_service.py - Agent Loop → Agent Skills: uses skills
- Owner / User → Agent Benchmarks: evaluates agents
README.md