> For the complete documentation index, see [llms.txt](https://docs.serverlessapigateway.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.serverlessapigateway.com/security.md).

# Security

- [JWT And Security](https://docs.serverlessapigateway.com/security/jwt-hs256-setup.md): Use HS256 JWT auth when you control the signing secret and want simple issuer and audience validation. This guide walks through configuring the authorizer block
- [JWT Issuer and Audience Checks](https://docs.serverlessapigateway.com/security/jwt-hs256-setup/jwt-issuer-and-audience-checks.md): Set issuer and audience correctly so tokens from the wrong tenant or app are rejected at the edge. The gateway compares the \`iss\` and \`aud\` claims in the JWT
- [JWT: Protect Only Selected Routes](https://docs.serverlessapigateway.com/security/jwt-hs256-setup/jwt-protect-only-selected-routes.md): Gate only sensitive endpoints by setting \`auth: true\` where it matters instead of forcing auth on the whole API. The authorizer block configures how tokens are
- [JWT: Common 401 Errors](https://docs.serverlessapigateway.com/security/jwt-hs256-setup/jwt-common-401-errors.md): Debug missing bearer tokens, expired tokens, and invalid claims before blaming the upstream service. The gateway returns specific 401 error messages for each
- [Designing Public vs Private Routes](https://docs.serverlessapigateway.com/security/jwt-hs256-setup/auth-route-design-public-vs-private.md): Separate public and private paths clearly so your API contract stays understandable for clients and maintainers. Group public routes (health, docs, login)
- [Bearer Token Handling](https://docs.serverlessapigateway.com/security/jwt-hs256-setup/auth-bearer-token-handling.md): Use the standard Authorization header format so built-in token extraction works consistently. The gateway expects tokens in the \`Authorization: Bearer \<token>\`
- [Security Limitations and Non-Goals](https://docs.serverlessapigateway.com/security/jwt-hs256-setup/security-limitations-and-non-goals.md): Understand what the gateway does not implement today so you can avoid overclaiming its security surface. The gateway handles JWT validation, issuer/audience


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.serverlessapigateway.com/security.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
