Yup

JavaScript/TypeScript schema validation library with chainable API for defining and validating object shapes. Known for async validation support, excellent Formik integration, and human-readable error messages. Supports nested object schemas, conditional validation, custom transforms, and TypeScript type inference. Widely used in React form validation alongside Formik and React Hook Form.

Evaluated Mar 06, 2026 (0d ago) v1.x
Homepage ↗ Repo ↗ Developer Tools validation schema forms yup react formik async typescript
⚙ Agent Friendliness
69
/ 100
Can an agent use this?
🔒 Security
98
/ 100
Is it safe for agents?
⚡ Reliability
86
/ 100
Does it work consistently?

Score Breakdown

⚙ Agent Friendliness

MCP Quality
--
Documentation
85
Error Messages
88
Auth Simplicity
100
Rate Limits
100

🔒 Security

TLS Enforcement
100
Auth Strength
100
Scope Granularity
100
Dep. Hygiene
85
Secret Handling
100

Local computation. MIT licensed. Input validation library — reduces injection attack surface when used correctly.

⚡ Reliability

Uptime/SLA
100
Version Stability
80
Breaking Changes
78
Error Recovery
88
AF Security Reliability

Best When

You're building React forms with Formik and need human-readable async validation with TypeScript type inference from your schema.

Avoid When

You need JSON Schema compliance, maximum validation performance, or are building a non-form validation pipeline — use Ajv or Zod instead.

Use Cases

  • Validate form data in React applications with Formik or React Hook Form integration
  • Define reusable validation schemas for API request bodies with async custom validators (database uniqueness checks)
  • Validate and transform/cast user input data — Yup can coerce '42' to 42 via .cast() alongside validation
  • Enforce data shape contracts in agent pipelines with human-readable error messages for debugging
  • Build conditional validation rules where fields depend on other field values

Not For

  • High-performance bulk validation — Ajv is 10-100x faster for pure validation; Yup trades performance for ergonomics
  • JSON Schema standard compliance — Yup uses its own schema DSL, not JSON Schema; use Ajv for standard JSON Schema
  • Server-only validation without TypeScript — Zod provides better TypeScript DX; Yup is best where Formik integration matters

Interface

REST API
No
GraphQL
No
gRPC
No
MCP Server
No
SDK
Yes
Webhooks
No

Authentication

Methods: none
OAuth: No Scopes: No

Local library — no authentication required. MIT licensed.

Pricing

Model: open_source
Free tier: Yes
Requires CC: No

MIT licensed. Zero cost.

Agent Metadata

Pagination
none
Idempotent
Full
Retry Guidance
Not documented

Known Gotchas

  • validate() is async by default — returns Promise; use validateSync() for synchronous validation but sync doesn't support async custom validators
  • Yup schema types infer TypeScript types but require InferType<typeof schema> — not automatic; must explicitly type with Yup.InferType<typeof mySchema>
  • abortEarly: true (default) stops at first error — set abortEarly: false to collect all validation errors at once for form UX
  • Yup coerces/casts values by default — yup.string().cast(42) returns '42'; use strict() mode if casting is unwanted: schema.strict()
  • v1 introduced breaking changes from v0.x — nullable(), required() semantics changed; mixed() now requires explicit nullable() for null values
  • Custom async validators: async custom(value) { const exists = await db.exists(value); return !exists; } — errors thrown inside async custom() are caught as validation failures

Alternatives

Full Evaluation Report

Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for Yup.

$99

Scores are editorial opinions as of 2026-03-06.

5208
Packages Evaluated
26151
Need Evaluation
173
Need Re-evaluation
Community Powered