Skip to content
masterclass Buddy

Pydantic · Type Alias

SecretStr

SecretStr stores a sensitive string while masking it in normal output. Use get_secret_value() to read the original value when needed.

Last updated

Syntax

password: SecretStr

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • SecretBytes
  • Secret
  • get_secret_value
  • field_serializer

Source: Pydantic Types. Checked 2026-11-03.