Block Risky Browser Features
Switch off camera, microphone, geolocation, USB, Bluetooth, payment and more with an empty allowlist, so scripts and embeds cannot ask for them on your pages.
Choose which browser features your site and its iframes may use, and get a ready-to-use Permissions-Policy header for Nginx, Apache, IIS, Express, Next.js, Laravel and more. Fast, free and no signup.
Start with Strict, Balanced or Privacy only, or import your current header.
Block it, allow your own site, allow everyone or list trusted origins.
Choose Nginx, Apache, IIS, Express, Next.js, Laravel or another format.
This free Permissions-Policy generator helps you write a correct header without memorising directive names or syntax. Pick a preset, decide for each browser feature whether to block it, allow only your own site, allow everyone or allow a list of trusted origins, and copy the finished header for Nginx, Apache, IIS, Node.js, Next.js, Laravel, PHP or a static host. You can also create the allow attribute for iframes, import a header you already use, and turn on report-only mode to test a policy safely. The generator runs in your browser and uses the current Permissions-Policy syntax, not the deprecated Feature-Policy format.
Switch off camera, microphone, geolocation, USB, Bluetooth, payment and more with an empty allowlist, so scripts and embeds cannot ask for them on your pages.
Copy the header as raw text, or as ready-made code for Nginx, Apache, IIS, Express, Next.js, Laravel, PHP, Netlify and Cloudflare Pages, plus an iframe allow attribute.
Paste your current header to edit it, and use report-only mode to see what a stricter policy would block before you enforce it.
Modern browsers give web pages access to powerful features: your location, camera and microphone, USB and Bluetooth devices, payment sheets, screen capture, motion sensors and many more. Most sites use only a few of them, but any script that runs on the page, including an advertising script, an analytics tag or a compromised library, can try to use all of them. The Permissions-Policy HTTP header lets you declare in advance which features your pages and embedded frames are allowed to use. Anything that you do not allow is blocked by the browser, even if a script asks for it.
This follows the principle of least privilege: give a page only the abilities it really needs. It does not replace permission prompts. Even an allowed feature, such as geolocation, still asks the visitor for permission. The header decides whether the feature can be used at all.
The header is a comma-separated list of directives. Each directive has a feature name, an equals sign and an allowlist in parentheses. The allowlist holds the origins that may use the feature.
Permissions-Policy: geolocation=(self), camera=(), microphone=(self "https://meet.example.com"), fullscreen=*
| Value | Meaning | Example |
|---|---|---|
() | Blocked for every origin, including your own page | camera=() |
self | Allowed for your own origin only | geolocation=(self) |
* | Allowed for every origin, including cross-origin iframes | fullscreen=* |
"https://example.com" | Allowed for that specific origin (always in double quotes) | payment=("https://pay.example.com") |
self "https://a.com" | A list of values separated by spaces | autoplay=(self "https://video.example.com") |
Notice that self has no quotes, but origins do. A wildcard such as "https://*.example.com" matches subdomains but not the bare domain, so add "https://example.com" as well when you need it.
If you are not sure where to begin, this policy blocks the features that most websites never use. Remove a line for anything your site needs, for example payment if you use the Payment Request API, or camera and microphone if you run video calls.
Permissions-Policy: accelerometer=(), ambient-light-sensor=(), bluetooth=(), camera=(), display-capture=(), geolocation=(), gyroscope=(), hid=(), magnetometer=(), microphone=(), midi=(), payment=(), serial=(), usb=(), xr-spatial-tracking=()
Be careful with features that your site may use without you realising, such as fullscreen for video players, autoplay for media, and publickey-credentials-get for passkey sign-in. Do not block these unless you have tested them.
| Directive | What it controls | Typical advice |
|---|---|---|
geolocation | The device location | Block unless you offer a location feature |
camera | Access to the camera | Block unless you need video |
microphone | Access to the microphone | Block unless you need audio input |
display-capture | Screen sharing with getDisplayMedia | Block unless you offer screen sharing |
payment | The Payment Request API | Allow only for checkout pages that use it |
usb, serial, bluetooth, hid | Direct access to hardware devices | Block on almost every website |
accelerometer, gyroscope, magnetometer | Motion and orientation sensors | Block unless you build a motion-based app |
fullscreen | The Fullscreen API | Usually allow for self so that video players work |
autoplay | Automatic media playback | Allow for self, or block to stop embedded autoplay |
clipboard-read | Reading the clipboard | Block unless you need it |
publickey-credentials-get | Signing in with passkeys (WebAuthn) | Leave allowed if you use passkeys |
Browsers ignore directive names that they do not recognise, so adding a directive that an older browser does not know does no harm. Two names in the generator, interest-cohort and browsing-topics, relate to advertising experiments by Google. FLoC was discontinued and the Topics API is marked deprecated, so these opt-outs are harmless but mostly historical.
When you embed another site, the page inside the iframe may ask for features such as fullscreen or autoplay. Two things control this. Your Permissions-Policy header sets the limit for your page and the frames that it contains, and the allow attribute on the iframe delegates a feature to that specific frame. A feature must be permitted by both before the embedded page can use it. The iframe syntax is different from the header syntax: features are separated by semicolons, and the keywords use single quotes.
<iframe src="https://www.youtube.com/embed/VIDEO_ID"
allow="fullscreen; autoplay; picture-in-picture"
loading="lazy"></iframe>
<iframe src="https://maps.example.com"
allow="geolocation 'self' https://maps.example.com; camera 'none'"></iframe>
Use the iframe allow attribute format of this tool to turn your settings into the correct attribute text. The value 'none' blocks a feature, 'self' allows the same origin and a plain origin allows that site.
The header must be sent with your HTML responses. These are the most common places to add it, and the generator writes the exact code for each of them:
# Nginx (inside server or location)
add_header Permissions-Policy 'camera=(), microphone=(), geolocation=()' always;
# Apache (.htaccess or virtual host, needs mod_headers)
<IfModule mod_headers.c>
Header always set Permissions-Policy "camera=(), microphone=(), geolocation=()"
</IfModule>
// Node.js / Express
app.use((req, res, next) => {
res.setHeader("Permissions-Policy", "camera=(), microphone=(), geolocation=()");
next();
});
On managed hosting you can often add the header in the control panel, in a CDN rule or in a configuration file such as _headers on Netlify and Cloudflare Pages. After you deploy, open your site, press F12, go to the Network tab, select the page request and look for Permissions-Policy in the response headers. Reload the server configuration first if you use Nginx or Apache.
Feature-Policy was the first version of this idea. It was renamed to Permissions-Policy and its syntax changed. If you still have an old Feature-Policy header, replace it:
# Old, deprecated
Feature-Policy: geolocation 'self'; camera 'none'
# Current
Permissions-Policy: geolocation=(self), camera=()
The differences are the use of an equals sign and parentheses, commas instead of semicolons between features, and self without quotes. The Import option of this generator rejects the old format and tells you to convert it.
| Header | Purpose |
|---|---|
| Permissions-Policy | Controls which browser features pages and iframes can use |
| Content-Security-Policy | Controls which scripts, styles, images and frames can load, and helps stop cross-site scripting |
| Strict-Transport-Security | Forces browsers to use HTTPS for your site |
| X-Content-Type-Options | Stops browsers from guessing file types (nosniff) |
| Referrer-Policy | Controls how much of the URL is shared when a visitor follows a link |
| X-Frame-Options or frame-ancestors | Controls who may embed your pages in a frame |
These headers work together. Permissions-Policy limits what features can do, and the others limit what can load and where your content can appear.
A strict policy can break features that you forgot you use. To test safely, send the policy in the Permissions-Policy-Report-Only header first. The browser then reports what would have been blocked, without blocking anything. Define an endpoint with the Reporting-Endpoints header, point the policy at it with the report-to parameter, review the reports and then switch to the enforcing header. The optional reporting section of this tool writes both headers for you.
Reporting-Endpoints: pp-endpoint="https://example.com/reports"
Permissions-Policy-Report-Only: geolocation=();report-to=pp-endpoint
self, not 'self'. The single quotes belong to the iframe allow attribute."https://example.com" with double quotes.After you change your server configuration, check that your pages still load correctly with the HTTP Status Checker and follow redirect chains with the Redirect Checker. For other security tasks you can create strong secrets with the Password Generator, make checksums with the Hash Generator and inspect token expiry with the JWT Expiry Inspector.
Our Permissions-Policy header generator is free, fast and works on desktop, tablet and mobile. There is no account, nothing to install and no limit on how many policies you create. The header is built in your browser and your settings are never sent anywhere. Always test a new policy on a staging site, or in report-only mode, before you apply it to a live website.
Find answers to common questions about the Permissions-Policy header, its syntax, iframes and browser support.
Permissions-Policy is an HTTP response header that lets a website decide which browser features, such as the camera, microphone, geolocation, USB and payment APIs, can be used on its pages and inside the iframes it embeds. For each feature you list the origins that may use it. An empty list blocks the feature everywhere. It is a security and privacy hardening header that reduces what a compromised script or a third-party embed can do.
Set each feature to an empty allowlist: Permissions-Policy: camera=(), microphone=(), geolocation=(). The empty parentheses mean that no origin may use the feature, including your own page and every iframe. If your own site needs a feature, use self instead, for example geolocation=(self), so that only your own origin can use it.
Feature-Policy is the older name of the same idea and is deprecated. Permissions-Policy replaced it and uses a different syntax. The old header wrote geolocation self with quoted keywords and semicolons between features, while the new header writes geolocation=(self) with commas between features. Use Permissions-Policy for new work. This generator creates only the current syntax.
Support differs between browsers and between individual features, and MDN lists the header as having limited availability. Chromium-based browsers support it most completely. Browsers ignore directive names that they do not know, so a policy never breaks a page. Treat Permissions-Policy as an extra layer of protection, not as your only defense, and check the MDN compatibility table for the features that matter to you.
There are two parts. The Permissions-Policy header on your page sets what the page and its frames are allowed to use. The allow attribute on an iframe delegates a feature to that embedded page, for example allow with the values fullscreen and autoplay for a video player. A feature must be allowed by your header and delegated by the allow attribute before an embedded site can use it. This tool can also generate the allow attribute.
Put the allowed origins inside parentheses, separated by spaces, and wrap each origin in double quotes. The keyword self has no quotes. For example: geolocation=(self "https://maps.example.com"). The value * allows every origin. A wildcard subdomain such as "https://*.example.com" matches subdomains but not the bare domain example.com, so list both if you need both.
No. Permissions-Policy can only be delivered as an HTTP response header, or for embedded frames through the iframe allow attribute. A meta tag with http-equiv does not work for this policy. Add the header in your web server, your CDN, your hosting settings or your application code. The generator gives you snippets for the most common places.
Merge, split, compress and convert files in seconds. Explore powerful free tools for all your everyday needs.
Explore All Tools →