Probeo
probeo

What is a Content Security Policy?

A clear explanation of what a Content Security Policy is, why teams lose track of it, and what becomes visible once it is defined.

Last updated 01/21/2026

A Content Security Policy (CSP) is a set of rules a website sends to the browser that defines what the site is allowed to load and run. It names which sources are trusted for scripts, images, styles, frames, and other resources, and tells the browser to block everything else. A CSP makes expected behavior explicit instead of relying on browser defaults.

What a Content Security Policy is

A Content Security Policy is a declaration of intent. It states which external systems a site depends on and which ones it does not. Once the policy exists, the browser enforces those boundaries consistently. The browser no longer guesses.

Where teams usually encounter this

Teams often encounter CSP indirectly. The site appears healthy. Pages load. Features work. Yet questions about where code comes from or why certain requests exist lead to repeated investigation instead of clear answers. Nothing is obviously broken, but confidence erodes.

The hidden failure mode

When no CSP exists, the browser allows most behavior by default. New dependencies appear quietly. Old ones remain long after they are needed. This is not a technical failure. It is an understanding failure caused by missing boundaries.

Why this happens as sites grow

As sites grow, ownership spreads across teams, vendors, and tools. Each addition makes sense locally. Without a single policy that names what is allowed, the full picture never exists in one place. The absence of a CSP is rarely deliberate. It is the result of growth without explicit limits.

What’s wrong

Without a Content Security Policy, the browser cannot distinguish expected behavior from unexpected behavior. Everything looks acceptable, including things that should not be there.

Why it matters

Most security incidents begin with ambiguity, not alarms. A CSP reduces ambiguity by making intent explicit. When expectations are clear, unexpected behavior stands out.

The correct change

Define a Content Security Policy that reflects how the site actually behaves today. Instruct the browser to allow only known, intentional sources and block everything else.

Scope

This is usually enforced at the template or header level. The same policy should apply wherever the same page structure and delivery path are used.

How to verify

Inspect the response headers to confirm a Content Security Policy is present. When a resource violates the policy, the browser blocks it and records a violation.

What becomes clearer once a CSP exists

  • Which external systems the site actually depends on
  • Which behaviors are intentional versus accidental
  • Where dependency drift has accumulated
  • When new behavior appears without agreement

Common questions teams ask

Is a Content Security Policy the same as a security scan?
No. A CSP does not look for problems. It defines expected behavior so the browser can block behavior outside those expectations.
Can a site work without a CSP?
Yes. Many sites function without one. The issue is not breakage. It is the lack of visibility into what the browser allows by default.
Does a CSP replace other security controls?
No. It does not replace validation, authentication, or access control. It limits the impact of mistakes by narrowing what the browser will accept.
Why do CSP changes surface unexpected issues?
Because many dependencies were never documented. Once boundaries exist, hidden behavior becomes visible.
Should every page use the same CSP?
Often yes, when pages share structure and dependencies. Differences should be intentional and understood.
Is CSP only a security concern?
No. It is about shared understanding. It helps teams agree on what the site is actually doing.