# Add input validation at an unvalidated boundary

A request handler that trusts its input. Add the schema and the tests that prove bad shapes are refused.

Category: Security patching
Source: https://letsship.ai/use-cases/add-input-validation-at-an-unvalidated-boundary
Published: 2026-08-25

## Goal

Validate the input at one request boundary against an explicit schema, and refuse anything that does not match.

## Acceptance criteria

- Every field is validated against an explicit schema
- A test per malformed shape asserts the request is refused
- The refusal uses the project's existing error shape
- Valid requests behave exactly as they did before

## What lands as proof

The schema, a test per malformed shape, and a test proving the happy path is unchanged.

## Prompt

Copy this to an agent to open the ticket:

```text
Create a Linear issue in my team and assign it to the SHIP agent.

Title: Validate input on {endpoint}

Description: One request boundary accepts its input without validating it. Add an explicit schema and refuse anything that does not match.

Acceptance criteria:
- Every field is validated against an explicit schema
- A test per malformed shape asserts the request is refused
- The refusal uses the project's existing error shape
- Valid requests behave exactly as they did before

Before you create the issue, find a handler in this repository that reads request input without a schema and replace {endpoint} with it. Use the validation library the project already depends on.
```

## Questions

### What does the agent actually change?

The ticket is scoped to one outcome: validate the input at one request boundary against an explicit schema, and refuse anything that does not match. Work that serves that outcome is in scope, and anything outside it is left for a separate ticket, so the pull request stays reviewable.

### How do I know the work is done?

The pull request carries the evidence, not only the diff. Here that means schema plus a rejection test for each malformed shape, so a reviewer can confirm the result without reproducing the work locally.

### How much oversight does this need?

None is required before the run starts. Every claim this ticket makes can be checked by machine, so the agent works straight through and a person reviews the finished pull request like any other.
