Two kinds of agent
An agent is a model given a goal, a set of tools and permission to use them in a loop until the goal is met or a budget runs out. Here that covers two very different things, and keeping them apart is how you neither over-trust the automation nor under-use it.
| The build agent | A standing agent | |
|---|---|---|
| When it runs | Inside every build, on every plan. You do not switch it on. | After the build has ended, on a cadence or an event — only once you install it. |
| What it does | Reads the code, plans, writes files in a disposable sandbox, runs commands, then checks and repairs its own output. | Either checks that a URL is up, or runs a prompt against the project. |
| Where you see it | The build’s verdict, its Verify surface and its trace. | The project’s Agents tab — yours to add, pause and delete. |
Everything below is what the system does today. Where a behaviour is opt-in, it says so; where something needs a human, it says who and when. For the surrounding product — preview, deploy, repository, environment — start at the getting-started guide.
Automatic repair inside every build
The real autonomous correction. It happens whether or not you ever open the Agents tab — four parts, in the order they run.
- Four gating checks, in order. Typecheck, then the test script, then the production build, then a scan of the dev-server log for runtime and compile errors. Each check records whether it passed and why it failed, so a past build stays inspectable.
- Up to three repair rounds. A failing check hands the agent the failure output. It repairs and re-checks, up to three rounds inside one plan — and if that still does not get it green, it takes one full replan rather than retrying the same edit.
- A behavioural and a visual pass. A second reviewer with none of the build’s history judges the diff against what you asked for and clicks through the running preview. A separate visual pass crawls the rendered pages. Both can seed one more repair.
- Accepted only when green and in scope. A build is accepted when the checks pass and the diff matches what was asked for. Anything else is held for your review with the verdict and the reason attached — it is never shipped broken.
typecheck npm run typecheck (or tsc --noEmit)
tests npm test --if-present
build npm run build --if-present
preview scan the dev-server log for runtime errors✗ typecheck failed — repairing (round 1 of 3)
✓ typecheck
✓ tests
✓ build
✓ preview — no runtime errors in dev log
verdict: acceptWhat “held for review” means
A build ends with one of three verdicts: accepted, held for review, or rejected. Held means the agent finished but is not confident enough to call it done — a check it could not get green, or a diff that drifted outside what you asked for. You get the verdict, the reason and the list of files it touched, and you decide. A rejected run also fires a lifecycle event, so a standing agent subscribed to run_rejected can act on it. With a repository connected, accepted work reaches you as a pull request rather than a commit on your default branch.
- The four gating checks are the same on every plan. The build tier decides how many extra repair rounds the behavioural and visual passes get — none on a prototype build, one each on a standard build, two each at the highest tier.
- A JavaScript project with no TypeScript config, or a project with no test script, records that check as skipped rather than inventing a pass.
- If the behavioural or visual harness cannot be reached, that pass records as skipped and does not block your build — the four deterministic checks still gate it.
- A separate security scan runs when you Go Live, and a P0 finding blocks the publish outright.
Standing agents
Three shapes. They differ less in how they are triggered than in what they are permitted to touch: a health check observes, a prompt agent acts.
| Agent | How it fires | What it does | Cost per run |
|---|---|---|---|
| Health check | On a cadence — every 5 minutes at the fastest | One GET against your preview or live URL, capped at 8 seconds. Reads the status and the first 16 KB of the body. Changes nothing. | Free — not metered |
| Scheduled prompt | On a cadence — every 60 minutes at the fastest | Runs your standing instruction as a full build against the project, verified like any other build. | 1 runtime credit |
| Lifecycle event | When a deploy fails, or a build run is rejected | Same as a scheduled prompt, fired by the failure rather than by the clock. | 1 runtime credit |
| Business event | When your app reports one of seven commerce events over a signed endpoint | Same as a scheduled prompt. Idle until your app is actually wired to report the event. | 1 runtime credit |
- A project that has never been previewed or deployed has no URL to point a health check at yet.
- Every standing agent can be paused and resumed without deleting it; its cadence and target are visible on its card.
- An event agent whose event nothing fires yet sits idle rather than pretending to work. The interface only offers lifecycle events that something really emits.
Preset agents
Presets exist for a storefront and for repository upkeep. Installing one starts it right away, behind a confirmation that says exactly that. Presets that arrive with a new project come switched off.
| Role | Presets | Trigger and output |
|---|---|---|
| Shopkeeper | Product sourcing, repricing, order fulfilment | Daily, daily, every 15 minutes. Fulfilment is a call to the live store: no model, no credits, no code changes. |
| Restocker | Low-stock reorder | Event inventory.low. Drafts purchase orders for the owner to approve. |
| Support helper | Customer support | Event support.ticket. Escalates refunds and policy questions to the owner. |
| Caretaker | Weekly security check, weekly dependency update, red-build repair, plus repo maintenance, issue triage, support-to-fix and dependency upgrade | Weekly, weekly, repo.ci_failed. Needs a linked GitHub repository. The output is a pull request the agent never merges; auto-merge of dependency PRs is a separate per-project opt-in, off by default. |
| Watcher | Health check | An interval, with a five-minute floor in the interface. |
What is checked, and how often
There is no fixed monitoring interval to quote. There is a heartbeat, and a due-ness rule.
A scheduled trigger calls the control plane once a minute. That call does not run everything — it loads the enabled agents and asks the scheduler which are due. An interval agent is due when it has never run, or when the gap since its last run has reached its own cadence. So the heartbeat is per-minute; how often your agent runs is the cadence you gave it, floored at five minutes for a check and sixty for a prompt.
A health check does exactly one thing: a GET against the URL, with an eight-second deadline, reading the status and up to the first 16 KB of the body. That bound is why a check is free, why a dead target cannot stall the heartbeat for every other project, and why a check has no way to modify anything. The same heartbeat also sweeps stale build runs: a run still marked running after twenty minutes that has also gone fifteen minutes without writing a step is closed out as failed.
What happens when a check fails
Every run is recorded with a status of ok, alert or error. Severity is derived from the failure, not configured — there are no thresholds to tune.
| Condition | How it is detected | Severity | What the alert says |
|---|---|---|---|
| The URL does not respond | Connection error, or no answer within the 8-second timeout | Critical | “preview unreachable” / “deploy unreachable”, with the connection error |
| A server error | HTTP status 500 or above | Critical | “returned HTTP 5xx”, with the URL and the exact status |
| Another failure status | Any other non-OK status — 404, 403, redirect loops | Warning | “returned HTTP 4xx”, with the URL and the exact status |
| The page loads but shows an error | HTTP 200, but the first 16 KB matches a known error signature — a Vite overlay, “internal server error”, “failed to compile”, “cannot find module”, a Next.js client-side exception page | Warning | “is serving an error”, quoting the first matching line |
| The agent itself broke | A prompt agent timed out against its 120-second wall clock, or threw | Critical | “failed to run”, with the reason — recorded as errored, never silently skipped |
| The agent could not finish | A prompt agent stopped short — out of runtime credits, over the spend cap, or a run it could not get green | Warning | “could not complete”, with its reason — the agent pauses itself |
Recorded, surfaced, then delivered
- Recorded first. The alert is written to the project alongside the run that produced it, before anything is delivered. That record is the source of truth and survives whatever happens to a delivery attempt.
- Surfaced on the Agents tab. Open alerts appear at the top of the project’s Agents tab, newest first, marked by severity, each with the failing agent, the title and the detail. Dismissing one acknowledges it, and Mark all read acknowledges them all; the record is kept.
- Emailed to the owner. Where alert email is configured for the workspace, a critical alert also goes at once to the address on the project owner’s profile; info and warning alerts still open are sent once a day as a single digest, grouped by project and agent. Delivery is best-effort and never blocks or fails the check.
Subject: [Alert] preview returned HTTP 502
CRITICAL
preview returned HTTP 502
GET https://your-project.preview.example → 502
Open the project's agents: https://code-anything.com/projects/…/agents
— code-anything agents (automated monitoring)There is no Slack, webhook or paging integration for alerts today. If you need one, say so on the enterprise page.
What is automated, and what stays your decision
The rule the platform is designed around: everything reversible is automated, and everything irreversible waits for a person.
| Stage | Handled for you | Your decision |
|---|---|---|
| Planning | The agent drafts the screens, data model and approach | Redirect it in a sentence before it writes anything |
| Infrastructure | The data, auth, payments and security code is written in from vetted bricks; hosting runs on Cloudflare | Whether the project needs them, which accounts to connect, and what it stores |
| Writing code | The agent writes and edits inside a sandbox | What good looks like, stated in the brief |
| Verification | Typecheck, tests and build run automatically | What your checks actually assert |
| Design | Templates and palettes are applied consistently across the app | Which template, which palette, and the final art direction |
| Merging | The pull request is opened with results attached | Reading the diff and pressing merge |
| Publishing | The build and deploy pipeline runs | Pressing Go Live, and pointing your domain |
| Recovery | Health checks and alerts run continuously | Choosing to roll back |
What an agent may do alone, and what needs you
Every tool call is evaluated before it runs. The answer is allow, ask, or refuse — and some things are refused no matter who is asking.
| Action | Who decides | Why |
|---|---|---|
| Read a file, search the tree, list files, screenshot the preview | On its own | Pure reads. Allowed in every mode, including read-only runs. |
| Write, edit or patch a file inside the sandbox | On its own | The sandbox is throwaway, and every accepted build is checkpointed to version history first. |
| Run an ordinary shell command in the sandbox | On its own | Installs, builds, test runs — bounded by the run’s step and spend budget. |
| Generate an image or a video into the project | On its own | Treated as a file write; metered like any other model work. |
| Run a destructive command | Asks first | Force-push, rm -rf, curl piped into a shell, find -delete, git reset --hard, git clean -f, or a production deploy command. Escalated even inside the sandbox; the run blocks until you answer. |
| Write to a protected path | Refused | The .git and .github trees, any .env file, certificates and private keys, SSH identities, AWS credentials, named secrets files. Hard-denied in every mode; approval cannot unlock it. |
| Ship a change to your repository | You merge it | With a repo connected, the edit path opens a pull request you review and merge. |
| Install a standing prompt agent | You opt in | Nothing installs one for you. One you install starts immediately, behind a confirmation naming its cadence, its credit cost, and that it edits code unattended. |
| Answer an escalated tool call | You have 3 minutes | An approval request unanswered for three minutes is auto-denied and the run continues with that call refused — it never defaults to allowing. |
Why your app cannot claim its own build broke
Business events arrive from your app through a per-project endpoint, signed with a token held in the encrypted vault and valid inside a five-minute window. Lifecycle events — deploy failed, run rejected — are our own observations and are fired in-process only. The asymmetry is deliberate: if an app could assert its own lifecycle events over the wire, a compromised storefront could trigger unattended repair builds simply by lying about its health. Secrets and connections live on the project’s Environment surface, never in the agent’s reach.
Investigating an incident, in order
Six surfaces, each answering the next question. Nothing here needs a support ticket.
- Open alerts (Agents tab). Every unacknowledged alert, newest first, colour-coded by severity — the title, the URL, the status, the matched error line, and the agent that raised it.
- That agent’s run history. History on the agent shows its last twenty runs with a status of ok, alert or error, a one-line summary and a timestamp — enough to tell a first failure from the third in an hour.
- The build behind it (Verify and trace). Every build shows the gate as it ran — which check passed, which failed, and the verdict — plus a span timeline with the model used, the tokens, the cost, and each check’s result.
- The release that changed things (Repository → Deploy). Every Go Live, what shipped, when, and whether it failed.
- The build that introduced it (Repository → Changes). Recent runs with their verdict, the reason, and the files each one touched. A held build tells you what the agent itself refused to ship.
- Rewind, or roll the canary back. Repository → Changes carries build checkpoints and a durable version history. Both snapshot the current state first, both refuse while a build or deploy is in flight, and a provisioned database is restored alongside the code. A release that went out as a delivery flight rolls its canary cohort back on its own — by default on the first recorded error, or once enough of the cohort rejects it.
The limits agents run inside
Real numbers from the running system, with the reason each one exists.
| Limit | Value | Why it exists |
|---|---|---|
| Heartbeat | Every minute | The engine then decides which agents are actually due. |
| Health-check cadence floor | Every 5 minutes | Politeness towards the target you are probing. Anything slower is fine. |
| Prompt-agent cadence floor | Every 60 minutes | Each prompt run is a metered build, so one agent is capped at roughly 24 runs a day. |
| Health-check probe timeout | 8 seconds | One slow target can never stall the heartbeat for everything else. |
| Prompt-run wall clock | 120 seconds | A hung build is aborted and recorded as errored rather than left hanging. |
| Prompt agents running at once | 3 per tick | Health checks stay fully parallel; only the expensive prompt builds are queued. |
| Run history kept per agent | Last 20 runs | In the History drawer on the Agents tab. |
| Open alerts listed | Up to 20 unacknowledged | Dismissing acknowledges an alert; the row itself is kept. |
| Unanswered approval request | Auto-denied after 3 minutes | A blocked run fails the call closed rather than open. |
| Model steps in one work item | Ceiling of 200 | A runaway backstop, not a spend limit. Spend is governed separately. |
| Stuck-loop detection | 3 identical calls, or 5 steps with no progress | Ends the attempt instead of burning your budget. |
Per-run budgets, by plan
| Plan | Spend ceiling per run | Model steps per run | Builds at once |
|---|---|---|---|
| Free | $0.50 | 30 | 1 |
| Starter | $2.00 | 60 | 3 |
| Pro | $5.00 | 100 | 6 |
| Team | $10.00 | 160 | 12 |
- A prompt agent whose account is out of runtime credits pauses itself and records why.
- A prompt trigger is charged once per firing — a retried heartbeat cannot double-charge the same run.
- Standing workspace monitoring is a paid feature from Pro upward; automatic build repair is on every plan, free included.
Agents questions, answered
What does "agent" mean on code-anything?
Two different things. The first is the agent that builds your app: it plans, edits files in a disposable sandbox, verifies its own work and repairs what failed before you ever see the result. That one is always on and runs inside every build. The second is a standing agent — an automation you install on a project that keeps running after the build ends, either checking a URL on a cadence or running a prompt on a schedule or an event.
What runs continuously without me switching anything on?
The verify-and-repair loop inside every build. It runs typecheck, your test script, the production build and a scan of the dev-server log for runtime errors, repairs failures and re-checks up to three rounds, and adds a behavioural and a visual pass. A build is accepted only when it is green and in scope; otherwise it is held for your review. Standing agents are the opposite — nothing watches your live URL until you add a health check yourself.
How often do health checks actually run?
A scheduled trigger fires once a minute and asks the control plane which agents are due; the engine then runs only those whose cadence has elapsed. In the interface the floor for a health check is every five minutes, and you can set anything slower. A check is a single GET with an eight-second timeout, so one unresponsive target cannot hold up anything else.
What counts as a failed check?
Four things. The URL not responding at all, or not answering inside eight seconds, is critical. An HTTP status of 500 or above is critical. Any other non-OK status is a warning. And a page that returns 200 but whose first 16 KB matches a known error signature — a Vite error overlay, "internal server error", "failed to compile", "cannot find module", a Next.js client-side exception page — is a warning, with the offending line quoted back to you.
Do agents fix things by themselves when a check fails?
A health check never does. It probes the URL, records the run and raises an alert — which is why it is free and cannot damage anything. Repair is a separate, opt-in choice: you can install a prompt agent triggered by a failed deploy or a rejected run, and that agent runs a real build against your project unattended. Installing one takes an explicit confirmation naming its cadence, its credit cost, and the fact that it edits code with nobody reviewing the change first.
How do alerts reach me?
Every alert is written to the project and appears under Open alerts on that project’s Agents tab, with its severity, title and body, until you dismiss it. When alert email is configured for the workspace, a critical alert is also emailed at once to the address on the project owner’s profile — severity in the subject, the failure detail in the body, and a link back to the Agents tab. Info and warning alerts are collected into one daily digest email per owner instead, grouped by project and agent. Mark all read on the Agents tab acknowledges every open alert at once. Email delivery is best-effort: a bounced or unconfigured send never stops the check or loses the alert.
Which events can an agent be triggered by?
Two lifecycle events that we observe ourselves and fire in-process: a deploy that failed, and a build run that was rejected. Plus seven business events your app reports about itself — an order created, an order paid, an order needing fulfilment, low inventory, an abandoned cart, a support ticket, a failed payout. Business events arrive through a signed, per-project endpoint with a five-minute replay window. Lifecycle events cannot be asserted over the wire, so a compromised app cannot trigger an unattended repair run by lying about its own health.
What can an agent never do, even with my approval?
Write to a protected path. The .git and .github trees, any .env file, certificates and private keys, SSH identity files, AWS credentials and named secrets files are hard-denied in every mode — approval does not unlock them, and a multi-file patch that touches one is rejected whole. Separately, destructive shell commands always stop and ask, even inside the disposable sandbox: force-push, rm -rf, piping a download into a shell, find -delete, git reset --hard, git clean -f, and production deploy commands.
What does a standing agent cost?
A health check is free — it is one bounded GET and it is not metered. A prompt agent spends one runtime credit per trigger, charged once per firing even if a tick is retried, and if the account is out of runtime credits the agent pauses itself and says so in its run history rather than failing silently.
Can I undo what an agent changed?
Yes, though not with a single rollback button. Every accepted build is checkpointed, and Repository → Changes gives you two restore paths: build checkpoints you can rewind the sandbox to, and a durable version history that survives the sandbox being recycled and lets you diff any file against the previous version before you restore it. Both snapshot the current state first, both refuse while a build or deploy is in flight, and where the project has a provisioned database its data is restored alongside the code. A release staged as a delivery flight also has its own gate that rolls the canary cohort back without a human.
Which plans include continuous monitoring?
Standing workspace monitoring is a paid feature from the Pro plan upward, and Team adds priority monitoring and alerts. The automatic verify-and-repair loop inside every build is not a plan feature at all; it runs on every build on every plan, including free.
Do agents run against my live app or a copy?
A health check fetches whichever URL you pointed it at — your preview URL or your live URL — exactly as a visitor would. A prompt agent works the way any build works: it edits inside the project’s disposable sandbox and is verified there, not against production. What it produces reaches your repository as a pull request when a repository is connected.