# @adonisjs/shield

> A middleware for AdonisJS to keep web applications secure from common web attacks

Latest version **9.0.1** (published 2026-11-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install @adonisjs/shield
pnpm add @adonisjs/shield
yarn add @adonisjs/shield
bun add @adonisjs/shield
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 9.0.1 |
| Published | 2026-11-19 |
| First published | 2017-08-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=24.0.0 |
| Dependencies | 1 |
| Unpacked size | 43.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 52 |
| Author | Harminder Virk |
| Maintainers | romainlanz, virk, julien-r44 |
| Keywords | adonisjs, adonis, web-security, csrf, csp |

## Links

- npm: https://www.npmjs.com/package/@adonisjs/shield
- Repository: https://github.com/adonisjs/shield
- Homepage: https://github.com/adonisjs/shield#readme
- Issues: https://github.com/adonisjs/shield/issues
- npm.io page: https://npm.io/package/@adonisjs/shield

## Dependencies (1)

- [csrf](https://npm.io/package/csrf.md) ^3.1.0

## Recent versions

- 9.0.1 (latest) — 2026-11-19
- 9.0.0-next.2 (next) — 2025-12-19
- 1.1.0 (legacy) — 2021-03-26
- 4.0.3 (alpha) — 2020-11-28
- 9.0.0 — 2026-02-25
- 9.0.0-next.1 — 2025-09-22
- 9.0.0-next.0 — 2025-09-10
- 8.2.0 — 2025-03-25
- 8.1.2 — 2025-01-30
- 8.1.1 — 2024-02-02
- 8.1.0 — 2024-01-22
- 8.0.1 — 2024-01-09
- 8.0.0 — 2024-01-09
- 8.0.0-10 — 2023-12-26
- 8.0.0-9 — 2023-11-27
- … 51 more at https://npm.io/package/@adonisjs/shield/versions

## README

# @adonisjs/shield

<br />

[![gh-workflow-image]][gh-workflow-url] [![npm-image]][npm-url] ![][typescript-image] [![license-image]][license-url]

## Introduction
A package to keep AdonisJS applications safe from common Web attacks like **XSS**, **CSRF Protection** and a lot more.

## Official Documentation
The documentation is available on the [AdonisJS website](https://docs.adonisjs.com/guides/web-security)

## Contributing
One of the primary goals of AdonisJS is to have a vibrant community of users and contributors who believes in the principles of the framework.

We encourage you to read the [contribution guide](https://github.com/adonisjs/.github/blob/main/docs/CONTRIBUTING.md) before contributing to the framework.

## Code of Conduct
In order to ensure that the AdonisJS community is welcoming to all, please review and abide by the [Code of Conduct](https://github.com/adonisjs/.github/blob/main/docs/CODE_OF_CONDUCT.md).

## License
AdonisJS Shield is open-sourced software licensed under the [MIT license](LICENSE.md).

[gh-workflow-image]: https://img.shields.io/github/actions/workflow/status/adonisjs/shield/checks.yml?style=for-the-badge
[gh-workflow-url]: https://github.com/adonisjs/shield/actions/workflows/checks.yml "Github action"

[npm-image]: https://img.shields.io/npm/v/@adonisjs/shield/latest.svg?style=for-the-badge&logo=npm
[npm-url]: https://www.npmjs.com/package/@adonisjs/shield/v/latest "npm"

[typescript-image]: https://img.shields.io/badge/Typescript-294E80.svg?style=for-the-badge&logo=typescript

[license-url]: LICENSE.md
[license-image]: https://img.shields.io/github/license/adonisjs/shield?style=for-the-badge

---
_Source: https://npm.io/package/@adonisjs/shield · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
