Agent runs
Last updated: 6 December 2026 · CLI 0.5.0 · API v1 (beta)
An agent run starts an AI command-line agent (Claude Code, Codex, Gemini CLI, Aider or OpenCode) on a clean hadronbox machine for you. You give a repository address and a task; hadronbox starts the machine, installs the agent, clones the repository, runs the task headless and leaves the result: exit code, changed file count, change summary and the agent's output.
Private repositories on GitHub only. The address must be under
https://github.com,https://gitlab.comorhttps://bitbucket.organd cannot hold a user name, password, port or query. For a private GitHub repository set up the GitHub integration; on other providers only public repositories work and no access key is given to the machine.
How it works
- Queue: The request is accepted with
202and the run entersqueued. - Machine: A new machine of the size you chose, with the agent's tool installed, is started (
provisioning). - Install: The agent's tool is installed on the machine (
installing). - Repository: The repository is cloned with
git clone --depth 50(cloning). You may give a branch. - Agent: The task is given to the agent in headless mode (
running). The task text is never put on a command line; it is written to a file on the machine. - Result: The exit code, the changed file count and the
git diff --statsummary are stored. The machine is paused; withdestroyOnFinishit is deleted.
End states: succeeded (the agent ended with code 0), failed (failureReason gives the cause), timed_out (the time limit ran out) and cancelled.
From the panel
The Agents menu (AUTOMATION section) lists the runs. In the Run an agent form you enter the repository address, the branch, the task, the agent, the secrets the agent uses, the machine size, the time limit and "Delete the machine when it ends". A run's page shows the steps, the live output, the result and a Cancel run button.
With the CLI
hb run starts a run and hb runs manages runs (CLI 0.5.0 and later, not published yet). The API key needs the agent_runs:write and agent_runs:read scopes.
hb run \
--repo https://github.com/acme/web \
--task "Fix the failing date parsing test" \
--agent claude-code \
--secret ANTHROPIC_API_KEY \
--follow
Give a long task from a file: --task @task.md. --follow streams the output and exits with the run's exit code when it ends. Other commands: hb runs ls, hb runs show <id>, hb runs logs <id>, hb runs cancel <id>. See the CLI reference.
With the REST API
curl -sS https://api.hadronbox.tr/v1/agent-runs \
-H "Authorization: Bearer $HADRONBOX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"repoUrl": "https://github.com/acme/web",
"task": "Fix the failing date parsing test",
"agent": "claude-code",
"secrets": ["ANTHROPIC_API_KEY"]
}'
The answer is 202 with the run. Follow its status with GET /v1/agent-runs/{id}, stream the output with GET /v1/agent-runs/{id}/output (Server-Sent Events) and cancel with POST /v1/agent-runs/{id}/cancel. All fields are on the endpoints page.
Comparing agents
You give the same task to 2 to 4 agents at once; each agent runs on its own clean machine and the results are shown side by side. There is no automatic scoring and no merging of a winner; you judge the result.
- Panel: Start it with Compare on the Agents page. The comparison page shows each agent's status, duration, estimated cost, changed file count, change summary and the run and machine links in one table. From the same page you cancel every run, and pause or delete the group's machines together.
- CLI:
hb run --repo … --task … --agents claude-code,codexprints a comparison id (rgrp_…);hb runs compare <id>shows the results side by side (CLI 0.5.0 and later, not published yet). - API:
POST /v1/agent-run-groups,GET /v1/agent-run-groups,GET /v1/agent-run-groups/{id}andPOST /v1/agent-run-groups/{id}/cancel. The scopes are the same as for a single run:agent_runs:readandagent_runs:write. - Capacity: All agents run at the same time and each opens a machine. If the total number of machines does not fit your package's machine limit, your balance and your spend budget together, none starts and the answer is
402(PLAN_LIMIT_MACHINES,CREDIT_INSUFFICIENTorBUDGET_EXCEEDED;details.requestedis the number asked for anddetails.remainingthe number that can open). There is no queueing: on the Beta package's limit of 2 machines, 3 or 4 agents cannot be started. - Cost: Each agent's machine minutes are multiplied by the current price list and the total estimate is shown on the comparison; the settled amount appears in usage on the Balance page. The start form also shows the hourly estimate.
- Every agent in a comparison takes one place of the limit of 5 unfinished runs.
The agent's key
For the agent to reach its model provider it needs an API key (for example ANTHROPIC_API_KEY). Save the key on the Secrets page first and give only its name in the run; the value never travels through this API.
- A selected secret is given to this run's machine only, as an environment variable. Secrets whose scope is "all machines" are in every machine of your organization anyway.
- The agent and the code in the repository can read the key. Use a limited key that is separate for this job, and put a spending limit on it.
- Known secret values are masked as
***in the output and in the stored output tail. Masking is an extra measure, not a guarantee. - The webhook payload carries no task text, output or secret value.
Limits and cost
- At most 5 unfinished runs per organization; more answers
409AGENT_RUN_LIMIT. Your package's machine limit applies too. - A run gets a time limit of at most 60 minutes. Longer jobs are not in this release.
- The minutes of the machine started for the run are metered as usual (Credits and pricing); there is no separate agent fee. When the spend budget or the balance is not enough the run does not start:
402BUDGET_EXCEEDEDorCREDIT_INSUFFICIENT. - The live output is followed on the server that runs the run only; when the stream drops, the stored last part is read once the run ends.
Failure reasons
The failureReason of a failed run is one of:
When a run ends, an agent.run.completed or agent.run.failed webhook event is sent (Webhooks). A cancelled run sends no event.