feat(harness): WAF bypass header for browser tools on deco-owned hosts - #5083
Open
vibe-dex wants to merge 1 commit into
Open
feat(harness): WAF bypass header for browser tools on deco-owned hosts#5083vibe-dex wants to merge 1 commit into
vibe-dex wants to merge 1 commit into
Conversation
take_screenshot / scrape_url / inspect_page run on Browserless — headless Chrome from datacenter egress — which Cloudflare bot management on deco's own zones (decocdn.com / deco.site) scores as a bot and blocks. Agent QA of deco previews (envs-*.decocdn.com) and storefronts consistently 403'd. Both zones already carry a shared-secret skip rule matching the x-deco-probe-bypass header. When DECO_WAF_BYPASS_TOKEN is set, the three tools now send that header — ONLY when the target host is a deco zone, so browser tools pointed at third-party URLs never leak the secret. /screenshot and /content get setExtraHTTPHeaders in the payload; the /function template calls page.setExtraHTTPHeaders before goto. Requires DECO_WAF_BYPASS_TOKEN in the cluster env (value = the existing x-deco-probe-bypass rule secret). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Known limitation observed live (osklen QA run): the "antes" side of a de-para renders production pages on customer custom domains (e.g. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
take_screenshot/scrape_url/inspect_pagerun on Browserless (headless Chrome, datacenter egress). Cloudflare bot management on deco's own zones scores that as a bot and blocks it — so agents doing QA/verification of deco previews (envs-*.decocdn.com) and storefronts consistently get 403 "Sorry, you have been blocked". Observed live on the osklen AI-Services flow: QA runs honest-blocked twice purely on the WAF.What
Both production zones already carry a shared-secret skip rule matching the
x-deco-probe-bypassheader (same mechanism as the commerce-discovery probe bypass). WhenDECO_WAF_BYPASS_TOKENis set in the environment, the three browser tools now send that header.Security scoping: the header is attached only when the target host is a deco zone (
*.decocdn.com/*.deco.site) — browser tools can be pointed at arbitrary third-party URLs, and sending the secret there would leak it. Seewaf-bypass.ts./screenshotand/contentpayloads gainsetExtraHTTPHeaders/function(inspect_page) puppeteer template callspage.setExtraHTTPHeadersbeforegotoDeploy note
Requires
DECO_WAF_BYPASS_TOKENin the cluster env — value is the existingx-deco-probe-bypassrule secret on the decocdn.com custom firewall ruleset (rule[SKIP] commerce-discovery probe bypass).Verification
packages/harnesstsc --noEmitclean ·bun test packages/harness/src/decopilot/built-in-tools75/75 pass.🤖 Generated with Claude Code
Summary by cubic
Adds a WAF bypass for browser tools hitting deco-owned hosts to prevent Cloudflare 403s. Sends the
x-deco-probe-bypassheader usingDECO_WAF_BYPASS_TOKEN, but only for*.decocdn.comand*.deco.site.New Features
waf-bypass.tsto generate bypass headers when the target host is a deco zone.take_screenshot,scrape_url, andinspect_pageviasetExtraHTTPHeaders.Migration
DECO_WAF_BYPASS_TOKENin the cluster environment to the existing secret used by the Cloudflare rule.Written for commit 31efea2. Summary will update on new commits.