# Helmet

Helmet helps you secure your Express apps by setting various HTTP headers

```bash
npm install helmet
```

By default does following:

| Module                                                                                                      | Notes                                                                                         | Why                                                                               |
| ----------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| [frameguard](https://helmetjs.github.io/docs/frameguard/)                                                   | tells browsers to prevent your webpage from being put in an iframe                            | to prevent clickjacking                                                           |
| [hsts](https://helmetjs.github.io/docs/hsts/) for HTTP Strict Transport Security                            | won’t tell users on HTTP to *switch* to HTTPS, it will just tell HTTPS users to stick around  | HTTP sucks                                                                        |
| [ieNoOpen](https://helmetjs.github.io/docs/ienoopen) sets X-Download-Options for IE8+                       | ✓                                                                                             |                                                                                   |
| [noSniff](https://helmetjs.github.io/docs/dont-sniff-mimetype) to keep clients from sniffing the MIME type  | they will trust what the server says and block the resource if it’s wrong instead of guessing | if client recieves html(user uploaded data) even with wrong mime, it could run it |
| [xssFilter](https://helmetjs.github.io/docs/xss-filter) adds some small XSS protections                     | ✓                                                                                             |                                                                                   |
| [dnsPrefetchControl](https://helmetjs.github.io/docs/dns-prefetch-control) controls browser DNS prefetching | ✓                                                                                             |                                                                                   |


---

# Agent Instructions: 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://openai.gitbook.io/code-cheatsheets/js/all/node/packages/helmet.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.
