DevTools Logo

Permissions-Policy Header Builder

Permissions-Policy Header Builder

Compose feature allowlists and iframe allow attributes with exact header syntax.

Runs in your browser
Presets

Feature directives

0 of 33 configured

accelerometer

Accelerometer sensor readings

ambient-light-sensor

Ambient light sensor — Limited browser support

autoplay

Automatic media playback

battery

Battery status API

camera

Camera device access

clipboard-read

Read from the system clipboard

clipboard-write

Write to the system clipboard

display-capture

Screen capture APIs

document-domain

Changing document.domain

encrypted-media

Encrypted Media Extensions

fullscreen

Fullscreen API

gamepad

Gamepad API

geolocation

Geolocation API

gyroscope

Gyroscope sensor

hid

Human Interface Device API — Chromium only

idle-detection

Idle detection API — Chromium only

local-fonts

Local font enumeration

magnetometer

Magnetometer sensor

microphone

Microphone device access

midi

Web MIDI API

payment

Payment Request API

picture-in-picture

Picture-in-Picture API

publickey-credentials-get

WebAuthn credential retrieval

screen-wake-lock

Screen wake lock

serial

Web Serial API — Chromium only

speaker-selection

Audio output device selection — Limited support

storage-access

Persistent storage access — Chromium only

usb

WebUSB API — Chromium only

web-share

Web Share API

xr-spatial-tracking

WebXR spatial tracking

keyboard-map

Keyboard layout map — Experimental

window-management

Multi-screen window placement — Experimental

otp-credentials

One-time password credentials — Experimental

Generated policy

0 directives

No directives configured

Choose a preset above or set a feature mode to build a header.

Details

Choose a state for each of 35 browser features: default (omit), allow all, self only, a quoted origin allowlist, or deny. The tool serializes a canonical Permissions-Policy header value, the full header line, an nginx add_header snippet, a report-only variant and the matching iframe allow attribute. Origins are normalized to scheme://host[:port], deduplicated, and bare self is kept unquoted as the spec requires. Presets cover deny-all, privacy-strict and embed-friendly policies. The panel is advisory only: browser support notes and the distinction between header allowlists and iframe delegation are explained in the UI.

More examples

Deny everything

Permissions-Policy: accelerometer=(), camera=(), geolocation=() …

The deny-all preset emits every catalog directive with an empty allowlist.

Allow a payment partner

payment=("https://pay.example.com")

Origins are quoted in header form; a path is reduced to its origin and duplicates are removed.

Embed delegation

allow="camera; fullscreen"

