Developer and Text Tools

Permissions-Policy, Referrer-Policy and COOP/COEP in Practice

Which security headers matter, how to write Permissions-Policy allowlists, pick a referrer policy, enable cross-origin isolation and deploy safely.

Saizul Amin
Saizul Amin3 Nov 2026 · 3 min read
Permissions-Policy, Referrer-Policy and COOP/COEP in Practice

Small headers with a large effect

A few lines in your server configuration change how every browser treats your pages. They cost nothing at runtime, but each one has its own syntax, and a wrong value can break checkout flows, embedded videos or sign-in pop-ups. Knowing what each header is for makes it much easier to choose values with confidence.

Permissions-Policy: switch off what you do not use

Modern browsers expose powerful features such as the camera, microphone, location, payment requests, USB, serial ports and motion sensors. Most sites use none of them, yet any script on the page, including an ad or a compromised analytics tag, could ask for them. Permissions-Policy lets you declare which origins may use each feature in your page and its frames.

The syntax uses parentheses. camera=() means nobody may use the camera. geolocation=(self) allows only your own origin. payment=(self "https://pay.example.com") allows you and one provider. fullscreen=* allows everyone. A feature you do not list keeps the browser default, which for most features is your own origin only. Remember that cross-origin iframes also need the allow attribute on the iframe tag; the header sets the ceiling, the attribute grants the permission.

Referrer-Policy: decide what leaves your site

When a visitor follows a link or your page loads a third-party resource, the browser may send the current URL in the Referer header. If your URLs contain search terms, order numbers or reset tokens, that is a privacy problem. Browsers now default to strict-origin-when-cross-origin, which sends the full URL within your site, only the origin to other HTTPS sites and nothing when moving to plain HTTP. That is a good choice for most sites. Stricter sites use same-origin or no-referrer. Avoid unsafe-url, which sends everything everywhere.

COOP, COEP and CORP: cross-origin isolation

Cross-Origin-Opener-Policy controls whether pages you open, or pages that open you, can keep a reference to your window. same-origin cuts that link, protecting against cross-window attacks, but also breaks OAuth and payment pop-ups that report back through window.opener; same-origin-allow-popups is the compromise. Cross-Origin-Embedder-Policy says that every resource your page embeds must explicitly agree to it, either through CORS or a Cross-Origin-Resource-Policy header. With COOP same-origin and COEP require-corp or credentialless together, the page becomes cross-origin isolated and gains SharedArrayBuffer, which WebAssembly threads and some audio and video tools need. Cross-Origin-Resource-Policy on your own files declares who may load them: same-origin, same-site or cross-origin for public assets.

Framing and MIME sniffing

Clickjacking hides your page in an invisible frame on another site. X-Frame-Options with DENY or SAMEORIGIN blocks that in every browser, and the CSP frame-ancestors directive does the same with more control, for example allowing one partner. X-Content-Type-Options: nosniff stops browsers from guessing a file type, which closes a class of attacks where uploaded files are run as scripts.

Building and rolling out

Open the Security Headers Builder and start from the preset closest to your site. Block every powerful feature you do not use, allow the few you need, and pick a referrer policy. Read the warnings before you copy anything; they point out combinations that break pop-ups, embedded images or subdomains. Then choose your server or hosting platform and paste the output into staging first. Open your key pages, sign in, pay and play embedded media to make sure nothing broke. If you already send headers, paste them from your browser's network panel into the import tab to start from what is live. Change one group of headers at a time, and add HSTS preload only once every subdomain serves HTTPS, because it is difficult to undo.

Keep them under review

Browsers add new policy-controlled features every year, and your own site changes too. Put the header block under version control, note why each permission is allowed, and revisit the list when you add a payment provider, a map or a video platform.

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages