Content Security Policy (CSP) is a security policy mechanism used to reduce security vulnerabilities in web applications and prevent malicious attacks. CSP is used to control and limit the content executed by the browser on the web page. The main purpose of CSP is to prevent or limit attacks such as XSS (Cross-Site Scripting).