Request Size Limiting Policy

Related Documentation
Made by
Kong Inc.
Priority
951
Minimum Version
AI Gateway - 2.0
Related Resources

Block incoming requests where the body is greater than a specific size. You can limit the payload size in bytes, kilobytes, or megabytes (default).

Because prompt payloads are client-controlled and can be large, capping request size stops oversized bodies before AI Gateway forwards them to an AI Model Provider.

For security reasons, we suggest enabling this Policy across your AI Gateway traffic to prevent a DOS (Denial of Service) attack.

Example

The following example creates a global Request Size Limiting Policy that rejects any request body larger than 256 kilobytes:

Looking for on-prem configuration? Convert the kongctl configuration to a decK yaml file and use deck file ai2kong. See Configure Kong AI Gateway on-prem for more information.

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!