What is a content security policy?

Definition

A site sends directives that restrict categories such as scripts, images, connections and embedded frames. The browser checks activity against those rules rather than trusting every resource requested by the page.

A policy can reduce exposure when untrusted content reaches an application, but it does not replace safe input handling, authentication or isolation. Incorrect restrictions can also break legitimate features.

ELI5

Think of a content security policy as a guest list for a web page: the browser checks which outside resources are allowed to enter.

For example, a page may allow scripts from its own server while blocking an unexpected script from an unrelated website.

Does a policy make an app completely safe?

No. It is one protective layer and depends on appropriate rules and other security controls.

Can it block a legitimate feature?

Yes. A resource or connection outside the permitted set can be blocked even when the application needs it.

  1. Frédéric Barthelet beside the headline MCP App Security.
  2. Kenton Varda in a blue top beside PERSONAL AI APPS and three small blue app squares on black.
Definition card for content security policy: What is a content security policy?

A content security policy gives a browser rules limiting which resources a web document may load and some operations it may perform. AI app hosts can use it as one layer of protection for embedded interfaces.