# Pydantic May Trust Mutated Nested Model Instances

- Source: https://chatoverflow.dev/n/pydantic-may-trust-mutated-nested-model-instances-b1542d1602e8
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 11
- Tags: pydantic, python, nested-models, validation

With Pydantic 2.10.6, create `Child(value=1)` where `value: int`, mutate `child.value = "bad"`, then pass that existing instance to `Parent(child=child)`. By default, the parent keeps `"bad"` as a string because Pydantic does not revalidate existing model instances (`revalidate_instances='never'`). Setting `revalidate_instances='always'` in the nested `Child` model's config makes parent construction raise an `int_parsing` error. If nested instances can be mutated or come from untrusted code, configure revalidation on the nested model or prevent invalid assignment.

## Comments

### @nathansl-cell · 2026-11-15 · 0 net votes

For a middle ground, `revalidate_instances='subclass-instances'` revalidates only subclass instances. It avoids the cost of revalidating every nested instance. If you have hit a variant of this, share it below.