The iframe attribute lists feature tokens only; the actual allowlist stays in the response header.

    Examples

    Camera only for self

    Input
    camera = self
    Output
    camera=(self)

    The directive is emitted because its state differs from the default.

    Payment partner

    Input
    payment = https://pay.example.com/checkout
    Output
    payment=("https://pay.example.com")

    Only the origin is kept; the path is discarded and the origin is quoted.

    Iframe delegation

    Input
    camera=self, fullscreen=all, microphone=deny
    Output
    allow="camera; fullscreen"

    Denied features are not requested, and allowlists never appear in the attribute.

    About this tool

    Permissions-Policy Builder turns a set of feature choices into a syntactically correct Permissions-Policy header. Each of the 35 catalog directives can be left at its browser default, opened to every origin, restricted to self, given a quoted origin allowlist, or denied outright with an empty allowlist.

    The serializer handles the details that are easy to get wrong by hand: parentheses around every allowlist (even a single value), bare self, quoted origins, wildcard as (*), deduplication of origins that normalize to the same scheme and host, and omission of directives left at their default state. Outputs include the bare header value, a full header line, an nginx add_header snippet, a report-only variant and the iframe allow attribute.

    Three presets give a safe starting point: deny-all, privacy-strict (sensors, camera, microphone and geolocation denied, basic features self-only), and embed-friendly (common embed capabilities for self plus one partner origin). A search field filters the catalog, and per-directive support notes are advisory rather than blocking.

    This tool is deliberately separate from a CSP builder: Content-Security-Policy governs resource loading and script execution, while Permissions-Policy governs access to powerful browser features. Nothing is fetched or uploaded; all parsing and emission happen locally.

    What this tool does not do

    • The catalog is a curated snapshot; newly proposed features may be missing until the list is updated.
    • Browser support notes are advisory and are not a compatibility guarantee.
    • Report-only output is a header suggestion; reporting endpoints must be configured separately.
    • Origin validation checks HTTP(S) URL syntax; it does not verify that the origin exists or is trusted.
    • No server configuration is applied — the tool emits text for you to deploy.

    How to use this tool

    1. Start from a preset

      Click Deny all, Privacy strict or Embed friendly to populate the directive states, then refine individual rows.

    2. Set feature states

      Use each row's state control to choose default, all, self, allowlist or deny. Choosing allowlist reveals an origin editor.

    3. Edit allowlists

      Enter comma-separated origins such as self or https://pay.example.com. Paths and query strings are reduced to the origin.

    4. Pick an output format

      Switch output tabs for the header value, complete header, nginx snippet, report-only header or iframe allow attribute.

    5. Copy and deploy

      Copy the generated text into your server configuration. Roll out report-only first if you are unsure about breaking embedded features.

    Use cases

    Security headers

    Ship a restrictive default policy alongside your existing CSP and HSTS configuration.

    Org-wide baseline

    Define a privacy-strict set of directives and reuse the generated header across services.

    Embedded widgets

    Grant only the features an embed needs, both in the header and in its iframe allow attribute.

    Staged rollouts

    Use the report-only variant to observe impact before enforcing the header.

    Allowlist grammar

    StateEmitted value
    default(omitted)
    all(*)
    self(self)
    allowlist(self "https://a.example")
    deny()

    Canonical output always uses parentheses for clarity, even where the grammar permits a bare wildcard.

    Common mistakes

    Mistake:Quoting self in a header allowlist.

    Fix:The grammar uses bare self; the builder emits (self), not ("self").

    Mistake:Putting origins in an iframe allow attribute.

    Fix:The attribute lists feature names only; the response header carries the allowlist.

    Mistake:Assuming an unlisted directive is denied.

    Fix:Unlisted features keep their browser default. Use Deny all to emit an explicit () for every catalog directive.

    Mistake:Expecting a path to narrow an origin.

    Fix:Permissions-Policy matches origins, not paths; the builder strips paths and query strings.

    Mistake:Treating support badges as errors.

    Fix:Badges are informational: browsers differ, but the header is emitted regardless.

    Frequently asked questions

    How is Permissions-Policy different from CSP?

    Content-Security-Policy decides which resources a page may load and execute. Permissions-Policy decides which powerful browser features — camera, microphone, geolocation and so on — the page and its embedded frames may use. They are separate headers with separate grammars; this tool generates only Permissions-Policy.

    What does 'self' include?

    It means the origin of the document serving the header: scheme, host and port. It does not include subdomains, sibling origins or a different port. If you need another origin, add it explicitly to the allowlist; the builder normalizes it to scheme://host[:port] and removes any path.

    Why are some values quoted?

    The header grammar quotes literal origins, as in payment=("https://pay.example.com"). The special tokens self and the wildcard * are bare. The builder always wraps allowlists in parentheses for readability, including single-element lists where the grammar would allow a shorter form.

    How do iframe allow attributes relate to the header?

    The response header defines the policy that cannot be exceeded. An iframe allow attribute can only request delegation of features the header permits; it cannot grant more. The generated attribute lists feature names separated by semicolons, because allowlists belong in the header.

    What happens to features I do not list?

    They keep their browser-defined default, which varies by feature. If you want a truly closed policy, apply the Deny all preset so every catalog directive is emitted with an empty allowlist. Note that the catalog is curated rather than exhaustive.

    Can I roll this out safely?

    Use the Report-only output tab first. A Permissions-Policy-Report-Only header evaluates the policy without enforcing it; configure a reporting endpoint separately to collect violations. Once you are comfortable, deploy the enforced header with the same value.

    Does the tool contact any server?

    No. The directive catalog is bundled, origin normalization uses the browser's URL parser, and all output is generated locally. Nothing you type is uploaded or sent to an analytics endpoint.

    References & standards