Run coding agents overnight, unattended and safely
Chris Rupp
Start with the risks
An unattended coding agent can delete files, expose credentials, install a compromised dependency, spend money, or publish a broken change while nobody is watching. Tests can pass while the requested behavior is wrong. Repository content and tool output can contain malicious instructions. Queueing work before bed is a convenience, not a safety guarantee.
Begin with a small task you have already run successfully while present. Keep production credentials and destructive infrastructure access out of its environment. Require a human decision before production publication when failure would be costly. If you cannot establish a boundary you trust, leave the job waiting for review.
Sandboxing and permission modes
A Git worktree separates branches and working files. It does not prevent a shell command from reaching the rest of your machine, your network or external services. Use an enforced execution sandbox, a restricted container or a VM as appropriate, and inspect what it can mount and reach.
For Claude Code, consult Anthropic’s sandbox documentation and permission modes. The built-in shell sandbox covers shell commands; file tools, MCP servers and hooks have separate exposure. It supports macOS, Linux and WSL2; native Windows commands run unsandboxed. Permission bypass is intended for isolated environments. Review unsandboxed retries and allowed tools before leaving a job alone.
For Codex, OpenAI’s sandbox and permission documentation distinguishes execution boundaries from approval behavior. workspace-write bounds routine writes; on-request asks before crossing the boundary. never suppresses approval prompts without itself adding isolation. danger-full-access removes sandbox restrictions. Check the effective configuration and network policy on the machine doing the work. A job that needs a human approval may wait until morning; that is an acceptable outcome.
For scripted Claude Code runs, Anthropic’s headless guidance covers programmatic execution. A noninteractive invocation still needs deliberately configured permissions and a controlled environment. Do not make a blocked job run by granting blanket access.
Queue a bounded batch in Orbit
- Write a concrete outcome, allowed scope, acceptance checks and stopping conditions for each prompt. Separate dependent tasks so later work cannot assume an unfinished result.
- Review the prompts before approving them. Follow Queue & Approve and keep sensitive work pending if you need to inspect it first. Queue approval authorizes work to start; repository merge approval is a separate decision. See approval before an agent merges code.
- Use Orbit’s Sandbox for per-prompt worktree isolation and inspect the cumulative diff before promotion. Configure the agent’s execution restrictions separately.
- Run a small supervised trial with the same tools and credentials. Confirm where logs and results appear, and what happens when permission or budget is unavailable.
Spend caps and alerts
Set a budget you are willing to lose and enforce it at the billing authority where possible. Limit batch size and concurrency, and check that retries or model overrides cannot silently expand the intended spend.
Orbit’s Spend Gate has a soft cap for subscription coverage and a hard daily ceiling that blocks further Sivants-billed calls. BYOK calls are exempt: calls through your own provider keys are not counted or blocked by those thresholds. Configure and verify provider-side limits separately for those calls. Check whether a provider control actually blocks requests or merely sends an alert.
The Tripwire Alert shows a persistent banner when a model outside the Sivants-covered allowlist produces a billing event. It is an alert to investigate routing and charges, not a universal spend cutoff. A banner does not help a sleeping operator unless the underlying limits already contain the risk.
Secrets and external actions
Use scoped, revocable credentials and test data. Orbit’s Vault encrypts secrets locally at rest and supports project scoping. Once a credential is made available to a running tool, that tool can use it; storage encryption does not constrain its authority. Avoid broad production keys, review connected integrations and inspect output for accidental disclosure.
Keep a recovery path: a known good commit, recoverable data and an account that can revoke the agent’s credentials. For several machines, review multi-node setup and ownership before assigning a batch.
What to review in the morning
- Compare every completion with the original request. Identify waiting, failed and incomplete tasks before releasing dependent work.
- Inspect the implementation commit and full diff, including lockfiles, permissions, workflow files and changes outside the requested scope.
- Read actual command results and rerun the checks that establish the requested behavior. Investigate skipped checks and contradictory output.
- Check the publication branch and deployment state. An agent’s summary does not prove that a change reached users.
- Review provider usage, model routing, Tripwire banners and budget overruns. Investigate unexpected charges or possible secret exposure before the next batch.
- Promote or merge only the work you have reviewed, and record what remains unverified.
Use the commit, diff and tests checklist for the handoff. The safest overnight result can be useful work waiting for your decision.