Background agent
A background agent is an LLM-driven worker that runs asynchronously — receives a task, executes for minutes/hours without a user attached, posts results when done. Cursor's Background Agents, Claude Code's async tasks, Devin are 2026 examples.
Synchronous chat agents block the user while running. Background agents flip that: queue a task ('fix this issue', 'review this PR', 'write this report'), the agent runs in a sandbox ([[agent-sandbox]]) for minutes or hours, results post to a channel / PR / inbox when ready. The pattern unlocks longer reasoning chains, more thorough multi-step work, and parallelism (10 agents on 10 issues at once). Production examples in 2026: Cursor Background Agents, Claude Code task queue, Devin, Replit Agents, Charlie Labs, Trae. Engineering challenges: durable execution ([[workflow-engine]]), credit / cost limits, prompt injection safety (background agents run with elevated permissions), result notification, and observability of long traces.
When to use background agent
- Long-horizon tasks where blocking the user is wasteful.
- Parallelizable work (review N PRs, fix M issues).
Common mistakes
- Skipping sandbox — background agents run with elevated trust, blast radius is huge.
- No cost cap — runaway agent can burn $100s before anyone notices.
FAQ
What is background agent?
A background agent is an LLM-driven worker that runs asynchronously — receives a task, executes for minutes/hours without a user attached, posts results when done. Cursor's Background Agents, Claude Code's async tasks, Devin are 2026 examples.
When should I use background agent?
Long-horizon tasks where blocking the user is wasteful. Parallelizable work (review N PRs, fix M issues).
What are the most common mistakes with background agent?
Skipping sandbox — background agents run with elevated trust, blast radius is huge. No cost cap — runaway agent can burn $100s before anyone notices.
Related terms
- Agent sandbox — An agent sandbox is the isolated execution environment where an LLM-driven agent runs code, browses, or controls a desktop — the safety boundary that contains prompt-injection blast radius.
- Workflow engine — A workflow engine is the orchestration runtime — n8n, Make.com, Zapier, Temporal, Airflow — that executes multi-step business processes, handles retries, manages state, and integrates with external systems.
- Stateful agent — A stateful agent persists state — memory, learned facts, long-running context — across sessions, in contrast to stateless agents that start fresh on every conversation.
Last updated: 2026-06-01. Raw markdown: https://promtable.com/glossary/background-agent.md.