Long-running autonomous agents
Let an agent work on a task for days, with its files, tools and browser intact, waking on a schedule or a webhook.
For Research, audit, reporting and operations agents
Why it pays
- State that lasts Files, installed tools, browser profiles and the agent's conversation stay on the disk across stops.
- Pause without losing your place Sleep keeps memory and processes for a quick return; stop ends the bill when the gap is long.
- No babysitting Schedules wake the agent, webhooks tell you when it's done, and budgets stop it if it loops.
Step by step
Start the agent's machine with no auto-stop
Long jobs shouldn't be cut off by the default one-hour timer.
CLI
ID=$(harebox new --name analyst --no-auto-stop --label role=analyst | jq -r .id)Python
box = hb.create(name="analyst", ttl_seconds=None, labels={"role": "analyst"})TypeScript
const box = await hb.create({ name: "analyst", ttl_seconds: null, labels: { role: "analyst" } });Give it the job and a budget
Detach, so the turn runs on while you're away.
CLI
harebox prompt "$ID" "Each morning, read the new filings and update report.md" --harness claude --budget 5 --detachPython
hb.create_prompt(box.id, body={"prompt": "Each morning, read the new filings and update report.md", "harness": "claude", "budget_usd": 5})TypeScript
await hb.createPrompt(box.id, { body: { prompt: "Each morning, read the new filings and update report.md", harness: "claude", budget_usd: 5 } });Get told when it finishes
A signed webhook fires on every finished turn.
CLI
harebox webhook new --url https://example.com/hooks/harebox --events '["prompt.finished"]'Python
hb.create_webhook(body={"url": "https://example.com/hooks/harebox", "events": ["prompt.finished"]})TypeScript
await hb.createWebhook({ body: { url: "https://example.com/hooks/harebox", events: ["prompt.finished"] } });Wake it on a schedule
Stop it between runs, and let a schedule bring it back every weekday morning.
CLI
harebox stop "$ID" harebox schedule new --action resume --cron "0 7 * * 1-5" --target "$ID"Python
box.stop() hb.create_schedule(body={"action": "resume", "cron": "0 7 * * 1-5", "target": box.id})TypeScript
await hb.stopSandbox(box.id); await hb.createSchedule({ body: { action: "resume", cron: "0 7 * * 1-5", target: box.id } });
Tips
- Timers inside a sleeping VM don't fire. Use a HareBox schedule instead of cron for anything that must run on time.
- A detached dev server doesn't restart after a stop. Run it as a systemd service so it comes back on resume.
- Put a monthly budget on the label, so a looping agent stops at a ceiling you chose.
Related use cases
Untrusted and agent-written code
Run code you didn't write behind its own kernel, with secrets kept out of the machine and a firewall the code can't remove.
See the stepsHybrid local and cloud agents
Keep your coding agent on your laptop and send heavy builds, Docker stacks and parallel tests to HareBox, so the laptop stays quiet.
See the stepsPreview environments and live demos
Give every branch, pull request or prospect a running app at a private HTTPS URL that wakes when someone opens it.
See the steps

