Self-hosting
Every Wayglass project lives on a Worker that someone deploys to their own Cloudflare account. The step-by-step guide is kept with the code, so it changes together with the Worker:
docs/SELF-HOSTING.mdin the main repository.- The “Deploy your own” part of the README’s Connect to a Worker section covers the same ground in brief.
What it involves
Section titled “What it involves”- A Cloudflare account on the Workers Paid plan, which Artifacts requires, with a workers.dev subdomain or a zone for a custom domain.
- An API token with Account › Artifacts › Edit, Workers Scripts › Edit and Queues › Edit (plus Zone › Workers Routes › Edit for
--domain, and the two Access permissions for--access). Only the script uses it; the deployed Worker never sees it. - Artifacts namespaces for the jurisdictions you want to offer (for example one
usand oneeu). A namespace’s jurisdiction is fixed when it is created. - A Queue for Artifacts push events, so pushes to a trunk that skip
wayglass landshow up in the audit log. - Deploying the Worker in
worker/with the pinnednpx wrangler, then setting its admin key as a secret and logging in withwayglass login.scripts/selfhost.shdoes all of this from a generated, git-ignoredworker/wrangler.selfhost.jsonc, shows its plan and asks before creating anything (--dry-runcreates nothing), and--uninstallremoves what it made. - Optionally,
CF_ACCOUNT_IDandCF_EVENTS_API_TOKEN(an API token limited to Account › Queues › Edit), so the Worker can subscribe each new trunk to push events. Without them projects still work, andwayglass initwarns that trunk pushes are not watched. - Optionally,
PUBLIC_PROJECTS(selfhost.sh --public <patterns>), if you want the web audit view to show any project anonymously. - Optionally, Cloudflare Access, so people sign in with your organisation’s login instead of keys:
scripts/selfhost.sh --access --allow 'you@example.com'sets it up, on workers.dev or with--domain <host>. See Sign-in with Cloudflare Access.
The deployed Worker reaches Artifacts only through its bindings. It holds no Cloudflare API token with access to Artifacts; see the security model.
Optional AI review
Section titled “Optional AI review”The self-hosting script leaves model review off by default. Use --ai-review manual to allow explicit wayglass ai-review <intent-id> requests, or --ai-review auto to attempt review after an eligible proposal. The Worker needs its AI binding; AI_GATEWAY_ID selects an existing gateway, and an empty value sends calls directly to Workers AI. See AI review for configuration, authority limits and verification status.
Enabling the reviewer makes model calls billable to your Cloudflare account. The diff cap is 60 KB. --ai-budget <n> sets AI_DAILY_REVIEWS, default 200 calls per project per UTC day, shared by review and advice. --ai-providers selects enabled providers; third-party providers need --ai-gateway with BYOK or Unified Billing configured.
Artifacts bills per operation and per GB stored beyond the included amount (10,000 operations and 1 GB per month at the time of writing; check Artifacts pricing). Each intent creates one fork repo in Artifacts.