AI agents build websites that look finished. However, they are often slow in ways developers won't notice on a fast laptop with good Wi-Fi. Visitors notice, and so do search engines. TomΓ‘s Herrera from NBT argues that before you launch any AI-generated site, you must run a targeted Core Web Vitals pass to catch performance regressions that automated code generation misses.

Measure Before You Prompt

The biggest mistake developers make is asking an AI agent to "make it faster" without providing concrete data. Herrera recommends starting with a baseline measurement using Google’s PageSpeed Insights, Lighthouse, or Search Console. For sites not yet live, Lighthouse in Chrome DevTools is the primary tool, though it reports Total Blocking Time (TBT) instead of Interaction to Next Paint (INP). High TBT in a lab setting should be treated as a direct warning sign for poor INP in production.

Fixing Largest Contentful Paint (LCP)

LCP issues on AI-built sites usually stem from large hero images that are incorrectly lazy-loaded or oversized. The fix requires a specific prompt instructing the agent to serve the image in a modern format at the displayed size and to assign it high fetch priority. Crucially, you must manually review the diff to ensure the agent did not add loading="lazy" to the critical above-the-fold image, a common error that delays the primary content render.

Addressing Layout Shift and Interaction Delays

Cumulative Layout Shift (CLS) is often caused by images without explicit dimensions or web fonts swapping in late, which pushes content around. Herrera’s guide suggests prompting the agent to reserve space for late-loading embeds and define aspect ratios for all media. For Interaction to Next Paint (INP), which measures responsiveness, the focus shifts to script inventory. AI agents tend to bloat pages with unnecessary analytics tags, heavy animation libraries, or chat widgets. You must manually decide which scripts are essential and instruct the agent to defer non-critical ones until after the page is interactive.

Locking In Performance Rules

One-time fixes drift as you iterate. To prevent future regressions, add strict performance rules to your AI agent’s instruction file. These should prohibit lazy-loading the first large image, require explicit dimensions for all media, and mandate that no new third-party scripts are added without approval. By integrating Lighthouse checks into your workflow, you ensure that every subsequent change maintains the performance baseline established during this initial audit.

Key Takeaways

  • AI-generated sites often appear fast on high-end developer hardware but fail Core Web Vitals standards on real-world mobile devices.
  • Lab tools like Lighthouse report Total Blocking Time (TBT) instead of Interaction to Next Paint (INP); high TBT should be treated as a proxy for poor INP.
  • Common AI errors include lazy-loading critical hero images and adding excessive third-party scripts, both of which require manual review and correction.
  • Enforce performance by adding strict rules to the AI agent's instruction file, such as prohibiting lazy-loading of the first large image and requiring explicit media dimensions.

The Bottom Line

An AI agent can make a site look good in an afternoon, but without a manual Core Web Vitals audit, that site will likely feel sluggish on the devices most users actually rely on. Treat the AI as a builder, not a performance engineer, and reserve one hour for targeted measurement and correction before going live.