Modern web applications often rely on a wide range of browser features to deliver rich, interactive experiences. However, some of those features can introduce security and privacy risks if not properly controlled. That's where the Permissions-Policy HTTP security header comes in.
Permissions-Policy is an HTTP response header that provides granular control over the use of certain browser features. Through various directives and allowlists, site administrators can specify exactly which features are permitted in the top-level document and in embedded frames — and for which origins.
Permissions-Policy: <directive>=(<allowlist>)
Multiple directives can be combined:
Permissions-Policy: camera=(), geolocation=(self "https://example.com")
*
: Permits the feature for all origins()
: Disables the feature completelyself
: Restricts to same origin"https://example.com"
: Allows specific originEmbedded content can potentially access sensitive browser features without explicit control.
Sensor data can be aggregated for fingerprinting or used in side-channel attacks.
Lack of control over feature access could lead to regulatory compliance problems.
<IfModule mod_headers.c>
Header set Permissions-Policy "microphone=(), geolocation=()"
</IfModule>
server {
listen 80;
server_name example.com;
add_header Permissions-Policy "microphone=(), geolocation=()" always;
}
<configuration>
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Permissions-Policy"
value="microphone=(), geolocation=()" />
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>
Define broad policies at server level and refine them in specific iframes for layered security.
Use Permissions-Policy-Report-Only to log violations without enforcing restrictions.
Regularly test directives to ensure they behave as expected in your environment.
Learn about other HTTP security headers to strengthen your website's security: