AI Harness is a policy-governed system for running software tasks in local Git repositories through one command-line interface: agent.
It prepares task branches or worktrees, runs bounded implementation and verification workflows, preserves recovery checkpoints, and stops for human input when a decision cannot be made safely. Merge and deployment always remain human actions.
- macOS or Linux
- Git
- Python 3.11 or newer
- Codex CLI with an authenticated local subscription
The installer creates an isolated application environment and does not require sudo.
Download and unpack the repository, open a terminal in that directory, and run:
cd ~/Downloads/agents-main
./install.shYou can also install directly from the official repository:
curl -fsSL https://raw.githubusercontent.com/mdvcode/agents/main/install.sh | shIf the shell does not immediately find agent, open a new terminal or refresh its command cache:
hash -r
agent --versionInitialize a target project and verify the complete runtime:
cd /path/to/project
agent init
agent doctor --fullStart a task and follow its progress:
agent task "Fix startup and add a regression test"
agent watchOr use the local browser dashboard:
agent dashboardagent task starts the background worker automatically when needed. The project checkout must be clean before a task can create or switch branches.
agent init creates .agent/project.yaml and, when absent, AGENTS.md. If Git already ignores either file, keep it local and do not force-add it. Otherwise, commit the new file or add a repository-approved ignore rule before starting work.
The default mode is auto:
agent task "Fix a typo in the settings page"
agent task --mode fast "Apply a small local styling change"
agent task --mode full "Refactor the authentication architecture"
agent task --mode goal "Complete a checkpointed multi-hour objective"| Mode | Behavior |
|---|---|
auto |
Uses the guarded fast workflow for ordinary work and selects the full workflow when the goal names sensitive or broad changes. It never selects goal. |
fast |
Runs the short workflow for at most 15 minutes, with implementation and review as the only model-backed roles. Context, quality, security, and verdict stages are deterministic. |
full |
Runs the complete specialist workflow for at most 60 minutes. |
goal |
Explicitly runs a checkpointed long objective for at most 4 hours. Use it only when the success condition genuinely needs multiple hours. |
Fast mode automatically escalates to the full workflow before publication if the patch touches protected areas, changes more than five files, exceeds 200 changed lines, or reports increased risk. Required checks and approval gates are never bypassed. The 30-minute role timeout is an emergency limit for one model executor, not the duration of the whole task; workflow, recovery, iteration, and human-attention limits are tracked separately.
By default, a task creates or selects a dedicated task branch in the current checkout:
agent task --task-id fix-startup "Fix startup"Use the clean, already checked-out non-default branch:
agent task --current-branch "Continue work on this branch"Use an isolated Git worktree for intentional parallel work:
agent task --worktree --task-id parallel-fix "Run this task in parallel"Configure generated branch names or a different base branch during initialization:
agent init --force --base-branch develop
agent init --force --branch-prefix team/backend/When execution needs information, agent status or agent watch prints an ATTENTION REQUIRED block and the exact next command. Answer the same run without starting a replacement task:
agent answer <run-id> "Use the existing API and preserve backward compatibility"
agent watch --run-id <run-id>Do not include passwords, tokens, private customer data, or other secrets in an answer.
Risk, security, protected-path, and publication decisions require an explicit scoped approval:
agent approve --run-id <run-id> --reason "Reviewed the reported scope and risk"Use answer for missing information and approve only for the exact authority request shown by the system.
Run agent <command> --help for the complete generated option list.
agent --version
agent update
agent update --source /path/to/new/ai-harness
agent update --jsonagent --versionprints the installed version.agent updateinstalls the latest version and restarts the worker service.--sourceinstalls an explicitly selected local folder,git+https, orgit+sshsource.
agent init [--repo PATH] [--project-id ID]
[--profile auto|agent_workspace|django|nextjs_web]
[--base-branch BRANCH] [--branch-prefix PREFIX]
[--force] [--replace-agents] [--json]--profileselects or auto-detects the project validation profile.--forcereplaces.agent/project.yamlwhile preserving an existingAGENTS.md.--replace-agentsallows--forceto replaceAGENTS.mdas well.
agent task [--repo PATH] [--task-id ID] [--branch BRANCH]
[--current-branch | --worktree] [--keep-paused]
[--mode auto|fast|full|goal] [--priority -100..100]
[--max-retries 0..10] [--dry-run] [--json]
"TASK DESCRIPTION"--dry-run --jsonvalidates and displays the task envelope without switching branches, starting workers, or changing queue state.--keep-pausedprevents a new task from replacing an older paused task that owns the same checkout.- Reusing the same explicit
--task-idreturns the existing queue item instead of creating a duplicate.
agent start [--repo PATH] [--workers 1..32] [--json]
agent stop [--json]
agent worker status [--json]
agent worker start [--workers 1..32] [--json]
agent worker restart [--workers 1..32] [--json]
agent worker stop [--json]agent startvalidates the current project and proactively starts workers. It is optional becauseagent taskstarts them when necessary.agent stopandagent worker stopgracefully stop the persistent service.agent worker ...controls the service directly without performing project startup validation.
agent dashboard [--repo PATH] [--port PORT] [--no-open]The dashboard binds to loopback, opens in the default browser, and provides task launch, execution-mode (auto, fast, full, or explicit goal) and Git-workspace selection, status, structured answer choices with a custom-answer fallback, approval, retry, and abort controls. Answered questions are fingerprinted so the same question cannot silently reopen in a loop. --no-open starts the server without opening a browser. Ctrl+C stops the dashboard server but does not stop the worker service.
agent status [--repo PATH] [--limit 1..100] [--json]
agent watch [--repo PATH] [--task-id ID] [--run-id ID]
[--interval SECONDS] [--timeout SECONDS] [--json]statusshows compact project, queue, run, and worker state without raw model transcripts.watchfollows state transitions until completion or human attention and returns after 30 minutes by default. Use--timeout 0only when an intentionally unbounded terminal wait is desired; if the worker service is down,watchreturns immediately with the start command.
agent failures [--repo PATH] [--run-id ID] [--limit 1..500] [--json]
agent dead-letters [--repo PATH] [--limit 1..500] [--json]failureslists structured failures and their recovery decisions.dead-letterslists tasks whose bounded automatic recovery budget is exhausted.
agent retry <run-id> [--repo PATH] [--json]
agent resume <run-id> [--repo PATH] [--json]
agent abort <run-id> [--repo PATH] [--json]retryretries an existing failed or paused run after its underlying problem has been corrected.resumecontinues an existing recorded checkpoint.abortcancels the run, terminates its active process group when necessary, and preserves its branch, worktree, and run records.
agent answer <run-id> "RESPONSE" [--repo PATH] [--actor NAME] [--json]
agent approve [--repo PATH] [--run-id ID]
[--actor NAME] [--reason TEXT] [--json]answersupplies missing information and resumes the same checkpoint.approveconsumes one pending scoped approval. When only one eligible run exists,--run-idmay be omitted.
agent doctor [--repo PATH] [--json]
agent doctor --full [--repo PATH] [--json]The ordinary diagnostic checks installation resources, recovery policy, project configuration, local trust, Git state, Python dependencies, Codex CLI availability, and worker health. --full additionally performs the authenticated runtime preflight and may take longer.
agent doctor --full
agent status
agent failures
agent dead-letters
agent worker statusIf the worker is unhealthy after an update:
agent worker restart
agent doctor --fullDo not edit queue database rows or workflow state files manually. The recovery commands preserve authoritative run identity, checkpoints, leases, and task workspaces.
- The checkout must be clean before branch switching.
- Protected paths, secrets, authentication, billing, payments, migrations, and production infrastructure receive elevated handling.
- Failed or unavailable required checks cannot be published as successful.
- Low- and medium-risk work may be prepared for review only when repository policy allows it.
- The system never auto-merges or deploys.
- Private run state, raw events, and local memory remain in the Harness control plane and must not be copied into public project output.
From this repository:
make validate-artifacts
make security
make checkmake check validates contracts, runs the security scan and complete test suite, and checks the Git diff for whitespace errors.