Back to Research Notes

Running AI coding agents overnight

Define the task, limit access, review what can execute and prepare a recoverable checkpoint before leaving an AI coding agent working unattended.

Kind
Perspective, a working note
Published
Filed under
Agent security

Before leaving a coding agent working overnight, give it one bounded task, access only to what that task needs, and a clear reason to stop. Plan to review a tested change in the morning. Keep production deployment under separate human approval.

When I run unattended sessions with the team (the AI coding agents I direct), I treat the workspace, dependency tree, and approval queue as separate control layers. These are my recommendations for preparing unattended work, informed by the sources below and my agent security research. They do not certify a particular agent or environment as safe.

Five control layers for an unattended AI coding agent session Flow diagram across five layers: 1. Task and Scope Contract, 2. Host and Credential Isolation, 3. Locked Dependency Check (npm ci), 4. Action-Hash Approval Gate (BigBoss SQLite receipt), and 5. Morning Human Verification before any production deploy. Unattended agent control boundary: five gates before production Layer 1 Task contract Allowed files Target check Spend & step cap Stop on drift Layer 2 Access boundary OS user / container Read-only CI token No prod secrets Least privilege Layer 3 Install check npm ci Lockfile parity Inspect hooks Fail on mismatch Layer 4 (BigBoss) Action-hash gate sha256(cmd+ws+pol) Hold shell/writes SQLite decision log Adapter-enforced Layer 5 Morning review Diff & test log Rollback ready Human deploy Separate auth Host boundary reminder: A Git branch or local approval database does not isolate the OS process. Keep the approval API and production credentials outside the user or container account where the unattended agent executes.
Five control layers for unattended agent runs. Each layer catches a different failure mode while leaving objective selection, host isolation, and production deployment with a human operator.

Define the task and its limits

Write down the intended result, allowed files, checks to run, and time or spending limit. For example: repair a specific failing test and explain the change. Require the agent to pause if it needs unrelated files or broader permissions. In my 1,979-commit pull-request census of one repository, documentation-only changes were the largest share of the merged stream and none of 40 sampled pull requests had an independent human GitHub review, so merge volume alone told me little about progress.

A separate branch or checkout makes edits easier to review and undo. It does not restrict what a process can access. Use an execution environment whose actual file and network permissions match the task.

Separate development access from production access

Keep production credentials and unrelated personal files out of the agent’s environment. Provide only the credentials needed for the assigned work. Avoid placing secrets in prompts or logs.

For GitHub Actions, restrict token permissions to read-only by default and require human review before a deployment job receives protected environment secrets. GitHub also warns that log redaction is not guaranteed and that privileged workflows must not execute untrusted pull-request code. Review workflow changes as carefully as application changes. See GitHub’s secure-use guidance.

Review what an installation can execute

Check added packages, their sources, install hooks, and changes to build or test commands before an unattended run. A dependency or workflow update can change what executes even when the visible application change is small.

For npm projects, npm ci uses an existing lockfile and fails when it disagrees with package.json. It also removes an existing node_modules directory. Use it in the prepared workspace. A lockfile improves reproducibility; it does not establish that a dependency is safe.

Do not add --ignore-scripts blindly. Suppressing installation scripts can leave required setup incomplete, so check compatibility and run the project’s checks. Explicit commands such as npm test still execute their requested script with that option. Read the npm ci documentation for version 11.

# .github/workflows/verify-agent-branch.yml
# Minimal read-only verification for an agent's pull request
name: verify-agent-branch
on:
  pull_request:

permissions:
  contents: read

jobs:
  verify-agent-branch:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: '22'
      - name: Reproducible install without lifecycle hooks
        run: npm ci --ignore-scripts
      - name: Run deterministic checks
        run: npm test

Prepare recovery and stopping conditions

Save a known working revision and check that you can restore the files or data the task may change. Keep test results tied to the exact revision tested. In the morning, inspect the changes, failures, and unresolved questions before merging or deploying.

Require a stop for unexpected credential requests, access outside the task, unexplained network destinations, or unrelated attempts to create startup tasks or background services. A local approval queue such as BigBoss (verification record, release v0.1.0 at commit 10acc53, 399 passing tests) can hold shell commands and file changes for one human reviewer and tie each decision to a SHA-256 hash of the proposed action, workspace, and policy version, while the operator still provides host isolation. Investigate before granting more access. Preserve useful logs without copying secrets into the report.

Control Layer What It Catches What Still Requires a Human
Task and scope definition Unbounded edits, unclear stopping conditions, and runaway spend Choosing the right objective and verifying the final change
Environment and credential separation Accidental production writes and exposure of unrelated local secrets Provisioning least-privilege tokens and host or OS-user isolation
Dependency and workflow review (npm ci) Lockfile drift (package.json vs lockfile) and unreviewed workflow edits Inspecting new packages, install scripts, and untrusted pull-request code
Action-hash approval gate (BigBoss) Unapproved shell commands or file changes when an adapter enforces the hash Reviewing the proposed action and isolating the agent from the approval API
Tested checkpoint and recovery path Unrecoverable working-tree corruption after a failed overnight run Inspecting test results and approving any production deployment

What the self-replication research establishes

On October 12, 2026, Anthropic researchers William Zhou and Daniel Freeman reported experiments on AI self-replication. They tested inference setup on varied hardware and replication in a simplified, contained lab. In the replication evaluation, targets required no authentication, the acting model ran on a separate inference server, and successful setup triggered another agent copy.

The authors say they do not yet have a full rogue replicator. Their timeline for smaller models reaching the required capability is a forecast based on a general capability trend. These experiments do not measure the risk of an ordinary overnight coding session. They are a reason to take access boundaries seriously, alongside established software-security practices.

I wrote this note with research and drafting assistance from the team. This note reports no security incident at Simone Systems Research.

Before you leave

  • Specify one task, allowed files, and a stopping limit.
  • Check actual permissions and remove unnecessary credentials.
  • Review dependency, install-script, and workflow changes.
  • Save a tested checkpoint and a recovery path.
  • Set conditions that require the agent to stop for review.
  • Review the resulting change before a separately approved deployment.