Skip to content

Permissions-Policy ​

Every page Edge serves starts with a Permissions-Policy that denies the camera, the microphone, geolocation, payment, USB, and the interest cohort. A page that calls getUserMedia has to replace that header. The browser still asks the visitor before the camera or microphone turns on.

The web app does not edit response headers. Ask an agent, or send the header with the API. The agent runs edge_distribution_update. That call is checked immediately and creates a deployment. Visitors keep the previous header until that deployment is promoted.

GET /v1/distributions/{id}/header-check (edge_header_check) shows the stored headers and does not change them.

The headers object is replaced as a whole. Include every response header you want to keep. Other config, such as redirects and access, stays.

Allowed values ​

Send the whole header. A shorter policy is rejected: a feature you leave out falls back to the browser default instead of staying denied. Feature order does not matter.

Microphone on this origin, camera denied:

camera=(), microphone=(self), geolocation=(), payment=(), usb=(), interest-cohort=()

Camera and microphone on this origin:

camera=(self), microphone=(self), geolocation=(), payment=(), usb=(), interest-cohort=()

(self) is this site's own origin. It does not allow the camera or microphone inside a frame on someone else's site. A parent page that denies the camera also blocks a frame of this site, so the call page has to be the top-level document.

text
On the acme-marketing distribution, set Permissions-Policy so this origin can request the camera and the microphone, and keep geolocation, payment, USB, and interest-cohort denied. Include the headers that are already set.
bash
edge api PATCH /v1/distributions/d3f7a1c4-90b2-4e6a-8f15-6c2b7e0a9d38 --input - <<'EOF'
{
        "headers": {
          "permissions-policy": "camera=(self), microphone=(self), geolocation=(), payment=(), usb=(), interest-cohort=()"
        }
      }
EOF
bash
curl -s -X PATCH \
  https://api.edge.deca-dev.com/v1/distributions/d3f7a1c4-90b2-4e6a-8f15-6c2b7e0a9d38 \
  -H "Authorization: Bearer $EDGE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
        "headers": {
          "permissions-policy": "camera=(self), microphone=(self), geolocation=(), payment=(), usb=(), interest-cohort=()"
        }
      }'

Promote the deployment that update returns before checking the live site.

Rejected ​

ValueWhy
camera=* or microphone=*Allows every origin
camera=(self "https://other.example")Allows an origin other than this site
microphone=()Microphone must stay (self) when you set this header
microphone=(self) aloneOmitted features are not a deny
geolocation=(self), payment=(self), usb=(self)Those features stay denied
Set-CookieNot on the header allowlist

When the distribution does not set permissions-policy, the platform baseline stays in place and denies the camera and the microphone as well.