Skip to content

Site Health

A free, drop-in admin page for the health of your site and apps: every app’s self-test with the fix, security headers, today’s usage against the Cloudflare® free limits, your Cloudflare setup at a glance, and optional uptime monitoring with email alerts and a public status page.

Beta. Site Health is in beta: it works, but things may still break. If something breaks, report it.

On the store: Site Health in Site health, pricing.

Free on any number of sites. You need a free account to claim and download it: see the store page.

  • Cloudflare plan: Cloudflare free plan
  • Works on: Cloudflare Workers; Cloudflare Pages; A site on its own server (VPS or cloud) with DNS on Cloudflare, through a Worker route in front of it (beta, tested on a live server) (hosts)
  • Version: 0.3.3 (needs core 0.31.0 or later; it comes in the same download)
  • Free, and included with every install. Runs on the Cloudflare free plan in the same D1 database as your other apps. No outside service, no third-party script: nothing leaves your site except the uptime requests to your own pages and the alert email or webhook you set up.
  • The Overview works as soon as it is installed. Uptime checks are off until you switch them on, because they need a Cron Trigger (optional). Workers: one line, triggers.crons, in the Wrangler config (the free plan allows 5 Cron Triggers per account). Pages has no Cron Triggers, so your AI agent adds a small helper Worker (a separate Worker with its own Cron Trigger) that asks your site to run its checks; the skill has the ready file.
  • Free-plan limits: a Cron Trigger run gets 10 ms of CPU time and 50 outbound requests, so one run checks at most 20 addresses (your home page, up to 5 key pages, and a rotating share of your /go/ links). A check every 5 minutes is the default.
  • Alerts: email uses the same Cloudflare Email setup as Forms notifications (nothing is sent until you set an address); a webhook is any https address you choose.
  • The public status page is off by default. It shows only page names (paths), status, uptime and incidents: no bindings, no admin path.
  • Cost per visit: none. Visits are not touched. Cost per check: one request to the page checked (it counts as a request to your site, so it also counts toward the Cloudflare 100,000 a day on the free plan when your Worker runs for pages) and a few small database writes per run, kept as daily roll-ups and limited by the site’s daily write budget.

Variables and secrets the app reads from the site’s own Cloudflare configuration.

Name Required Secret What it is
SITE_EMAIL no no Workers: send_email binding for incident alert emails.
SITE_EMAIL_BINDING no no Workers: the name of an existing send_email binding to use instead of SITE_EMAIL (e.g. EMAIL).
SITE_EMAIL_API_TOKEN no yes Pages: API token with Email Sending: Edit, for incident alert emails.
SITE_EMAIL_ACCOUNT_ID no no Pages: the Cloudflare account id for that token.
  • Addresses it answers: /status, /.well-known/health-tick
  • Edits pages as they are served: no
  • Has a say when a page is not found: yes
  • Uses the site’s brand: yes
  • Database tables (in the site’s own D1 database): health_pages, health_daily, health_incidents

Site Health adds 10 tools to the site’s own agent connection. The short text under each name is what an agent sees in its tool list; the full notes are what site_tool_help returns. The shared rules for confirm, dry_run and on apply to every tool.

Start here. The site’s health in one answer: checks (every app’s self-test, failing ones with a structured fix), uptime, settings, setup (what to add while uptime checks are not arriving) and recommendations (call apply only if the owner agrees).

Read only: changes nothing.

Full notes (what site_tool_help returns):

checks: failing lists each failing check with its structured fix: a call you can make, or an owner step. uptime: whether uptime checks are on, whether checks are arriving from the Cron Trigger or the Pages helper Worker (checksArriving: none, arriving or stopped), the status of each checked page, 30-day uptime and open incidents. settings: the same record health_settings_save takes. setup: while checks are not arriving, exactly what to add for this host (host is workers or pages; pagesFrom is origin when the apps run in a Worker route in front of the site’s own server, where host is workers): the cron line, or the helper Worker files and the key to set as its HEALTH_CRON_KEY secret. recommendations ([{id, text, why, apply?: {tool, args}}]) are the admin’s suggestions: explain each to the owner in a sentence or two and call apply only if they agree; one without apply needs the owner (an address, a deploy).

Field Type Required What it is
checks boolean no false skips running the apps’ self-tests (faster). Default true.

Spend Guard: the limits the owner set on the site apps’ database use (rows written and read, per day and per month), today’s and this month’s use, and what is paused and why. limits is the record health_spend_save takes.

Read only: changes nothing.

Full notes (what site_tool_help returns):

today and month: rows the site apps wrote and read (UTC), as reported to the counter; each instance of the site reports in batches (its first rows at once, then about every 10 rows it writes), so the totals can be a few rows per instance behind. today.written includes Spend Guard’s own rows (today.reports, one row each). off: true means the guard is switched off with SITE_SPEND_GUARD=off (nothing is counted or limited). paused: logging (clicks, 404s, visits), writes (everything: at the limit in hard mode, at the safety limit otherwise) or reads (the apps step aside and pages are served as built), with why and until. counterError is set when the guard can’t update its counter: it keeps counting in memory and retries; form submissions, settings and reads go on, and logging pauses only if it lasts five minutes. anonymous: rows written by requests that are not signed in at the admin’s own addresses (sign-in attempts, the status address), against a small fixed limit of their own; when paused, only those writes stop (signing in still works), and a jump means a bot is trying the sign-in page. recent lists the largest requests this instance handled, in rows, to find what is using the database. notice is the cost notice to pass on to the owner. The limits are a safety feature, not a guarantee: they cover the site apps’ database use only, not traffic to the site or the owner’s own code.

Takes no input.

