Many founders react by reaching for heavy client-side obfuscation or aggressive bot-blocking rules that end up slowing pages down, breaking Core Web Vitals, or accidentally blocking search engines from indexing their marketing pages. A cleaner approach removes real information leaks at the build and server layer while keeping search crawlers healthy.
What automated AI recon inspects first
Before attempting any exploit, automated web recon tools collect structural blueprints of your application from four predictable places:
- Public JavaScript source maps (
.js.map): build tools such as Vite, Webpack, and Next.js can emit.mapfiles alongside compiled bundles. When left publicly accessible, a.mapfile hands back readable TypeScript source code, comments, client-side validation rules, and internal API paths. - OpenAPI and Swagger definitions (
/openapi.json,/swagger.json,/docs): backend frameworks often serve machine-readable API schemas in every environment. An unauthenticated schema lists every route, HTTP method, query parameter, and response model—including admin or beta endpoints you thought were hidden. - GraphQL introspection (
/graphql): leaving__schemaintrospection enabled in production lets any client query the full type graph, mutations, and deprecated internal fields in a single request. - Over-shared hydration payloads (
__NEXT_DATA__,__NUXT__): server-side rendering frameworks embed JSON props directly into the initial HTML. If a server loader fetches a full database record and passes it straight to the template, internal flags, staff emails, or private identifiers become readable in plain HTML.
Check it now. The frontend secret leak checker scans public HTML, __NEXT_DATA__ and up to four first-party JavaScript bundles across 12 live credential families without storing any secret; the security headers checker reads a page’s HSTS, CSP, X-Content-Type-Options, frame protection, Referrer-Policy and Permissions-Policy. No account, and the address is not stored.
Hardening your build and API safely (zero SEO penalty)
None of the fixes below touch visible page content or slow down browsers, so search rankings and Core Web Vitals stay unaffected.
Keep production source maps private
- Vite: set
build: { sourcemap: 'hidden' }(orfalse) invite.config.ts. Use'hidden'if you upload maps privately to an error tracker and delete.mapfiles from your public web root before deploy. - Next.js: keep
productionBrowserSourceMaps: false(the default) innext.config.jsso browser bundles ship without public.mapfiles. - Nginx or Cloudflare: add a rule returning
404or403for*.maprequests on public hosts as defense in depth.
Gate API schemas and disable production introspection
- FastAPI: set
openapi_url=None, docs_url=None, redoc_url=Nonewhen running in production (or gate/openapi.jsonbehind internal VPN or admin auth). - GraphQL servers: disable introspection in production configuration (
introspection: false) and enforce query depth and complexity limits. - Framework debug routes: verify that
/_profiler/,/telescope,/rails/info/properties, and/actuator/envare disabled in production configs rather than merely hidden from navigation links.
As the OWASP API Security Top 10 notes, security through obscurity fails quickly once endpoints are discovered; combine schema restriction with server-side authorization checks on every route.
Trim serialized page props
Write explicit allow-lists in server loaders (select only the columns the page renders) instead of spreading raw ORM objects into frontend templates. Check rendered HTML with curl after major changes to verify that no internal fields appear inside <script id="__NEXT_DATA__">.
Controlling AI crawlers without hurting Googlebot or SEO
Website owners increasingly want to allow search engines and answer engines to index public marketing pages while blocking aggressive scrapers from hammering application endpoints or pricing APIs.
Follow three rules grounded in RFC 9309 and Google’s robots.txt documentation:
- Separate public pages from app/API paths: allow search crawlers on marketing pages, guides, and public docs; disallow authenticated app routes (
/app/,/api/,/admin/) inrobots.txtand enforce real authentication on the server (robots.txtis advisory, never an access control). - Never serve deceptive content to bots: serving completely different marketing text or hidden instructions to crawlers violates search policies and looks indistinguishable from AI crawler cloaking or hidden prompt injection. Avoid client-side JavaScript “poisoning” tricks on public web pages—they risk hurting accessibility, Core Web Vitals, and search trust.
- Enforce rate limits at the edge: if you use Cloudflare, manage AI scraper policies and rate limits on API and search endpoints at the edge while leaving verified Googlebot and legitimate search crawlers untouched.
Use your own AI coding assistant defensively via read-only MCP
AI tooling works just as well for defenders when grounded in real production telemetry. Instead of asking a coding assistant to guess what might be misconfigured in your repo, connect a read-only production feed so your assistant sees exactly what the outside world observes.
The Beamfar MCP server gives Claude Code, Cursor, OpenAI Codex, Gemini CLI, and ChatGPT sixteen strictly read-only tools—including site_security, exploit_watch, site_security_layers, and security_audit_surface—so your assistant can read live headers, exposed paths, leaked public key metadata, grouped vulnerable dependencies, and explicit blind spots directly inside your IDE while reviewing your local codebase. Every plan from Free upward includes read-only MCP access (3,000 requests a month on Free; higher monthly quotas on Solo, Team, Agency, and Agency Plus).
Pre-release verification checklist for AI-built web apps
Before promoting a new build to production, run five quick checks against your staging URL from an unauthenticated terminal session:
- Request your compiled main JavaScript bundle URL with
.mapappended and confirm the server returns404or403, never valid JSON with"version": 3. - Request
/openapi.json,/swagger.json, and/graphql?query=%7B__schema%7BqueryType%7Bname%7D%7D%7Dand confirm production schemas require authentication or return404. - Inspect the raw HTML of your homepage and key dynamic routes for
<script id="__NEXT_DATA__">or__NUXT__blobs and verify that only public display fields are serialized. - Fetch
/robots.txtand check that legitimate search engines can crawl public marketing pages while authenticated application paths stay disallowed and protected on the server. - Run a read-only external scan after deploy so any accidental config drift introduced in a future pull request shows up in your security timeline.
Test what your live site currently exposes with a free external site check or review the full vibe coding security checklist.
Sources
Read on . Standards and vendor pages change; confirm the current text before you rely on it.
- Google Search Central, Introduction to robots.txt (developers.google.com)
- RFC 9309, Robots Exclusion Protocol (www.rfc-editor.org)
- OWASP API Security Top 10 (owasp.org)