Success criterion 3.3.1 requires that errors be identified and described to the user in text, since a red border alone conveys nothing to a screen reader user or someone who cannot perceive color differences. A well-built error message is programmatically associated with its field (commonly via aria-describedby) and specific enough to act on, such as “Email address is missing the @ symbol” rather than a generic “Invalid input.”
Errors also need to be announced to screen reader users as they appear, typically through an ARIA live region, and ideally summarized at the top of the form so a user does not have to hunt through every field to find what went wrong.