Beamfar

Securing web apps and APIs against automated AI recon without breaking SEO

Automated reconnaissance used to mean crude port scanners and directory wordlists. Today, autonomous AI agents can crawl a public web application, download exposed JavaScript source maps, parse live OpenAPI or GraphQL schemas, inspect hydrated page state, and map authentication boundaries in under a minute.

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:

  1. Public JavaScript source maps (.js.map): build tools such as Vite, Webpack, and Next.js can emit .map files alongside compiled bundles. When left publicly accessible, a .map file hands back readable TypeScript source code, comments, client-side validation rules, and internal API paths.
  2. 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.
  3. GraphQL introspection (/graphql): leaving __schema introspection enabled in production lets any client query the full type graph, mutations, and deprecated internal fields in a single request.
  4. 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' } (or false) in vite.config.ts. Use 'hidden' if you upload maps privately to an error tracker and delete .map files from your public web root before deploy.
  • Next.js: keep productionBrowserSourceMaps: false (the default) in next.config.js so browser bundles ship without public .map files.
  • Nginx or Cloudflare: add a rule returning 404 or 403 for *.map requests on public hosts as defense in depth.

Gate API schemas and disable production introspection

  • FastAPI: set openapi_url=None, docs_url=None, redoc_url=None when running in production (or gate /openapi.json behind 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/env are 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:

  1. Separate public pages from app/API paths: allow search crawlers on marketing pages, guides, and public docs; disallow authenticated app routes (/app/, /api/, /admin/) in robots.txt and enforce real authentication on the server (robots.txt is advisory, never an access control).
  2. 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.
  3. 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:

  1. Request your compiled main JavaScript bundle URL with .map appended and confirm the server returns 404 or 403, never valid JSON with "version": 3.
  2. Request /openapi.json, /swagger.json, and /graphql?query=%7B__schema%7BqueryType%7Bname%7D%7D%7D and confirm production schemas require authentication or return 404.
  3. 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.
  4. Fetch /robots.txt and check that legitimate search engines can crawl public marketing pages while authenticated application paths stay disallowed and protected on the server.
  5. 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.

Terms used in this guide

  • robots.txtrobots.txt is a file at the top of a site telling crawlers which URLs they may fetch. It manages crawling, is not security and cannot hide pages.
  • CrawlingCrawling is how a search engine fetches pages by following links and sitemaps. What affects it, why errors slow it, and what crawl budget means.
  • IndexingIndexing is how a search engine stores a crawled page so it can show it for queries. What decides it, and why crawled does not mean indexed.
  • NoindexNoindex is a robots directive, in a meta tag or a header, telling search engines not to keep a page in their index. How Google reads it.

Try it on your own sites.

Add your sites: checking starts as soon as you do.

No card for the Free plan.