Skip to content

Cloud rendering still fetches the target from the user's machine (parallel local GET, local fallback on block, robots/sitemaps/scripts/assets local); cloud mode should never touch the site from the user's IP #1285

Open

Description

@nc9

Problem

squirrel audit <url> --render-mode all (cloud browser rendering, signed in) still makes many requests to the target site from the user's machine. Only the page render runs in the cloud. Users and agents reasonably read "cloud rendering" as "our cloud fetches and renders the site", and expect no request to the target from the user's machine. That matters for privacy, for running on CI or agent boxes, and for blocks: a site that blocks our renderer gets silently fetched from the user's IP instead.

What actually happens (traced on origin/main):

request where
each HTML page, first visit or --refresh cloud render plus a concurrent local plain GET used only to fingerprint the source (packages/fetchers/src/conditional-render.ts:159-160)
each HTML page with a stored copy local conditional GET first, then a cloud render only if the page changed (conditional-render.ts:169-211)
render failed, timed out or blocked by the site (401/403/429, WAF page) local fallback fetch "never lose a page" (packages/audit-engine/src/cloud-fetcher.ts:400-415)
start-URL reachability and redirect detection, TLS probe local (apps/cli/src/controllers/audit.ts:1108,1182; packages/crawler/src/core/crawler.ts:2553-2573)
robots.txt, sitemaps, llms.txt / .well-known / agent-access / RSL probes local (packages/crawler/src/robots.ts:99, sitemaps.ts:691, crawler.ts:2675-2770)
first-party scripts (secrets, tech), images/CSS/fonts local (packages/audit-engine/src/script-fetcher.ts:171)
internal link targets local (link-target-probe.ts:89)
external links cloud bulk checker, local fallback (apps/cli/src/audit/cloud.ts:720, external-checker.ts:283-389)
active/aggressive probes local (lib/probe-fetch.ts:24)

Seen in practice: a batch re-audit of sites that had blocked a datacenter crawler was meant to "fall back to squirrel cloud". lsof showed every CLI process connected directly to the targets' hosting (Shopify, Fastly, Akamai, Vercel), and the "recovered" sites were mostly fetched from the operator's residential IP via the render-block fallback.

The docs don't promise otherwise ("the fully rendered DOM is returned to your local crawler", docs/cloud/rendering.mdx:9), but nothing tells the user their machine still talks to the site. The CLI also has no way to run fully in the cloud: only hosted runs (dashboard, MCP run_audit, POST /v1/agent-runs) do.

Expected

Choosing cloud rendering means the target site only sees squirrelscan's infrastructure: the request and the render happen in our cloud. Either:

  • (a) --render-mode all becomes cloud-only for every request to the target, or
  • (b) a distinct, documented cloud mode (e.g. squirrel audit --cloud) runs the crawl as a hosted run and streams results back into the normal local report and JSON output, while --render-mode stays documented as "rendering only, your machine still fetches".

The decision goes in the PR; the criteria below hold for whichever mode the CLI presents as "cloud".

