Content Security Policy (CSP) is a security standard introduced to prevent various types of attacks like cross-site scripting (XSS) and data injection by allowing web developers to control resources the user agent is allowed to load for a given page. It provides a layer of security by specifying which content sources are trustworthy, thus reducing the risk of malicious content being executed on a website.