Background agents
A background agent task runs Claude or Codex on a cloud workspace without a window open. Start one by hand, on a schedule, from a webhook or when a service keeps failing; review the diff when it is done, then apply it or promote it to a release.
Because the agent runs where your app runs, it can read the live logs, run the tests and call the real URL. You can close IZ Code meanwhile; you get a notification, and an email if you asked for one, when it finishes.
flowchart TD
start["By hand, schedule, webhook or service health"] --> where{"Where"}
where -- "Live" --> live["Edits the workspace"]
where -- "Fork" --> fork["Edits a disposable copy"]
live --> review["Review summary and diff"]
fork --> review
review --> apply["Apply to workspace"]
review --> promote["Promote to a release"]Start a task#
- Open Agent tasks On the workspace page, open Agent tasks and choose New task.
- Describe the work Fill in What should the agent do? Nobody can answer the agent's questions, so it makes assumptions, lists them and ends with a summary.
- Pick the agent and where it runs
Agent:
claude(default) orcodex. Where: Live or Fork. - Pick what it may do Choose Plan only, Edit files or Full access, and optionally change the Limits.
- Start task Tick Email me when it finishes if you want an email. Ctrl/Cmd+Enter also starts it.
Live or fork#
| Live | Fork | |
|---|---|---|
| Where | The workspace itself, with its dev secrets | A disposable copy of the workspace, with only the dev secrets |
| Effect | Edits land in the workspace files at once | The live site is never touched |
| Result | Review the diff of what it changed | Review the diff, then Apply to workspace or Promote |
| Plan | Every plan with cloud workspaces | Forks at once: 1 on PRO, 3 on ULTRA, 5 on ENTERPRISE |
On a host serving the live workspace, edits reach visitors immediately, so a live task that may edit asks you to confirm. Fork is the default there. A fork is kept for a while after the task ends so you can promote it, then removed; the task shows how long is left.
What the agent may do#
| Level | Live | Fork |
|---|---|---|
| Plan only | Reads the code and proposes changes in its summary. Changes nothing. | Same |
| Edit files | Reads, edits, searches and fetches. Cannot run commands: no builds, tests or installs. | Also runs commands and may stage and commit with Git |
| Full access | Not available | Everything, including commands |
Git push is never allowed, at any level.
Limits#
| Limit | Range | Default |
|---|---|---|
| Minutes | 1–240 | 30 |
| Turns | 1–500 | 40 |
| Tool calls | 1–5000 | 400 |
| Cost (USD) | any positive amount | no limit; applies only when the agent reports its cost |
Your plan also limits tasks running at once (1 on PRO, 3 on ULTRA, 5 on ENTERPRISE) and task minutes per month (600, 3,000, 10,000).
Review the result#
Open a task to see its Summary, the Changes as a side-by-side diff per file, and what started it. Open in chat shows the whole conversation in the chat panel when the window is connected to the workspace.
| Button | What it does |
|---|---|
| Apply to workspace | Applies the patch to the workspace's files with a three-way merge. If any file conflicts, nothing is applied and the files are listed. The workspace must be running. |
| Promote | Fork tasks only. By default applies the patch to the workspace, then captures a new release of the host. Promote the fork exactly releases the fork as the agent left it. Serve this release right away serves it once captured. |
Nothing reaches the site until you apply or promote ("Awaiting review"). A patch larger than 2 MiB can be reviewed in part but not applied; only an exact promote is possible then.
Triggers#
On the Triggers tab, choose Add trigger:
| Kind | Fires when | Options |
|---|---|---|
| Schedule | A cron expression is due (5 fields, or 6 with seconds first), at most every 15 minutes | Timezone; presets Every hour, Every day at 03:00, Weekdays at 09:00, Mondays at 03:00 |
| Webhook | A signed POST reaches the trigger's URL | The request body (up to 16 KiB) is given to the agent as untrusted data |
| Service health | A service stays in a chosen state (default Crash loop and Unhealthy) for some minutes | The service's recent logs are given to the agent |
Every trigger has a Cooldown (min) (0–10080) and At most per day (1–1000). A trigger does not start a new task while its previous one is still running. A workspace can have at most 20 triggers.
Sign a webhook#
When you create a webhook trigger, IZ Code shows its signing secret once. Copy it to the caller; New secret replaces it. Each request needs the header X-Izcode-Signature: sha256=<hex>, the HMAC-SHA256 of the exact request body with the secret. X-Idempotency-Key is optional and stops duplicates.
BODY='{"event":"deploy-failed","detail":"checkout returns 500"}'
SIG=$(printf '%s' "$BODY" | openssl dgst -sha256 -hmac "$IZCODE_WEBHOOK_SECRET" | sed 's/^.* //')
curl -X POST "$WEBHOOK_URL" \
-H 'Content-Type: application/json' \
-H "X-Izcode-Signature: sha256=$SIG" \
-H "X-Idempotency-Key: $(uuidgen)" \
--data "$BODY"WEBHOOK_URL is the URL shown for the trigger. Requests with a missing or wrong signature are refused; calls are rate-limited per trigger. Webhook triggers need a verified email address.
Sign the agent in#
The agent runs on the workspace, so it needs its own sign-in there. Until it has one, tasks stop with auth_required. Do one of these once:
- Open a chat with the agent in the workspace and sign in, or run
claudein a workspace terminal and log in. - For Claude, run
claude setup-tokenon your own computer and add the token as the dev secretCLAUDE_CODE_OAUTH_TOKEN.ANTHROPIC_API_KEYworks too. - For Codex, sign in once in the workspace or add its API key as a dev secret.
The next start of the agent picks up a new secret.
Task states#
Queued, Forking, Preparing, Running, Finishing, then Done, Failed, Cancelled, Timed out or Interrupted. If the workspace restarts during a task, the task is resumed when the budget allows. Retry starts a new task with the same settings.
Related#
auth_required and other task errors.Fix problems