Toolvito

Works on this device

Permissions Policy Generator

Make the Permissions-Policy header that tells browsers which features your pages and the frames in them may use, such as the camera, the microphone or the location. Pick each feature from a list and choose who may use it. You can also paste a header to see what it allows.

Enter your values

Pick each feature from the list and choose who may use it. The tool writes the header as a structured field dictionary.

Your values
Features

One row for each feature. Origins: type the scheme, host and port, such as https://maps.example.com; separate several with spaces or commas.

Your values are worked out in this browser. They are not sent to a server.

Your result will show here

Fill in the values, then choose the button below them.

How to use the permissions policy generator

  1. Choose Make a Permissions-Policy header. Add a row for each feature, or pick a starting list.
  2. For each feature choose who may use it: no one, this page's own origin, this origin and some others, only some origins, or every origin.
  3. For the choices with "...", type the origins, such as https://maps.example.com.
  4. Choose Make the header. Copy the header line, or the line for nginx or the Apache HTTP Server.
  5. To check a header, choose Read a Permissions-Policy header and paste it.

The syntax

  • The header is a structured field dictionary (RFC 8941): feature=allowlist, separated by commas.
  • () allows no one, not even the page itself. * allows every origin. (self) allows the page's own origin. (self "https://maps.example.com") adds an origin in double quotes.
  • An origin is a scheme, a host and a port, with no path. The tool writes it in lower case and leaves out the default port (443 for https, 80 for http).
  • A feature you leave out keeps the default its specification sets. A frame from another origin also needs the allow attribute on its iframe element.
  • The old Feature-Policy header had another syntax, such as camera 'none'. Permissions-Policy replaced it.

Where the feature names come from

The menu lists policy-controlled features from the W3C list "Policy Controlled Features" (features.md in the w3c/webappsec-permissions-policy repository), with the specification that defines each one. Browsers support different features, and many only on pages served over HTTPS. A browser ignores a name it does not know.

Worked example

The starting rows give Permissions-Policy: camera=(), microphone=(), geolocation=(self "https://maps.example.com"), fullscreen=(self), payment=(). The value has 102 characters and 5 features; 3 of them are blocked everywhere.

Pasting camera=none into the reader shows that none is not an allowlist: write camera=() to block the camera.

Limits you should know

  • The tool writes and reads text only. It does not open your site and does not test what a browser supports.
  • Origins with a * inside, such as https://*.example.com, are not written by this tool.
  • The reader follows RFC 8941. It does not read the dates and display strings that RFC 9651 added, which this header does not use.
  • The nginx and Apache lines are examples of the usual directive. Put them where your site is set up and test them.

Related tools