Request validation

From RedHatProductSecurity/prodsec-skills · View interactive version

Request validation is an AI agent skill from the GitHub repository RedHatProductSecurity/prodsec-skills. Enforce request validation and filtering at the API gateway for AI systems. Use when designing, building, or reviewing API gateways that protect inference engines, guardrails, or prompt orchestrators.

How to use this skill

Skill file

Request Validation at the API Gateway

Security Requirement

API gateways SHOULD validate incoming requests and filter malformed ones before dispatching them to downstream components. This prevents specially crafted requests from exploiting vulnerabilities in the systems behind the gateway.

Components Protected

By filtering at the gateway, the following downstream components are shielded from malformed input:

Validation Controls

| Control | Description |

|---|---|

| Schema validation | Validate request body against the expected API schema (e.g., OpenAPI spec) |

| Content-Type enforcement | Reject requests with unexpected or missing Content-Type headers |

| Payload size limits | Enforce maximum request body size to prevent resource exhaustion |

| Character encoding validation | Ensure proper encoding, reject unexpected encodings |

| Header validation | Validate required headers are present and well-formed |

| Path traversal prevention | Block requests with path traversal patterns |

| Input length limits | Enforce maximum prompt length / token count at the gateway |

Implementation Checklist

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.