The HTTP Content-Security-Policy-Report-Only response header allows web developers to experiment with policies by monitoring (but not enforcing) their effects. These violation reports consist of JSON documents sent via an HTTP POST request to the specified URI defined in a Reporting-Endpoints HTTP response header.

For more information, see this article on Content Security Policy (CSP).

Header type Response header
Forbidden header name no
This header is not supported inside a <meta> element.


Content-Security-Policy-Report-Only: <policy-directive>; <policy-directive>


The directives of the Content-Security-Policy header can also be applied to Content-Security-Policy-Report-Only, except for the sandbox directive, which is ignored when used with Content-Security-Policy-Report-Only.

The CSP report-to directive should be used with this header, otherwise this header will be an expensive no-op machine.


This header reports violations that would have occurred. You can use this to iteratively work on your content security policy. You observe how your site behaves, watching for violation reports, then choose the desired policy enforced by the Content-Security-Policy header.

Content-Security-Policy-Report-Only: default-src https:; report-to /csp-violation-report-endpoint/

If you still want to receive reporting, but also want to enforce a policy, use the Content-Security-Policy header with the report-to directive.

Content-Security-Policy: default-src https:; report-to /csp-violation-report-endpoint/

Violation report syntax

The report JSON object is sent with an application/csp-report Content-Type and contains the following data:


The URI of the resource that was blocked from loading by the Content Security Policy. If the blocked URI is from a different origin than the document-uri, then the blocked URI is truncated to contain just the scheme, host, and port.


Either "enforce" or "report" depending on whether the Content-Security-Policy header or the Content-Security-Policy-Report-Only header is used.


The URI of the document in which the violation occurred.


The directive whose enforcement caused the violation.


The original policy as specified by the Content-Security-Policy-Report-Only HTTP header.


The referrer of the document in which the violation occurred.


The first 40 characters of the inline script, event handler, or style that caused the violation.


The HTTP status code of the resource on which the global object was instantiated.

violated-directive Deprecated

The directive whose enforcement caused the violation. The violated-directive is a historic name for the effective-directive field and contains the same value.

Sample violation report

Let's consider a page located at It uses the following policy, disallowing everything but stylesheets from

Content-Security-Policy-Report-Only: default-src 'none'; style-src; report-to /_/csp-reports

The HTML of signup.html looks like this:

<!doctype html>
<html lang="en-US">
    <meta charset="UTF-8" />
    <title>Sign Up</title>
    <link rel="stylesheet" href="css/style.css" />
    Page content

Can you spot the violation? Stylesheets are only allowed to be loaded from, yet the website tries to load one from its own origin ( A browser capable of reporting CSP violations will send the following report as an HTTP POST request to, when the document is visited:

  "csp-report": {
    "blocked-uri": "",
    "disposition": "report",
    "document-uri": "",
    "effective-directive": "style-src-elem",
    "original-policy": "default-src 'none'; style-src; report-to /_/csp-reports",
    "referrer": "",
    "status-code": 200,
    "violated-directive": "style-src-elem"

The report includes the full path to the violating resource in blocked-uri which may not always the case. For example, when the signup.html would attempt to load CSS from, the browser would not include the full path but only the origin ( This is done to prevent leaking sensitive information about cross-origin resources.


Content Security Policy Level 3
# cspro-header

Browser compatibility

BCD tables only load in the browser

See also