---
title: "What is Content Security Policy?"
term: "Content Security Policy"
description: "Content Security Policy (CSP) is a browser security standard that lets a website declare which sources of scripts, styles, images and other content may load, helping prevent cross-site scripting and other injection attacks."
url: "https://glossary.io/content-security-policy/"
published: "2026-11-22T20:33:13.599Z"
updated: "2026-11-22T20:33:13.599Z"
aliases:
  - "CSP"
topics:
  - "Privacy and security"
  - "Web development"
wikidata: "https://www.wikidata.org/wiki/Q1128636"
---

# What is Content Security Policy?

**Definition:** Content Security Policy (CSP) is a browser security standard that lets a website declare which sources of scripts, styles, images and other content may load, helping prevent cross-site scripting and other injection attacks.

**Also known as:** CSP

A site sends its policy in the Content-Security-Policy HTTP header, or in a meta tag, with directives such as script-src and img-src that list trusted sources. The browser then blocks anything that doesn't match, such as an inline script injected by an attacker, and can report violations to an address the site chooses.

CSP is developed by the W3C's Web Application Security Working Group and is supported by all modern browsers. Strict policies that use nonces or hashes instead of long allowlists give the strongest protection against [cross-site scripting](https://glossary.io/cross-site-scripting/). Adding third-party tools such as analytics or embeds usually means updating the policy, and many sites start in report-only mode to find problems before enforcing it. CSP works alongside other defenses such as a [web application firewall](https://glossary.io/web-application-firewall/).

## Content Security Policy resources

- [Official website](https://w3c.github.io/webappsec-csp/)
- [Content Security Policy on Wikipedia](https://en.wikipedia.org/wiki/Content_Security_Policy)

## Related terms

- [cross-site scripting](https://glossary.io/cross-site-scripting/)
- [iframe](https://glossary.io/iframe/)
- [web application firewall](https://glossary.io/web-application-firewall/)

**Topics:** [Privacy and security](https://glossary.io/topics/privacy-security/), [Web development](https://glossary.io/topics/web-development/)

## Cite this definition

- APA: What is Content Security Policy? (2026, November 22). Glossary. https://glossary.io/content-security-policy/
- MLA: “What Is Content Security Policy?” Glossary, Coywolf, 22 Nov. 2026, glossary.io/content-security-policy/.
- Chicago: “What Is Content Security Policy?” Glossary. Coywolf. November 22, 2026. https://glossary.io/content-security-policy/.

Published November 22, 2026.