Acceptance Criteria

  • In the default (hosted) mode, a network-level test (local egress recorder or stub DNS) shows zero connections from the CLI process to the target's hosts across a full audit: seed check, robots, sitemaps, discovery probes, pages, scripts, assets, link checks, probes. Only squirrelscan API hosts are contacted.
  • A cloud render that is blocked, fails or times out is never retried from the user's machine in that mode. The page is reported as blocked or failed (with the WAF vendor when known), and a fully blocked site gives status: "blocked".
  • The concurrent local "source fingerprint" GET is gone in that mode (fingerprint server-side, or skip it).
  • Credits for the cloud mode are estimated and charged like a hosted run; the estimate states what runs where.
  • docs/cli/audit.mdx, docs/cloud/rendering.mdx and docs/guides/browser-rendering.mdx say plainly which requests come from the user's machine for each mode. Shell completions and the agent skill are updated.
  • If option (b) is chosen, --render-mode all help text and docs say "your machine still fetches the site; only rendering runs in the cloud".
  • Decided (Nik, 2026-10-30): no --hosted flag. Signed in and online, squirrel audit is a hosted run (the cloud crawls and renders); offline, signed out, a local or private target, or a local-only flag (-H, --probe active|aggressive, --pentest, plugins, --store-scripts, --resume, --refresh, --http) is a local plain-HTTP audit, and the first output line names the mode and the reason. --detach and --attach <run-id> exist.
  • --render, --render-mode and [cloud] render are deprecated: accepted with a warning for one release and mapped (off to local, auto/all to hosted), then removed; the hybrid (local crawl plus cloud render) is no longer a user-facing mode.
  • Fallbacks follow the spec table: offline, signed out and unreachable-from-cloud targets run locally; zero balance, plan refusals, kill switch and a blocked hosted run stop with a typed message offering --http and never fall back silently; partial balance clamps with creditClamp.
  • The run request carries a validated, size-capped config payload (rules enable/disable, rule options, ignore entries, crawl scope) so a hosted and a local audit of the same site agree; a parity harness diffs the two on a fixture site and every unexplained difference blocks the default flip.
  • The estimate shows mode, what runs where, price (50 + 2/page, unchanged for signed-in users) and the plan page ceiling before any spend; the first hosted run prints a one-time notice.
  • Rollout is flag-gated: server HOSTED_CLI_RUNS, opt-in [cloud] mode = "hosted", default for new installs, default for all, with per-run telemetry and exit criteria for each step.
  • Exit codes follow the local audit table from the run's terminal state: 0 (2 on a --fail-on trip), 3 blocked, 4 redirected, 5 unreachable, 1 failed or API errors, 130 cancelled; a run that outlives --max-duration detaches with its run id.
  • The hosted report renders in every format from the published (capped) report, marked meta.hosted; the docs state that it has no local project, history or per-page detail.
  • Decided (Nik, 2026-10-30): hosted CLI runs use the OWNER crawl policy until site-ownership verification exists; probing is capped at passive (no active security probes, no GraphQL probing, no discovery probes beyond the crawl), enforced by the CLI and again by the server; the policy and the passive ceiling are shown in the estimate step and recorded on the run.
  • Monitoring ships with v1: per-account run limits (per hour and per day) and a per-target-host limit across accounts (the existing host crawl slot taken for every hosted CLI run), typed refusals the CLI displays, admin alerts for many distinct hosts per account per hour, repeated 403/429 or WAF answers per account and per host, one host hit by many accounts, a listed host attempted and a recorded complaint, a global HOSTED_CLI_RUNS kill switch plus a per-account suspension, an audit log of (account, org, surface, target host, policy, probe ceiling, outcome) queryable by host and by account, a host block list checked at start, an identifying crawler user agent (or header) with a bot page that documents blocking and an abuse contact.
  • The private API accepts ephemeral, followRedirect and maxDuration on the hosted run request, accepts org API keys for CI (or a dedicated route), and serves the report body to an authenticated CLI.
  • Start-URL redirect resolution runs server-side in the default mode: a free rate-limited resolve endpoint plus followRedirect on the run request (shared with the private half of Start URL redirects (bit.ly etc.): resolve the chain and audit the destination, with consent for cross-domain (--follow-redirect / prompt); today it scores the shortener #1281); local mode keeps the local resolver.
  • The acceptance test uses a sentinel server for the target and asserts zero connections and lookups for it across estimate, run, poll and report, including a blocked run.
  • A docs-only change for --render-mode all ("your machine still fetches the site; only rendering runs in the cloud") ships independently and first.

Activity

  1. added
    bug
    on Oct 29, 2026
  2. added theissue type on Oct 29, 2026
  3. nc9 commented on Oct 29, 2026

    @nc9
    ContributorAuthor

    Decision (Nik, 2026-10-29): option (b). Add a separate hosted-run mode where the cloud performs the whole crawl and the CLI only submits and polls, so there are zero target connections from the user's machine. --render-mode all keeps its current meaning (local crawl, cloud rendering) and its docs get a clear note that it still connects locally. A design pass comes first (API run type, CLI surface and naming, billing: the server sees every page, which also closes the #3654/#3671 trust gap, exit codes and docs); it is queued behind the current lanes.

  4. added
    size: L
    on Oct 29, 2026
  5. nc9 commented on Oct 30, 2026

    @nc9
    ContributorAuthor

    Spec: hosted by default (the cloud crawls when you are online)

    Status: proposal for review, no code yet. Decisions by Nik:

    • hosted-run mode is separate from --render-mode all (2026-10-29), superseded below;
    • owner crawl policy, passive probing, with monitoring (2026-10-30), kept in section 9;
    • 2026-10-30: there is no --hosted flag. Hosted is the default. "We shouldn't be separating requests from rendering: that was always a mistake: it's either request local with plain http and SSR, or cloud with request + render." Online (signed in, cloud services) is a hosted run: the cloud performs the crawl, the rendering and the cloud checks. Offline, signed out, or a target the cloud cannot reach is a local plain-HTTP audit with every request from the user's machine. The hybrid (local crawl with cloud rendering, today's signed-in default and --render-mode all) goes away as a user-facing mode.

    The earlier version of this spec proposed squirrel audit --hosted and is replaced. Read of the private tree is from origin/main, read-only.

    1. The model

    Online (default when signed in) Local
    Who requests the target squirrelscan's cloud (the crawl, robots, sitemaps, scripts, assets, link checks) this machine
    Rendering in the cloud, same run (level decides which pages render) none: plain HTTP and server-rendered HTML
    Cloud checks (AI analysis, tech and site metadata, blocking check, report) in the run --offline: none; otherwise as today (signed in, charged)
    Chosen by being signed in and online, no flag --offline, being signed out, a target the cloud cannot reach, or a local-only feature (section 5)
    This machine's connections to the target zero all of them

    Offline versus online is the axis, and it is separate from passive versus aggressive probing (a probing level is a different setting). --render-mode, --render and the hybrid are deprecated (section 5). --http (plain HTTP, signed in) becomes the way to say "local" explicitly while signed in, and is kept.

    2. What a signed-in squirrel audit is today, and what changes

    The public credits docs already say it: "a signed-in audit spends credits at every level, including one you run with squirrel audit on your own machine", 50 credits plus 2 per audited page ("however the page was fetched"), plus 1 per external link the cloud checks. So the switch does not change the price a signed-in user is already charged. What it changes:

    Today (signed in) Hosted default
    Crawl and robots, sitemaps, assets, link checks this machine the cloud
    Rendering the cloud renders; this machine fetches a source copy too (and falls back to its own fetch when the render is blocked) the cloud, once, no local fallback
    Price 50 + 2/page (+ link checks) the same
    Page ceiling the CLI cap (10,000) the plan's ceiling for a hosted run: 500 Free, 2,000 Pro, 10,000 Team (Free runs on a smaller container)
    Duration the process; --max-duration an async run with an admission queue (queued with a place in line), so it can start late
    Crawl policy the user's own owner policy (section 9)
    Report full local project (project.db: history, diff, squirrel report) the published report (a capped summary)
    Network origin the user's address squirrelscan's addresses (more WAF challenges, see section 4)

    The Free plan ceiling (500 pages versus a local audit that can reach 10,000) is a user-visible regression for large sites, the one place the default switch costs something. Local mode stays available for them.

    3. Behaviour differences, and which must be closed before the default flips

    The same rules package runs in the hosted container, so rule logic is shared; what differs is input, configuration and environment. Each row is "a local run does X, a hosted run does Y", with the gate for flipping the default. A parity harness (section 13) audits one fixture site both ways and diffs the reports, and is the check that this table is complete.

    Area Local Hosted Must close first?
    Config source squirrel.toml: [rules] enable/disable, rule_options, [[ignore]], [crawler] (include, exclude, delay, concurrency, robots, user agent, depth), [project] the website's stored settings (crawl scope, exclude patterns, robots, headers, crawl profile) and the plan; the cloud config merges plan-level rule disables only Yes. The run request needs a validated, size-capped subset of squirrel.toml (rules enable/disable, rule options, ignore entries, crawl scope) or the same audit gives different findings by mode. The cloud already accepts a per-run crawlScope; extend that to a config payload
    Custom headers -H, authorised crawl sent from this machine not sent to our cloud by default (credentials) No: a run using -H selects the local mode (section 5). Authorised crawling of a protected site is the website crawl-credential flow
    Targets any host reachable from this machine, including localhost, private ranges, intranet, VPN public hosts only (NON_PUBLIC_HOST) No: local fallback by name
    Probing passive, active or aggressive passive only (decision) No: `--probe active
    Local plugins ([plugins]) run not available in the container No: a config with plugins selects local, with a notice
    store_scripts, content store, project history, smart audits, --resume, --refresh, incremental re-crawl, diff local SQLite store none on the machine; the dashboard keeps history for non-ephemeral runs No: these flags select local
    Tech detection local fingerprinting plus the cloud tech service (the split) the cloud service and the container's detection Yes, to confirm the two produce the same technology list on the parity fixtures
    Rules that need page script bodies and assets fetched locally with caps fetched by the container with its own caps Parity harness
    User agent, robots the user's [crawler] settings the run's policy (owner policy: as configured) and the identifying agent (section 9) Decide the agent (section 9)
    Rendering the cloud renders chosen pages; a blocked render falls back to a local fetch one pass; a blocked render is reported blocked, never refetched from the user's machine By decision
    Rate limiting and WAF residential address datacenter addresses: sites that challenge datacenter traffic block the hosted run while a laptop passes (the study ran into ~12% of WAF-fronted sites doing this) The biggest risk. The blocked report must say "audit this site locally with --http" and name the WAF; no silent fallback (decision)
    Time and memory the process container limits, queue, plan ceiling Documented; the max-duration budget maps to the run
    --fail-on, -f, -o, exit codes local applied by the CLI to the retrieved report No
    Entity map, structure, page-level detail full whatever the published report carries (capped) Document what is absent; no flag-day break for squirrel report --list style detail

    4. Fallback to local: rules

    The CLI picks the mode before any request, from facts it already has, and says which it picked on the first line (Mode hosted: squirrelscan's servers crawl example.com or Mode local: this machine crawls (signed out)).

    Condition Result
    --offline local, no cloud at all
    signed out local, no cloud (as today)
    target is local or private by name (localhost, RFC1918, .local, .internal) local, with a one-line reason (the cloud cannot reach it)
    a flag or config that needs the machine (-H, --probe active, --pentest, plugins, --store-scripts, --resume, --refresh, --http) local, with a line naming the flag
    API unreachable, or the session expired what happens today (the cloudOutage flow): a TTY asks "continue local-only?", non-interactive proceeds local with the reason on the Account line
    the balance covers fewer pages than requested hosted, clamped to what the balance covers, with the creditClamp notice (existing behaviour)
    the balance cannot cover one page, or the org is locked stop, with the credit wall (existing). Not silently degraded to local: a billed mode that quietly became free would be a surprise in the other direction. The message offers --http
    hosted refused by plan, kill switch, per-account or per-host limit, queue timeout a typed message and stop; --http is offered. Not an automatic local retry: "never touch the site from this machine" is what the user relied on
    a hosted run that ends blocked or unreachable reported as such, exit 3 or 5, with "try --http to audit from this machine". Never refetched locally

    5. CLI surface, deprecations and rollout

    • No new flag. squirrel audit <url> signed in is hosted. The explicit local spellings: --offline (no cloud), --http (local plain HTTP; cloud checks as today when signed in). A future --local alias of --http is optional.
    • Deprecated: --render, --render-mode off|auto|all and [cloud] render/rendering. Kept for one release, accepted with a warning on stderr and mapped: off and --http mean local; auto and all mean hosted (the level decides rendering). After the release they are removed from help and then refused.
    • squirrel audit prints, before spending, the mode, what runs where, and the estimate (section 7).
    • [cloud] mode = "hosted" | "local" in squirrel.toml pins a project (the rollout needs it too). SQUIRREL_HOSTED=0 is the operator's kill switch on the client for one run.
    • Rollout (client and server flags, no big bang):
      1. Phase 0: the API changes ship behind HOSTED_CLI_RUNS (default off); the docs note for --render-mode all ships now ("your machine still fetches the site; only rendering runs in the cloud").
      2. Phase 1 (opt-in): [cloud] mode = "hosted" or squirrel audit --mode hosted hidden flag; telemetry on every run: mode, reason for local, queue wait, duration, blocked rate, credits, failure class.
      3. Phase 2: default for new installs (a setting written at first sign-in), existing users keep the hybrid until phase 3.
      4. Phase 3: default for everyone; the hybrid is removed; deprecation warnings become the migration notice.
        Each phase has exit criteria from the telemetry: blocked rate versus local on the same sites, p95 time to report, refund rate, support volume. A kill switch returns users to local at any point.

    6. What the CLI does in the default mode (zero target connections)

    1. Parse and validate the URL by string only. No reachability probe, no redirect resolution (the Start URL redirects (bit.ly etc.): resolve the chain and audit the destination, with consent for cross-domain (--follow-redirect / prompt); today it scores the shortener #1281 resolver sends a request to the target), no TLS probe, no robots, no discovery probes: all in the cloud run.
    2. POST the estimate (same body as the run) and show it as the credit wall does today: the cap, the range, what runs where, creditClamp, and, when the policy applies, Crawling as the site's owner: robots.txt follows your settings. Confirmation follows today's rules (consent by login, confirm_threshold, -y for spend; -y never follows an off-site redirect, feat(cli): audit where a start URL redirects, with consent for another site (#1281) #1282).
    3. POST the run with spendAck, the audit level and settings, the config payload (section 3), ephemeral (default for CLI runs, section 8), followRedirect (section 10) and maxDuration.
    4. Poll the run every 2 s, backing off to 5 s, one progress line: queue place while queued, then phase and pages. SIGINT on a TTY asks "Stop the run? [y/N]" (yes cancels and refunds, no keeps polling, a second interrupt detaches and prints how to re-attach); non-interactively SIGINT cancels, because an orphaned billed run nobody watches is the worse default. --detach submits and prints the run id; --attach <run-id> polls an existing run.
    5. On completion fetch the report (section 8), render it with the existing renderers, apply --fail-on, set the exit code.

    Network failures while polling retry with backoff (the run lives in the cloud); three minutes of failure detach with the run id.

    7. Credits, estimate and confirmation

    • Price is the hosted run's and, for a signed-in user, what they already pay: 50 + 2 per audited page, + 1 per external link checked. Charged by the server as the run proceeds and settled on pages it audited itself. Failed, cancelled and blocked runs refund through reverseRunCharges (unreachable must be added to that lifecycle mapping when fix(cli): offline level snapshot reports what ran; unreachable start URL writes a report, exit 5 #1275 #1269 #1297 lands); a partial run pays for the pages audited.
    • Closes the #3654 and #3671 trust gap for hosted runs by construction: the server crawled every page, so the per-page count is the server's own. Those issues remain for the local mode.
    • Estimate and confirm: unchanged UX (the up-front estimate, confirm_threshold, --max-pages, [cloud] max_credits_per_audit, the credit wall at zero). New: the first hosted run per install prints a one-time notice that this machine no longer connects to the site, that results can differ (different network, owner policy, plan page ceiling) and how to run locally.
    • The plan ceiling and clamp notices (page_limit_clamped) are shown in the estimate, so a Free user auditing a 5,000-page site sees "500 pages on the Free plan" before spending.

    8. Exit codes, failure and refund semantics

    Same table as a local audit, driven by the run's terminal state and the report's status:

    Terminal state Exit Notes
    completed, partial 0 (2 if --fail-on trips) partial includes max_duration and rate-limited runs
    report status: "blocked" 3 WAF vendor named when known; never retried from the user's machine (no automatic local fallback after a hosted run starts, section 4)
    report status: "unreachable" 5 #1297 vocabulary
    redirected 4 section 10
    run failed 1 failureDiagnostics printed; refunded
    cancelled by the user 130 refunded
    queue wait or run longer than --max-duration (or the default cap) 1 after detaching prints the run id; the run keeps going unless --cancel-on-timeout; the user re-attaches
    API unreachable, 401, 402 (credit wall), plan refusals 1 the existing messages; a 402 shows the offer exactly like a local audit

    Network failures while polling are retried with backoff (the run is in the cloud; losing the connection must not lose it). Three consecutive minutes of failure detach with the run id.

    The acceptance criterion "a blocked or failed cloud render is never retried from the user's machine" holds by construction in the default mode: no conditional-render, no local fallback, no source fingerprint. Server-side, the "source fingerprint GET" is already absent from hosted runs (they fetch once).

    8a. Report retrieval, publishing and ephemeral

    A hosted run's report is the published report (the container publishes it; it is what the dashboard shows): a capped summary, at most 1 MB, with true counts and sampled pages and items. The CLI renders console, text, markdown, LLM, JSON and HTML from it through the existing renderers (the slim JSON round trip exists for squirrel report --input), marked meta.hosted: true with the run id. Absent: per-page tables beyond the sample, and no local project, so no squirrel report history, diff or --regression-since for hosted runs; --output keeps a copy, the dashboard keeps history for non-ephemeral runs.

    • Default ephemeral for CLI runs, as today's [cloud] ephemeral option and as the hosted MCP tool: no dashboard website, no schedule, report unlisted; --publish or [cloud] ephemeral = false keeps the site. A signed-in CLI user who currently gets a dashboard site per audited domain (publish defaults on) keeps that: the default stays [cloud] ephemeral as configured, and the new-install default is a product decision (section 12).
    • To verify before implementation: which authenticated endpoint returns the published report body to the CLI. GET /v1/agent-runs/:id/report returns a summary and GET /v1/reports/:id metadata only. If none serves the body, add GET /v1/agent-runs/:id/report?full=1 (owner-scoped; the data is already the user's).

    9. Crawl policy, probing, monitoring and abuse handling

    Decision (Nik, 2026-10-30): a hosted run from the CLI uses the OWNER crawl policy, the same as a local CLI run (robots.txt is the owner's choice, [crawler] respect_robots as set), until site-ownership verification exists. In Nik's words: "lets just yolo, we can monitor; more effective for audits; we just won't do any aggressive security scans". So v1 trades the visitor-policy safeguards (#3271: robots honoured, identifying user agent, per-host limit) for effectiveness, and compensates with caps on what the run may do and with monitoring. This section replaces the earlier visitor-policy recommendation.

    What the run may do (v1):

    • Policy: the owner policy. The private PR passes crawlPolicySource: "dashboard" for CLI-hosted runs (the surface the route already treats as the owner, crawl-policy.ts VISITOR_SURFACES covers only mcp and api), and records the decision on the run (RUN_CRAWL_POLICY_KEY) with reason: "surface" as today. When ownership verification ships, the same switch moves CLI-hosted runs to the visitor policy for unverified sites without a CLI change.
    • Probing is passive only: the hosted run is created with probe: passive and the server ignores a higher request. No active security probes, no GraphQL introspection or mutation probes, no discovery probes beyond what the crawl itself needs (robots.txt, sitemaps, the seed and its links). --probe active|aggressive and --pentest select the local mode (active probing runs from your machine) rather than being refused, see section 5; the server also rejects them on a hosted run. The existing disable_discovery_probes and [security] probe resolution (resolveProbeIntensity, which already has a surface input) is the mechanism; hosted CLI is a new surface value with a passive ceiling.
    • Headers: -H/--header selects the local mode in v1 (credentials would go to our cloud otherwise); authorised crawling of a protected site stays the website-level crawl credential flow.
    • Targets: public hosts only (NON_PUBLIC_HOST by name before any request, and again server-side after DNS: the existing isCloudReachableUrl check).

    Monitoring is part of v1, not a follow-up. Nothing below needs a new subsystem: each piece extends something the API already has.

    Control Proposal Reuses
    Per-account rate limit A cap on hosted runs started per hour and per day per user and per org (starting values: 20 per hour, 100 per day, tunable per plan), enforced at /cloud before any charge; refusal is a typed 429 with the limit and reset time, shown by the CLI rateLimit() middleware on the route; plan table
    Per-target-host limit Apply claimHostCrawlSlot to every hosted CLI run, not only visitor-policy runs: a cap on concurrent runs and runs per day against one host across all accounts (starting values: 2 concurrent, 20 per day per host). It exists today (host-crawl-limiter Durable Object) but is only taken when takesHostSlot is true (visitor policy and confirmed spend) host-crawl-limit.ts, host-crawl-limiter.ts; change takesHostSlot to include the hosted CLI surface
    Crawl pacing Per-host request pacing inside the run is the crawler's per_host_delay_ms and concurrency, unchanged; the hosted run clamps concurrency to the plan's hosted default so one run cannot exceed the polite rate cloud-audit-runtime crawl scope config
    Abuse-pattern alerts Admin events (the existing feed behind list_admin_events, which already carries failure spikes and queue backlog) gain: (1) more than N distinct target hosts started by one account in an hour (start: 30), (2) a rising share of a run's fetches answered 403/429 or WAF challenges, per account and per target host (a host that blocks us repeatedly is a sign it does not want the traffic), (3) the same host hit by many accounts in a short window, (4) a run whose target is on a block list (see below), (5) a complaint recorded against a host. Each emits an event with the account, hosts and counts, to the channel the team already watches admin events, scheduler stats, run progress counters
    Kill switches Two feature flags in the existing flag system (the admin MCP's list_feature_flags): a global HOSTED_CLI_RUNS (off returns the typed CLOUD_AUDIT_DISABLED 404 for CLI-hosted runs only, leaving the dashboard and MCP alone) and a per-account override to suspend one org or user without touching the rest. The CLI shows the server's message and exits 1. CLOUD_AUDIT_TRIGGER_ENABLED stays the whole-feature switch isCloudAuditTriggerEnabled, feature flags
    Audit log Every hosted run's target is already on agent_runs.url with source recorded (agent_runs.config.source, usage events); add an immutable per-run record of (account, org, surface, target host, policy decision, probe ceiling, start time, outcome) retained 13 months, queryable from the admin tools by host ("who audited this host") and by account ("which hosts did this account audit") usage_events, agent_runs, admin MCP
    Abuse contact The hosted crawler's user agent names squirrelscan and a URL, e.g. Mozilla/5.0 (compatible; squirrelscan/1; +https://squirrelscan.com/bot), and that page documents what the crawler does, how to block it (a robots.txt token and the IP ranges if published) and an abuse address ([email protected]) read by a person. Hosted runs send the identifying agent in addition to the owner policy's behaviour (the owner policy's browser user agent applies to the owner's own site; for hosted CLI runs the UA identifies us, because we are crawling from our addresses on behalf of a user the target does not know). To confirm: whether the UA should stay a browser string for rendering fidelity, in which case the identification moves to a header (From, X-Squirrelscan) and the bot page docs/ bot page, fetchers user agent
    Complaint handling A block list of hosts (exact and wildcard) checked at /cloud and by the sandbox worker: a hosted run against a listed host is refused with a typed error naming the contact. Entries come from complaints and from the repeated-403/429 alert after review. Admin tool to add and remove entries isCloudReachableUrl neighbour; admin MCP
    Review cadence A weekly query over the audit log: top accounts by distinct hosts, top hosts by accounts, blocked-fetch rates, and any host on the block list that was attempted. Result goes to the same place as the morning triage admin events, ops scripts

    Policy and what the docs promise: the docs page (docs/cloud/hosted-runs.mdx) states that a hosted run crawls from squirrelscan's network under the owner policy, with passive checks only, that results can differ from a local run (different network, our user agent), and that the user is responsible for auditing sites they are entitled to audit, the same terms as a dashboard audit.

    Revisit trigger: site-ownership verification shipping (the decision's "until"), or the monitoring showing abuse. The two flags above are how to tighten it quickly.

    10. Start-URL redirects (#1281, private half) under this model

    In the default mode the CLI cannot resolve a start URL's chain itself (that is a connection to the target), so the contract #1282 defined moves server-side, and the local resolver remains for local mode only.

    • Recommended: a free, rate-limited POST /v1/agent-runs/resolve that runs the guarded chain from the cloud (the same resolveStartRedirect logic, with the hosted egress guard, 5 hops, loop detection, private addresses refused) and returns {kind, originalUrl, finalUrl, chain}, no run, no charge. The CLI calls it first, shows the prompt (bit.ly/x redirects to https://example.com/pricing. Audit example.com instead? [Y/n]) or applies --follow-redirect / [crawler] follow_redirect, then estimates and runs against the destination. -y still does not imply following. Credits are estimated on the destination, and the website row belongs to the final domain with the original URL as an alias, created by the run.
    • The run request also carries followRedirect as the safety net: a cross-domain end without it finishes the run as redirected (no crawl, no charge) with originalUrl, finalUrl and redirectChain, and the CLI exits 4. This covers clients that skip the resolve call (API, MCP, the dashboard).
    • MCP: run_audit returns confirmation_required with the final URL and proceeds only with explicit follow consent (the AC of Start URL redirects (bit.ly etc.): resolve the chain and audit the destination, with consent for cross-domain (--follow-redirect / prompt); today it scores the shortener #1281); it already uses the same seam.
    • The Worker needs a fetch path for the chain (fetchUndecoded is Bun-specific): reuse the container's egress proxy or the hosted fetcher; to verify.
    • Together with section 6 this is one piece of private API work with the rest of this spec; Start URL redirects (bit.ly etc.): resolve the chain and audit the destination, with consent for cross-domain (--follow-redirect / prompt); today it scores the shortener #1281's private half should land inside it, not before.

    11. MCP and docs parity

    • The hosted MCP run_audit is already a hosted run; its confirmation_required handshake is the model for the CLI's confirmation.
    • The local stdio MCP audit_website follows the same rule as the CLI: signed in and online runs hosted, offline: true or a non-public target runs locally; its description says when the machine connects to the target and drops its render parameters on the same schedule as the CLI.
    • Docs: docs/cli/audit.mdx (the mode table, the per-mode "which requests come from your machine" table, the deprecations), docs/cloud/rendering.mdx, docs/guides/browser-rendering.mdx, docs/cloud/credits.mdx (plan ceilings now apply to CLI audits), a new docs/cloud/hosted-runs.mdx, docs/guides/local-audits-cli.mdx, completions, --help, the agent skill (agents must know the default is hosted, that a blocked report suggests --http, and which flags select local). A private issue labelled skills is filed with the first PR.

    12. Open questions for Nik

    • Does a signed-in CLI audit stay "adds a dashboard site and publishes" by default (today) or become ephemeral (proposed for hosted runs, which also avoids the website cap)?
    • Hosted user agent: identify squirrelscan (proposed) or keep a browser string with identification in a header.
    • The Free plan's 500-page hosted ceiling versus the CLI's local cap: accept, or raise the Free ceiling for CLI runs.
    • Blocked hosted runs: the proposal is no silent local retry, with a clear "audit locally with --http". Confirm.
    • Starting rate and host limits (section 9).

    13. Test plan

    • Parity harness (the gate for flipping the default): the same fixture site audited by a local run and by a hosted run (stub cloud running the real engine), reports diffed per rule and per page, with an allowlist of known differences. Every unexplained difference blocks.
    • Zero connections: the CLI (subprocess) against a stub API implementing the resolve, estimate, run, status and report endpoints, with a sentinel server for the target; assert the sentinel received no connection and no DNS lookup across resolve, estimate, run, polling and report, including a blocked run. A second case runs --http against the same sentinel and asserts it is contacted.
    • Mode selection: a table test over (signed in, offline, target, flags, balance, API state) giving the mode and the line printed; each fallback row of section 4.
    • Unit: poll backoff, queue display, SIGINT paths, --detach/--attach, network-failure retry, deprecation warnings for --render-mode and --render, the per-run config payload validation and caps.
    • Exit codes for each terminal state; credit wall, creditClamp and plan ceiling messages; refund text.
    • Private: schema and auth for the new route with a CLI token and an API key; owner policy and passive ceiling recorded on the run; limits, kill switches, block list and alert events; the resolve endpoint (SSRF guard, caps, hops); full-report endpoint ownership; followRedirect contract.
    • Docs: make validate; the per-mode request table checked against the code paths in the issue.

    14. Split of work and order

    1. Public docs PR (small, free-standing): the --render-mode all note and the model description. Can merge now.
    2. Private PR 1 (API, behind HOSTED_CLI_RUNS, default off): the /hosted route and estimate with a CLI token or API key, owner policy and passive ceiling, config payload, ephemeral, followRedirect, maxDuration, the resolve endpoint (with Start URL redirects (bit.ly etc.): resolve the chain and audit the destination, with consent for cross-domain (--follow-redirect / prompt); today it scores the shortener #1281's private half: website alias, MCP handshake), report body endpoint, status vocabulary and exit-code mapping, monitoring controls (section 9). Hold list: auth and security, billing adjacent, runtime config.
    3. Public PR 1 (CLI, phase 1, opt-in via [cloud] mode = "hosted"): cloud-client methods, mode selection and fallbacks, the hosted flow, report rendering, exit codes, deprecation warnings, docs, completions, tests including the zero-connection and parity tests. Gated by a server capability field so a new CLI against an old API says so instead of failing obscurely.
    4. Telemetry and phase 2/3 flips: small PRs that change defaults only after the exit criteria.
    5. Public PR 2: local MCP audit_website alignment, --local alias, removal of the deprecated flags in a later release.
    6. Skill update and docs/cloud/hosted-runs.mdx with PR 1.

    Order: docs PR now; private 1; public 1 (opt-in); default flips by phase. Size: private about L, public about L.

    Acceptance criteria

    The checklist lives in the issue body and matches this model (no --hosted flag).

    nik

  6. nc9 commented on Oct 30, 2026

    @nc9
    ContributorAuthor

    Decision (Nik, 2026-10-30): hosted runs use the OWNER crawl policy, the same as a local CLI run, until site-ownership verification exists ('lets just yolo, we can monitor; more effective for audits; we just won't do any aggressive security scans'). v1 caps probing at passive (no active security probes, GraphQL probing or discovery probes beyond the crawl). Monitoring is part of the spec and of v1: per-account and per-target-host limits, abuse alerts, kill switches, an audit log of targets, a host block list, an identifying user agent and an abuse contact. The spec comment and the acceptance criteria are updated (section 6). Naming (--hosted), default ephemeral and refusing -H in v1 stay proposed, Nik to confirm.

  7. nc9 commented on Oct 30, 2026

    @nc9
    ContributorAuthor

    Decision (Nik, 2026-10-30): no --hosted flag. Hosted is the default. "We shouldn't be separating requests from rendering: that was always a mistake: it's either request local with plain http and SSR, or cloud with request + render."

    • Online (signed in): the cloud crawls, renders and runs the cloud checks. Offline, signed out, or a target the cloud cannot reach: local plain-HTTP audit.
    • The hybrid (local crawl + cloud render, --render-mode all) is removed as a user-facing mode. --render-mode/--render deprecated for one release, mapped to the two modes.
    • Spec comment rewritten in place; criteria in the issue body updated. Open questions for Nik are in section 12 of the spec.

    nik

  8. nc9 commented on Nov 2, 2026

    @nc9
    ContributorAuthor

    Docs-only slice (#1548): the criterion that the agent skill is updated is not ticked. The skill change (one clause on the render-mode line, with a version bump and a regenerated manifest) is tracked privately.

    nik

  9. nc9 commented on Nov 11, 2026

    @nc9
    ContributorAuthor

    The docs-only criterion shipped in d9ba00a (v0.0.159). Everything else needs the hosted-run API contract (create, poll/events, report body, cancel, resolve, estimate, typed refusal codes, creditClamp, CI auth), which is not defined yet. Parked until that contract exists; the client will be built against it, not guessed.

    nik

  10. added
    needs-input
    on Nov 15, 2026
  11. nc9 commented on Nov 15, 2026

    @nc9
    ContributorAuthor

    Implementation lane (2026-11-15): too large for one lane. It spans billing, security and runtime config across 40+ files in three repos, and depends on private API work and product decisions. Proposed split: (1) the private API contract for cloud-only fetching first, (2) the public CLI half (no local GET, no local fallback, robots/sitemaps/scripts/assets fetched cloud-side), with a parity harness and a sentinel egress test proving no request leaves the user's IP. Marked needs-input until it's split.

  12. nc9 commented on Nov 16, 2026

    @nc9
    ContributorAuthor

    Decision (2026-11-16): keep the hosted-run architecture (the cloud runs the whole crawl; the CLI starts the run, polls and prints the report). The epic gets re-drafted around that; no cloud fetch layer under the local engine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugclineeds-inputsize: L

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions