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.
In more detail
What it means
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.
Part 1 of 2
When to use it, and when not
Use it for
- Long-horizon tasks where blocking the user is wasteful.
- Parallelizable work (review N PRs, fix M issues).
Part 2 of 2
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
Questions readers ask.
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 you use background agent?
Long-horizon tasks where blocking the user is wasteful. Parallelizable work (review N PRs, fix M issues).
What are the 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.
Last updated: 2026-06-01. Raw markdown: https://promtable.com/glossary/background-agent.md. Found a mistake? Tell us.