01The SSRF guard
My scanner renders attacker-supplied URLs in a headless browser, which turns a weak guard into an open proxy onto your own network. My check resolves DNS, rejects private and reserved IPv4 and IPv6 ranges, non-http schemes and any .internal, .local or localhost host, then hands back the exact resolved IP the caller must connect to — closing the rebinding window between check and fetch. I re-validate every redirect hop and cap them at five; 67 tests cover it.
02Fenced as data
The per-section read embeds headings, paragraphs and calls to action harvested from an arbitrary third-party page straight into the model's user message, so a hostile page could plant instructions in its own copy. I wrap all harvested content in an explicit delimited fence that declares it inert and names the system message as the only authority. I give the business-brief digest the same treatment.
03Grounding guardrail
Every hex and px value in the generated markdown has to exist in the extracted design system, or the brief is quietly misdescribing the brand. The flat prompt path fails on a violation; deep scan has nobody in the loop, so it neutralises the offending literal, keeps the deliverable buildable, and reports the count. I exempt the execution values the elevation block emits itself through a narrow allowlist — hairline borders, focus rings, glass-card radii, mesh-gradient blur — so craft detail survives while an invented off-scale 13px still gets caught.
04Scheduling, not shortcuts
The brief for a large speed-up came with a condition attached: not if it costs quality. So I changed no prompt and no model. I moved every section across every page into one bounded pool of twelve in flight instead of roughly 128 sequential awaits, the business brief now runs alongside section analysis because it only needs harvested copy, and I harvest per-section content inside the existing render rather than paying a second navigation per page.
05A dead button
My local web app's client script lives inside a backtick template literal, where \d and \/ were silently eaten as escape sequences. The served JavaScript carried a malformed regex and threw at parse time, so the whole script failed to load, the Scan button was never bound, and clicking it did nothing — while every API-level test I had stayed green. I fixed it by doubling the escapes and adding a guard: at server boot the inline script is extracted and compiled with new Function, so a broken UI fails loudly at startup instead of shipping quietly.