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

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

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
