> For the complete documentation index, see [llms.txt](https://docs.wem.io/platform/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wem.io/platform/wemreference/wmt/reference/csp.md).

# CSP

{% hint style="info" %}
The **`Csp`** template part is used to configure the Content Security Policy for the current design template.
{% endhint %}

### Syntax

`<% Csp`` `<mark style="color:blue;">`directive-name`</mark> <mark style="color:blue;">`value-1`</mark> <mark style="color:blue;">`value-2`</mark>` ``...`` `<mark style="color:blue;">`value-n`</mark>` ``%>`

### Directive Names

The table below lists the valid directive names accepted by the WEM runtime.

<table data-header-hidden data-full-width="false"><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><mark style="color:blue;"><code>directive-name</code></mark></td><td>Remarks</td></tr><tr><td>child-src</td><td>Fetch directive</td></tr><tr><td>connect-src</td><td>Fetch directive</td></tr><tr><td>default-src</td><td>Fetch directive</td></tr><tr><td>frame-src</td><td>Fetch directive</td></tr><tr><td>font-src</td><td>Fetch directive</td></tr><tr><td>img-src</td><td>Fetch directive</td></tr><tr><td>manifest-src</td><td>Fetch directive</td></tr><tr><td>media-src</td><td>Fetch directive</td></tr><tr><td>object-src</td><td>Fetch directive</td></tr><tr><td>script-src</td><td>Fetch directive</td></tr><tr><td>script-src-attr</td><td>Fetch directive</td></tr><tr><td>script-src-elem</td><td>Fetch directive</td></tr><tr><td>style-src</td><td>Fetch directive</td></tr><tr><td>style-src-attr</td><td>Fetch directive</td></tr><tr><td>style-src-elem</td><td>Fetch directive</td></tr><tr><td>worker-src</td><td>Fetch directive</td></tr><tr><td>base-uri</td><td>Document directive</td></tr><tr><td>sandbox</td><td>Document directive</td></tr><tr><td>form-action</td><td>Navigation directive</td></tr><tr><td>frame-ancestors</td><td>Navigation directive</td></tr><tr><td>report-to</td><td>Reporting directive</td></tr><tr><td>upgrade-insecure-requests</td><td>Miscellaneous</td></tr></tbody></table>

### Directive Values

Example values include: `https:`, `'sha256-ex2O7MWOzfdzthhKmdazheryN6oERSF8PrdvxrtP8dI='`, `http://*.example.com`, `'none'`, `'self'`, and `data:`.

### Example

```html
<% Csp img-src data: https://static.my-website.com %>
<% Csp font-src https://cdn.my-open-fonts.com %>
<% Csp script-src https://static.my-website.com https://cdn.other-website.com 'sha256-eReahVJiG1zBXPQyxX0V6oAxkfiBdmaNffG9eZWSUxc=' %>
<!doctype html>
<html>
    <!-- HTML content -->
</html>
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wem.io/platform/wemreference/wmt/reference/csp.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