The key the uptime helper Worker sends to this site (Cloudflare Pages only: Workers sites use a Cron Trigger and need no key). A secret: pass it straight to npx wrangler secret put HEALTH_CRON_KEY in the helper’s folder and don’t show it in the chat. It only lets the helper ask the site to run its checks.

Read only: changes nothing.

Takes no input.

Uptime incidents, newest first: the page, when it started failing, when it was fixed (null while still down) and how long. An incident opens when a page fails two checks in a row and closes when it answers again.

Read only: changes nothing.

Field Type Required What it is
days integer no Look back this many days. Default 30.
openOnly boolean no true: only incidents that are still open.
limit integer no At most this many. Default 50.

Lower the Spend Guard limits (PATCH): agents can only tighten them. Raising a number, plan “free” to “paid” or mode “hard” to “logging” is refused, dry_run too: only the owner can, in the admin in a browser at <admin path>/health/spend. The answer has the saved record.

Changes the site.

Full notes (what site_tool_help returns):

Only the owner can loosen the limits, signed in to the admin in a browser (so that a mistake, or a web page’s instructions, can’t switch off this protection). Through this tool, an API token or POST <admin path>/api/spend, a change that raises any number, switches plan from free to paid or mode from hard to logging is refused whole, with the fields that would loosen (dry_run gives the same refusal): send only the changes that lower a limit, or ask the owner to change it at <admin path>/health/spend (its Spend Guard tab). Lowering a number, plan paid to free (when the free numbers are not higher) and mode logging to hard are fine. plan: free | paid. The Cloudflare plan of the account; changing it starts from that plan’s numbers (send your own numbers in the same call to keep them). mode: logging | hard. logging (the default): at a limit, logging pauses; form submissions, sign-ups and settings carry on up to the safety limit (dayWritesMax, monthWritesMax: on Workers Free 80,000 rows a day, under the account’s own 100,000; on Workers Paid 10 times the limits; unless set), where they stop too; reads are counted and not stopped. hard: logging pauses at 80% of a write limit, everything else at 100% (a submission to a core form is then emailed to the owner where the form has email set up; other sign-ups are told to try again later), and at a read limit the apps step aside and pages are served as the site built them. Numbers are whole rows: no negatives, and values far outside a sensible range are refused with the allowed range. A warning appears when a number is above what the plan includes, with the rough cost at the price Cloudflare lists. New limits apply at once in the instance that saved them and in the others with their next report. The limits are a safety feature, not a guarantee.

Field Type Required What it is
plan "free", "paid" no The Cloudflare plan of the account: free (Workers Free) or paid (Workers Paid).
mode "logging", "hard" no What stops at a limit: logging (only logging) or hard (everything).
dayWrites integer no Rows written per day (UTC).
monthWrites integer no Rows written per calendar month (UTC).
dayReads integer no Rows read per day (UTC). Enforced in hard mode.
monthReads integer no Rows read per calendar month (UTC). Enforced in hard mode.
dayWritesMax integer no Safety limit: rows written per day in all, where form submissions and settings stop too (mode logging). Not below dayWrites. Follows dayWrites until set (Workers Free: 80,000; Workers Paid: 10 times it).
monthWritesMax integer no Safety limit per calendar month. Not below monthWrites. Follows monthWrites until set.
dry_run boolean no true: save nothing; answers wouldSave (the full record) and the warnings.

Change the Health settings (PATCH; pages, when sent, replaces the whole list of key pages). The answer has the saved record and warnings: read them. Switch things on or off with health_uptime_toggle and health_status_page_toggle.

Changes the site.

Full notes (what site_tool_help returns):

Warnings include: uptime on but no check has arrived yet, the cron line no longer matches the interval, email alerts without email set up, a page that already exists at the status address.

Field Type Required What it is
uptime boolean no Uptime checks on or off (same as health_uptime_toggle).
intervalMinutes 1, 5, 10, 15, 30, 60 no Minutes between checks. Must match the cron line */N * * * * (60 = hourly).
pages list of strings no Key pages besides the home page, paths like “/pricing”. At most 5. Replaces the list.
includeGoLinks boolean no Also check the site’s /go/ links (needs the Links app); a rotating share each run.
siteUrl string no The site address like “https://example.com”. Empty = the domain the site is visited on.
alertEmail string no Up to 3 addresses for incident emails, comma separated; empty = none. Each must be verified in Cloudflare Email Routing.
alertWebhook string no An https address that gets a JSON POST when an incident opens or closes. Empty = none.
statusPage boolean no The public status page on or off (same as health_status_page_toggle).
statusPath string no Where the public status page lives, like “/status” (lowercase letters, numbers, dashes).
statusTitle string no The heading of the public status page.
dry_run boolean no true: save nothing; answers wouldSave (the full record) and the warnings.

Switch uptime checks on or off. They only run once a Cron Trigger (Workers) or the Pages helper Worker calls the site: health_summary setup says what to add. Without on it flips, which is not safe to retry.

Changes the site.

Field Type Required What it is
on boolean no true: on, false: off. Sets the state (safe to retry).

Run one round of uptime checks right now (the home page, key pages and /go/ links) and answer with each page’s status code and response time. Uptime checks must be on. Records the results like a scheduled check.

Changes the site.

Takes no input.

Send a clearly marked test alert to the saved alert email and webhook (set them with health_settings_save first). Answers with what failed and the exact fix if the email or webhook could not be sent.

Changes the site.

Takes no input.

Show or hide the public status page (a page on the site’s own domain with overall status, uptime per checked page and recent incidents; no settings or admin address). Only turn it on when the owner agrees: it is visible to everyone. Without on it flips, which is not safe to retry.

Changes the site.

Field Type Required What it is
on boolean no true: on, false: off. Sets the state (safe to retry).

It sends and listens to none.

How events work: core events.