Background and cloud agents compared
PLBackground and cloud coding agents execute bounded engineering tasks inside remote containers or virtual machines and return a branch or pull request for verification. Claude Code cloud sessions, OpenAI Codex cloud, Cursor Cloud Agents, GitHub Copilot cloud agent, and Jules differ primarily across environment portability, trigger surfaces, containment boundaries, and billing models.
Teams adopt three coding tools in parallel, and every vendor now promotes agents that work while you sleep. One developer dispatches cloud sessions from the terminal, another schedules Cursor Automations, and a third assigns GitHub issues to Copilot—yet nobody can confirm which agent can push to which branch, which connectors carry write rights, or why monthly spend doubled. This guide gives developers, tech leads, and CTOs one architectural frame to select, contain, and verify remote runs. If your team cannot yet specify machine-checkable tasks, start at Level 4: write specs.
Match the background job to the execution pattern
Section titled “Match the background job to the execution pattern”Start from the engineering job rather than the vendor logo. Most teams standardize on one or two patterns and ignore the rest:
| Background job | Best-fit pattern | Architectural reason |
|---|---|---|
| Hand off a spec’d task and keep coding | On-demand cloud session (Claude Code cloud, Codex cloud, Cursor Cloud Agents, Copilot issue assign) | Clean isolated checkout returns a branch or draft PR without interrupting local worktrees |
| Generate multiple independent attempts at an uncertain bug | Multi-attempt cloud execution (Codex best-of-N attempts or scripted parallel cloud runs) | Comparing independent diffs against one reproduction test reduces first-attempt bias |
| Recurring repo hygiene (flaky tests, stale deps, lint debt) | Scheduled cloud automations (Claude Code routines, Cursor Automations, scheduled CI workflows) | Runs without a developer laptop awake and produces small, bounded PRs |
| Turn a production alert into a read-only diagnosis or draft fix | Webhook/API-triggered triage routine (Claude Code routines, Cursor Automations) | Alert payload kicks off investigation immediately while keeping production read-only |
| Babysit PR checks and review comments | Capped CI review-fix loop or PR auto-fix | Keeps feedback loops bounded and pushes fixes onto the feature branch (issue-to-PR pipeline) |
| Keep source code and build execution inside your VPC | Self-hosted runner/worker pools (Claude Code self-hosted, Cursor private workers, self-hosted GitHub Actions) | Keeps proprietary code, internal registries, and credentials inside your network perimeter |
Desktop app schedulers (such as local Codex automations) are the deliberate exception: they run locally against your working tree or worktree while the machine stays awake, fitting personal checks that depend on local state rather than team-wide unattended jobs.
Five architectural axes that separate cloud agents
Section titled “Five architectural axes that separate cloud agents”Every remote agent isolates compute in a container or VM. The security and reliability differences live in five boundaries—consult official vendor docs for exact session timeouts, CLI flags, SDK payloads, and current pricing:
| Axis | Claude Code cloud & routines | OpenAI Codex cloud | Cursor Cloud Agents & Automations | GitHub Copilot cloud agent | Jules |
|---|---|---|---|---|---|
| Environment & config | Managed Linux VM with cached setup script; reads repo CLAUDE.md/AGENTS.md, .claude/, project .mcp.json | Container with setup and maintenance scripts; reads AGENTS.md | Managed cloud VMs prepared via Builds; reads .cursor/rules/*.mdc and AGENTS.md | Ephemeral GitHub Actions VM configured by default-branch setup workflow | Cloud VM targeting GitHub repo and starting branch |
| Triggers | Manual (CLI/web/mobile), schedules, GitHub PR/release events, API fire endpoint | Manual (web/CLI), GitHub/GitLab review mentions, Slack/Linear delegation | Manual (editor/API/SDK), schedules, source control, Slack, Linear, Sentry, PagerDuty, webhooks | Issue assignment, @copilot PR mentions, GitHub automations | Web app, REST API, CI action triggers |
| Network & secrets | Configurable egress tiers (Trusted allowlist default); GitHub/API credentials proxied outside VM | Setup phase gets network and setup secrets; agent execution phase defaults offline without setup secrets | Isolated cloud VM with encrypted per-session env vars | Built-in egress firewall with dependency allowlist; repo Copilot secrets | Vendor-managed cloud sandbox with API key |
| Self-hosted path | Self-hosted enterprise environments | Check Codex docs for latest hosting options | Private workers / worker pools | Self-hosted GitHub Actions runners | Managed cloud only |
| Billing meter | Shared subscription allowance plus overage credits | Shared plan Codex allowance (multi-attempt multiplies usage) | Cloud Agent usage billed to API key / org account | GitHub Actions compute plus AI usage credits | Vendor plan quota |
Three boundaries teams overlook until an incident
Section titled “Three boundaries teams overlook until an incident”- Laptop-only config stays behind. Personal
~/.claude/instructions, user-scoped skills, and local MCP servers never reach a remote VM. Commit shared instructions, setup scripts, and project dependencies into the repository and audit portability withnpx @wondelai/harness-audit. - Event triggers widen your prompt-injection surface. Any public or loosely filtered issue, pull request, or webhook trigger lets external text steer an unattended agent. Restrict event triggers to maintainer-applied labels or write-access authors, strip unnecessary write-capable MCP connectors from scheduled routines, and treat any persistent cross-run memory as untrusted input (agent threat model).
- Track cost per merged PR, never cost per run. Parallel sessions, best-of-N retries, and per-push automations multiply token spend silently. An inexpensive run that produces an abandoned branch is pure waste—instrument cost per merged change (cost governance).
How to verify background agent output without watching the run
Section titled “How to verify background agent output without watching the run”Because nobody observes a remote session while it executes, proof must come from independent checks the agent cannot alter. A green status badge in a vendor dashboard only proves the container exited without an infrastructure crash.
- Require pull requests on every remote branch. Enforce default-branch rulesets blocking direct pushes and requiring status checks plus review.
- Re-run verification gates independently in CI. Execute lint, static types, unit/E2E tests, and fitness functions from the base branch in your CI pipeline. Only CI’s exit status counts.
- Protect the oracle. Guard test files, gate scripts, CI workflows, lockfiles, and agent config via
CODEOWNERSso an agent cannot pass checks by weakening them (protecting the oracle). - Require an evidence bundle. Publish executed checks, diff size, and touched sensitive paths on every remote PR so reviewers evaluate proof instead of scanning every line (evidence bundle).
- Enforce two-person human sign-off. Treat AI PR reviewers (Bugbot, managed Code Review, Codex review) as a defect-finding layer, keeping merge authority with an engineer other than the automation’s creator (reviewing agent PRs).
A portable task brief for unattended runs
Section titled “A portable task brief for unattended runs”Remote agents cannot ask clarifying questions at 2 a.m., so every brief must encode allowed paths, forbidden oracle files, deterministic exit commands, and stop rules. This template works unchanged across Claude Code, Codex, Cursor, Copilot, and Jules:
Adoption checklist for tech leads and CTOs
Section titled “Adoption checklist for tech leads and CTOs”Record these eight governance decisions in AGENTS.md or team policy before giving any remote agent repository write access:
| # | Governance question | Passing standard |
|---|---|---|
| 1 | Allowed vs excluded change classes | Allowed: tests, lint, bounded fixes, deps; excluded: auth, billing, migrations |
| 2 | Trigger authorization | Maintainer labels, schedules, or authors with verified write access |
| 3 | Identity & secret boundaries | Scoped service identity or named owner; test credentials only, zero production secrets |
| 4 | Network egress & MCP connectors | Narrowest build allowlist; offline execution where supported; write connectors pruned |
| 5 | Merge gates & oracle locks | Base-branch CI checks plus CODEOWNERS protecting tests and gate scripts |
| 6 | Human merge sign-off | Two-person rule separating automation owner from merge approver |
| 7 | Budget attribution | Monthly team ceiling, tagged runs, monthly cost-per-merged-PR review |
| 8 | Emergency kill switch | Org admin disable toggles verified for every approved vendor before rollout |
Failure modes specific to remote background runs
Section titled “Failure modes specific to remote background runs”- Cloud VM lacks local tools or config. Laptop-only rules and MCP servers stay local. Recovery: commit repo-scoped config and install toolchains in cached setup scripts.
- Session hits a hard runtime cap. Slow builds and suites exhaust hosted runner timeouts. Recovery: shrink task scope and warm dependencies during setup.
- Over-broad connectors act unprompted. Scheduled routines run without confirmation and may inherit personal MCP write tools. Recovery: prune connectors to the minimum read-only set.
- Untrusted payloads inject instructions. External issues or alert logs attempt to redirect execution. Recovery: delimit external text strictly as data and strip write tokens from agent jobs.
- Reclaimed VMs drop uncommitted state. Idle containers recycle ephemeral processes. Recovery: treat remote runs as stateless and commit progress to a feature branch.
- Unchecked triggers multiply spend. Per-push automations and multi-attempt retries fire silently. Recovery: trigger on explicit labels, cap retries, and monitor agent observability.
Official documentation and next steps
Section titled “Official documentation and next steps”Consult official vendor documentation for current CLI syntax, SDK APIs, runtime ceilings, and enterprise self-hosted options: Claude Code docs, OpenAI Codex docs, and Cursor docs.
Did this guide help you?
One tap, no sign-in.
What will you do with it?
How did it read?
What got in the way? Pick any that apply
Your role?
Thanks. I read every answer. Michał Jaskólski
Did this guide help?
One tap each. Close whenever you like.
no sign-in
Frequently asked questions
Which background coding agents run when your laptop is closed?
Claude Code cloud sessions and routines, Codex cloud tasks, Cursor Cloud Agents and Automations, GitHub Copilot cloud agent, and Jules all execute on remote infrastructure. Local desktop automations require the host machine to stay awake.
Why do remote cloud agents fail on setups that work locally?
User-level instruction files, personal skills, and local MCP servers stay on your laptop. Remote VMs see only what is committed to the repository and provisioned in the cloud environment's setup script.
How should you verify output from an unattended background agent?
Never trust the agent's status badge or self-report. Require a pull request, run base-branch CI gates independently, protect test and workflow paths through CODEOWNERS, inspect the CI evidence bundle, and enforce two-person human merge approval.
Can background coding agents run on self-hosted infrastructure?
Claude Code self-hosted environments, Cursor private workers, and GitHub Copilot on self-hosted Actions runners support keeping execution inside your own network perimeter. Check each vendor's official docs for current enterprise availability.