> ## Documentation Index
> Fetch the complete documentation index at: https://docs.neuraltrust.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Request size

> Reject oversized requests before they reach a provider with the request_size_limiter policy — by payload size and character count.

The **`request_size_limiter`** policy rejects requests whose body exceeds a configured limit,
before they're forwarded upstream — a cheap guard against accidental or abusive oversized
prompts. It runs at `pre_request`.

| Setting                  | Type | Default     | Notes                                     |
| ------------------------ | ---- | ----------- | ----------------------------------------- |
| `allowed_payload_size`   | int  | `10`        | Max body size, in `size_unit`.            |
| `size_unit`              | enum | `megabytes` | `bytes` · `kilobytes` · `megabytes`.      |
| `max_chars_per_request`  | int  | `100000`    | Max characters in the request content.    |
| `require_content_length` | bool | `false`     | Reject requests with no `Content-Length`. |

```json theme={null}
{
  "slug": "request_size_limiter",
  "settings": {
    "allowed_payload_size": 5,
    "size_unit": "megabytes",
    "max_chars_per_request": 50000
  }
}
```

Run it as a `global` [policy](/trustgate/policies/overview) at `pre_request` to set a
gateway-wide ceiling, or scope it to specific consumers for tighter per-tenant limits.
