Request Size Limiting Policy

Related Documentation
Made by
Kong Inc.
Incompatible with
on-prem
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:

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!