Skip to content
⚠ TESTING ENVIRONMENT You are viewing a testing copy of Tolioo. Changes here do not affect the live website.

Permissions-Policy Header Generator

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.

  • 100% free
  • No signup
  • Runs in your browser

Choose your features

0 set
Start from a preset
Import an existing header
ADVERTISEMENT
Demo Ad 728 x 90

How to generate a Permissions-Policy header

1Pick a preset

Start with Strict, Balanced or Privacy only, or import your current header.

2Adjust each feature

Block it, allow your own site, allow everyone or list trusted origins.

3Copy and deploy

Choose Nginx, Apache, IIS, Express, Next.js, Laravel or another format.

PERMISSIONS-POLICY GUIDE

Permissions-Policy Header Generator – Block Camera, Microphone, Geolocation and More

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.

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.

Snippets for Every Stack

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.

Import and Report-Only Testing

Paste your current header to edit it, and use report-only mode to see what a stricter policy would block before you enforce it.

What Is the Permissions-Policy Header?

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.

How to Generate a Permissions-Policy Header in 4 Steps

  1. Choose a preset: Strict blocks sensitive features, Balanced keeps camera, microphone and location available to your own site, and Privacy only opts out of advertising APIs. You can also import your current header.
  2. Set each feature: Use Block all for an empty allowlist, Same origin for self, Allow all for the wildcard, or Custom origins to list trusted sites.
  3. Choose the output format: Select the server or framework that you use. The snippet updates instantly.
  4. Copy, deploy and test: Add the header to your server, then check the response headers in your browser's developer tools. Use report-only mode first if you are unsure.

Permissions-Policy Syntax Explained

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=*
Allowlist values in a Permissions-Policy header
ValueMeaningExample
()Blocked for every origin, including your own pagecamera=()
selfAllowed for your own origin onlygeolocation=(self)
*Allowed for every origin, including cross-origin iframesfullscreen=*
"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 spacesautoplay=(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.

A Strong Starting Policy

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.

Common Permissions-Policy Directives

Frequently used directives and what they control
DirectiveWhat it controlsTypical advice
geolocationThe device locationBlock unless you offer a location feature
cameraAccess to the cameraBlock unless you need video
microphoneAccess to the microphoneBlock unless you need audio input
display-captureScreen sharing with getDisplayMediaBlock unless you offer screen sharing
paymentThe Payment Request APIAllow only for checkout pages that use it
usb, serial, bluetooth, hidDirect access to hardware devicesBlock on almost every website
accelerometer, gyroscope, magnetometerMotion and orientation sensorsBlock unless you build a motion-based app
fullscreenThe Fullscreen APIUsually allow for self so that video players work
autoplayAutomatic media playbackAllow for self, or block to stop embedded autoplay
clipboard-readReading the clipboardBlock unless you need it
publickey-credentials-getSigning 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.

Permissions-Policy and the iframe allow Attribute

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.

How to Add the Header to Your Server

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.

Permissions-Policy vs Feature-Policy

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.

Permissions-Policy Compared with Other Security Headers

What each security header protects
HeaderPurpose
Permissions-PolicyControls which browser features pages and iframes can use
Content-Security-PolicyControls which scripts, styles, images and frames can load, and helps stop cross-site scripting
Strict-Transport-SecurityForces browsers to use HTTPS for your site
X-Content-Type-OptionsStops browsers from guessing file types (nosniff)
Referrer-PolicyControls how much of the URL is shared when a visitor follows a link
X-Frame-Options or frame-ancestorsControls 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.

Testing a Policy with Report-Only Mode

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

Common Permissions-Policy Mistakes

  • Using the old Feature-Policy syntax: The header will not parse. Use the equals sign and parentheses.
  • Quoting self: In the header it is self, not 'self'. The single quotes belong to the iframe allow attribute.
  • Forgetting quotes around origins: Write "https://example.com" with double quotes.
  • Using a meta tag: Permissions-Policy cannot be set with meta http-equiv. Send a real HTTP header.
  • Blocking something you need: Fullscreen for video, payment for checkout and passkey credentials for sign-in are common examples. Test before you deploy.
  • Allowing everything with a wildcard: Allowing a sensitive feature for all origins defeats the purpose of the header.
  • Expecting it to replace permission prompts: The header decides whether a feature is available. Visitors are still asked before a sensitive feature is used.

Related Tools

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.

Free Permissions-Policy Generator Online, No Signup

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.

ADVERTISEMENT
Demo Ad 300 x 250
COMMON QUESTIONS

Frequently Asked Questions About Permissions-Policy

Find answers to common questions about the Permissions-Policy header, its syntax, iframes and browser support.

What is the Permissions-Policy header?

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.

How do I disable the camera, microphone and geolocation with Permissions-Policy?

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.

What is the difference between Permissions-Policy and Feature-Policy?

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.

Does Permissions-Policy work in every browser?

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.

How do I use Permissions-Policy with iframes?

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.

What is the correct syntax for allowing specific origins?

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.

Can I set Permissions-Policy with a meta tag?

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.

ADVERTISEMENT
Demo Ad 320 x 50

All Tools, One Place

Merge, split, compress and convert files in seconds. Explore powerful free tools for all your everyday needs.

Explore All Tools →