← Guides

How to add a Permissions-Policy header

Permissions-Policy lets a page say which powerful browser features, such as the camera, microphone and geolocation, it and the content embedded in it may use. Turning off what you don't need means a compromised script or an embedded third party can't use them either.

Updated 2026-10-23

Why it matters

  • It limits what injected or embedded code can ask the visitor for.
  • Features listed with empty parentheses are off for everyone, including embedded frames.

How to fix it

  1. Add this header to every response from example.com.

Pick what your site runs on. Replace example.com with your own domain where it appears.

After you deploy, re-check the site. A CDN or the browser cache can keep serving the old headers for a few minutes.

nginx

nginx (server or location block)
add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always;

Apache

Apache (needs mod_headers)
Header always set Permissions-Policy "camera=(), microphone=(), geolocation=()"

Caddy

Caddyfile
header {
	Permissions-Policy "camera=(), microphone=(), geolocation=()"
}

Cloudflare

Cloudflare → Rules → Transform Rules → Modify Response Header (Set static), one per line
Permissions-Policy: camera=(), microphone=(), geolocation=()

Vercel

vercel.json
{
  "headers": [
    {
      "source": "/(.*)",
      "headers": [
        {
          "key": "Permissions-Policy",
          "value": "camera=(), microphone=(), geolocation=()"
        }
      ]
    }
  ]
}

Netlify

_headers (in your publish directory)
/*
  Permissions-Policy: camera=(), microphone=(), geolocation=()

Next.js

next.config.ts
const nextConfig = {
  async headers() {
    return [
      {
        source: "/(.*)",
        headers: [
          { key: "Permissions-Policy", value: "camera=(), microphone=(), geolocation=()" },
        ],
      },
    ];
  },
};
export default nextConfig;

Express

Express middleware (before your routes)
app.use((req, res, next) => {
  res.setHeader("Permissions-Policy", "camera=(), microphone=(), geolocation=()");
  next();
});

Common mistakes

  • Switching off a feature your site uses, such as geolocation on a store locator. List only what you never use.
  • Using the old Feature-Policy header name. It was renamed; use Permissions-Policy.

Check that it worked

Run your domain through the free security headers checker. It takes a few seconds, needs no account, and shows anything still missing.

Open the security headers checker

Questions

What does the example turn off?
camera=(), microphone=(), geolocation=() disables the camera, the microphone and location for your pages and everything embedded in them. Add more features, such as payment=(), the same way.

Related guides

Don't want to check by hand? Upzy watches your site around the clock and tells you when a header, certificate or email record slips. Start free.