Google Chrome published a security skill file for AI coding agents. Here is what it means if you vibe-code
The Google Chrome team, along with the Microsoft Edge team, published a SKILL.md file as part of their Modern Web Guidance project. It is a structured instruction set you drop into your AI coding agent so it knows how to implement browser security correctly instead of improvising. Project is in early preview. Link in comments.
When you ask your agent to "add authentication" or "set up cookies" or "make the login form work," it does something. It just does not always do the right thing by default. Not because it is broken, but because secure defaults require knowing the threat model, and your agent was not given one.
This skill file gives it one.
The skill is structured in three phases. Phase 1 is immediate fixes that cost nothing: stop using innerHTML with user input, set SameSite, HttpOnly, and Secure on every cookie, add X-Frame-Options: SAMEORIGIN to block clickjacking, and configure HSTS correctly. The skill is specific about starting HSTS with a short max-age and increasing it over time. Misconfiguring it with a long value on day one can lock users out of your site until that duration expires in every browser that saw it.
Phase 2 is observation before enforcement. Deploy Content Security Policy in report-only mode first. Violations get logged, nothing gets blocked. You find out what your app is actually doing before you restrict anything. Skipping this step is how you end up with a CSP that breaks your own scripts in production.
Phase 3 is enforcement with data: CSP, cross-origin isolation, Trusted Types. Trusted Types blocks string injection into dangerous DOM sinks at the browser level, which is a structural fix rather than a "hope the code is careful" fix.
To install:
npx modern-web-guidance@latest install
It runs a wizard that detects your agent and places the skill file in the right location. For Claude Code that is CLAUDE.md, for Cursor it is .cursorrules, for GitHub Copilot CLI there is a plugin flow.
One caveat worth stating clearly: this covers browser-side defenses only. Server-side authorization, SQL injection, rate limiting, and secrets management are outside its scope. It is not a complete security solution. It is the browser layer, done correctly, which is consistently wrong in AI-generated code by default.
If you are using React or Next.js, there are some framework-specific gotchas worth knowing about. Posting those and the github link in the comments.