b2KIT

Permissions Policy Generator

Build Permissions-Policy HTTP headers to control browser feature access for camera, microphone, and geolocation.

Tested tool guide Tested browser tools Checked August 16, 2026

What Permissions Policy Generator does, with a checked example

This tool assembles the Permissions-Policy response header from a few selections: pick a feature such as camera, microphone, or geolocation, pick which origins may use it, and it emits the header line to paste into your server, CDN, or reverse-proxy configuration. It maps your choices onto the header's allowlist grammar, including the empty-parens form that blocks a feature everywhere. The surprise most people hit: omitting a feature from the header does not block it. Unlisted features fall back to their default allowlist, which for most features is '*' - every origin, including third-party frames.

Worked example

A concrete input and expected output from the current implementation.

Input

Block camera and microphone for every origin. Allow geolocation only for the site itself and https://maps.example.com. Leave all other features at their browser defaults.

Expected output

Permissions-Policy: camera=(), microphone=(), geolocation=(self "https://maps.example.com")

An empty parenthesized allowlist denies the feature to every origin, so camera and microphone are fully blocked. The geolocation allowlist lists self plus one quoted origin. Features not mentioned, such as fullscreen, keep their default allowlist and are unaffected.

How the result is produced

1

Mapping selections to header syntax

Each feature has a fixed directive name (camera, geolocation, payment, and so on). The generator assigns the allowlist you chose: () denies every origin, self permits only the page's own origin, double-quoted origins permit named sites, and * permits all origins; combinations such as (self "https://example.com") are allowed. Directives are joined with commas into a single header value.

2

How enforcement reaches embedded frames

The header governs the document that carries it. An embedded frame ends up with the intersection of three inputs: the parent document's policy, the iframe's allow attribute, and the frame's own response header. A feature the parent denies or never delegates cannot be switched on by the frame, and when the policy blocks a feature, the API call fails (getUserMedia rejects) without showing the permission prompt.

Good uses

  • Hardening a public site against unwanted sensor access: block camera, microphone, and geolocation globally with feature=() while keeping them enabled only on the specific pages that legitimately need them.
  • Constraining a third-party embed such as a video player or maps widget by putting the exact origins and features it needs into the iframe's allow attribute so it cannot reach anything else.
  • Passing a security-header checklist: emit one strict policy covering camera, microphone, geolocation, payment, serial, usb, and similar directives and apply it to every response.

Limits and checks

  • Omission is permissive, not restrictive. A directive you leave out keeps the feature's default allowlist, which is '*' for most features. If your intent is to block, you must write feature=() explicitly; a header that lists only a few features changes nothing for the rest.
  • Directive coverage varies by browser. Permissions-Policy replaced the older Feature-Policy name, and several directives (for example, local-fonts or screen-wake-lock) are not implemented everywhere. A header that validates is not proof that every browser honors every directive; check current support per directive.
  • The header is document-scoped, not site-wide. It applies to the response it travels with, and it is not a standalone guarantee for content inside third-party iframes, whose policy is the intersection of your header, the allow attribute, and the frame's own headers.

Common questions

If I leave geolocation out of the header, is it blocked?

No. Omitted directives keep the feature's default allowlist, and for most features the default is '*' - allowed for every origin, including cross-origin iframes. To block a feature you must list it explicitly with an empty allowlist (geolocation=()). Treat the header as a list of restrictions, not a list of permissions.

Does my header stop a third-party iframe from using the camera?

Not on its own. A cross-origin frame's policy is the intersection of your document's policy, the iframe's allow attribute, and the frame's own response header. Set allow on the element only if the embed genuinely needs the feature, and remember the frame can also grant itself features within what your policy and the attribute permit.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools