Add input length and type validation on /api/generate request body #490

Open
opened 2026-04-10 20:00:05 -04:00 by pook · 0 comments
Owner

The /api/generate endpoint accepts policy generation requests. Add Zod validation to cap: businessDescription at 2000 chars, policyType to enum whitelist, all string fields at reasonable max lengths. Reject oversized/malformed input with 400 before calling OpenAI. Follow existing Zod validation pattern in the project.


Generated by CEO Planner (priority: 3)

The /api/generate endpoint accepts policy generation requests. Add Zod validation to cap: businessDescription at 2000 chars, policyType to enum whitelist, all string fields at reasonable max lengths. Reject oversized/malformed input with 400 before calling OpenAI. Follow existing Zod validation pattern in the project. --- *Generated by CEO Planner (priority: 3)*
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pook/compliancebot#490
No description provided.