Input Validation

Updated Sep 18, 2026

Input validation is the process of checking data before a system accepts or uses it. It confirms that values have the expected type, shape, range, and meaning. In a vibe-coded software audit, validation is traced across forms, APIs, files, integrations, and background jobs rather than judged from the interface alone.

Input validation defines what data the system is prepared to handle. It rejects values that do not meet that contract before they reach storage, business logic, a command, or another service. The same contract must hold at every entry point, including entry points that do not have a visible form.

Input arrives from more than users

Browser controls improve usability, but they do not establish a trusted boundary. Requests can be sent directly to an API. Data can also arrive from imports, webhooks, scheduled jobs, message queues, and other services. Each source can be malformed, incomplete, stale, or valid in structure but invalid for the current business state.

An audit of vibe-coded software inventories these entry points. Generated features may define a schema for one route and repeat a looser version elsewhere. The code looks consistent at screen level while different paths accept different meanings for the same field.

Input sourceStructural checkContextual check
Web formRequired fields and typesAllowed value for this user
API requestSchema and size limitsValid operation in current state
File importFormat, columns, encodingRecords belong to the right account
WebhookPayload shape and signatureEvent is current and expected
Background jobStored data still parsesPreconditions still hold

Validation has layers

Structural validation asks whether the data can be interpreted safely. Business validation asks whether it makes sense for the requested operation. Authorization remains a separate decision: a correctly shaped account identifier does not prove that the caller may access that account.

A review distinguishes several checks:

  • Type: Confirm that a value is a string, number, date, list, or expected object.
  • Štruktúra: Require known fields and reject unexpected nesting where it changes behaviour.
  • Bounds: Limit lengths, ranges, collection sizes, and file sizes.
  • Format: Parse identifiers, dates, addresses, and structured content deliberately.
  • Meaning: Verify that the value is allowed in the current workflow and relationship.

What weak validation looks like

Weak validation is often duplicated and optimistic. One route converts invalid data silently, another relies on a database error, and a third passes a value into a downstream service. Error handling then becomes part of the contract by accident. The audit checks whether rejected data fails before it changes state and whether the response exposes internal details.

Threat modeling directs attention to inputs that cross important trust boundaries. Free text that is displayed later, identifiers used in queries, file uploads, callback URLs, and values passed to external tools all deserve explicit handling. The audit does not assume that a framework default covers the complete path.

Evidence that validation holds

Tests should cover valid boundaries, invalid values, missing values, oversized payloads, and combinations that violate business rules. They should call the server entry point rather than only the interface component. The expected result includes the absence of side effects: no partial write, queued job, or external call after rejection.

This verification belongs to the production discipline described in vibe coding versus agentic engineering. A visible form can guide a normal user. Reliable input validation protects the system when data arrives through every other route the product exposes.