An error message is useful only when it accurately identifies the problem and helps someone recover. Before AI drafts the sentence, give it a verified error state, an approved next action, and firm boundaries around what the interface may reveal.
“Something went wrong” is vague. “Your file contains malware” may disclose more than the product can safely establish. “Try again” is misleading when another attempt cannot work. A polished model-generated sentence can fail in all three ways while sounding calm and professional.
This workflow is for teams reviewing AI-assisted error and validation copy. It covers public-facing messages, not the underlying controls. Accessibility, privacy, security, sector, and legal requirements vary, so apply the standards and review processes governing the actual service.
An Error Message Is A State Contract, Not A Tone Exercise
The sentence users see sits at the end of a product decision. The system detected a state, the interface handled the submission, and recovery may be available. Some facts may be safe to disclose; others belong only in controlled logs.
An AI tool cannot discover those facts from “make this error friendlier.” It may infer a cause, promise saved work, suggest an unsupported action, or expose an internal exception. The result can be fluent but operationally false.
The NIST Generative AI Profile treats confabulation as a characteristic risk of generative systems: output can be confidently wrong or inconsistent with its inputs. For error copy, the practical control is straightforward. The system and its owners establish the state; AI may draft language inside that established record.
Start With The State, Not The Sentence
Create one error-state record before requesting copy. Give each state a stable identifier so the design, code, tests, support material, analytics, and published message refer to the same event.
- State ID: the stable name used by the product and test suite
- Verified trigger: the exact condition that creates the state and the component that knows it
- User object: the field, file, action, or service named in the interface
- Safe public facts: what the product can accurately tell the user
- State consequence: what was accepted, rejected, changed, submitted, or preserved
- Recovery: the next action that is available and expected to work
- Internal diagnosis: codes and technical evidence that must remain outside public copy
- Owner and review tier: who verifies the state and which specialists must approve it
Do not let the copy become the only place where these decisions exist. If nobody can confirm whether other answers remain saved after an upload failure, the message must not claim that they are saved. Resolve the product behavior or remove the promise until it can be verified.
Constraints should have one authoritative source. Do not copy file limits, accepted formats, password rules, availability, retry limits, or eligibility independently into code, support content, and prompts. A message built from a stale limit can be clear and still wrong.
Classify The Failure Before Choosing A Pattern
Not every interruption is a field-level validation error. Classification determines the placement, detail, action, and review needed.
- Missing or unacceptable input: the person can correct a known field or value, such as an omitted name, unsupported file format, or value outside an allowed range.
- Permission or eligibility: the person cannot complete the action under the current account, role, policy, or service rules. This usually needs an explanation or alternative route rather than instructions to “fix” valid input.
- Transient service failure: the user’s input may be acceptable, but a dependency, network, capacity limit, or internal process prevented completion. Recovery may involve waiting, retrying, or using another channel.
- Conflict or changed state: the underlying record changed, expired, or was completed elsewhere. The interface should explain the current state and the safe choices instead of blaming the last action.
- Security-sensitive rejection: the system blocked an action, but revealing its precise rule, evidence, account status, or internal structure could create risk. Public copy and controlled diagnostics need separate designs.
The GOV.UK Design System error-message guidance makes a useful distinction: a validation message is for input the user can correct. Ineligibility, lack of permission, service capacity, and other problems outside the user’s control require a different pattern with useful next-step information.
The correct component depends on the service and its design system. Copy should never present a service failure as a typing mistake or ask someone to repair a condition they cannot change.
Write For Identification And Recovery
WCAG 2.2 Success Criterion 3.3.1 requires automatically detected input errors to be identified and described in text. Success Criterion 3.3.3 calls for known correction suggestions unless providing them would jeopardize security or the purpose of the content.
A practical message therefore answers three questions when the verified state permits it:
What object needs attention? Use the same recognizable label the interface uses.
What is wrong? Name the actual constraint or missing value in plain language.
What can the person do next? Give a specific action that the product supports.
“File is invalid” identifies neither the relevant constraint nor a reliable correction. “Choose a PDF, DOCX, or TXT file” names the action and accepted formats. “Password error” is weaker than a message that states the unmet verified requirement. “Request failed” should not become “Check your internet connection” unless the service actually knows the connection caused the failure.
Match the wording to the field or action label so the message remains understandable away from its visual position. Prefer direct, neutral language over blame, jokes, or emotional performance. An apology does not replace a recovery step, and “please” does not make an impossible action possible.
Specificity has a boundary. Withhold values, rejection rules, or account facts when disclosure creates security, privacy, abuse, or product-integrity risk. Provide the safest useful action instead.
Put The Message Where People Can Use It
Good wording cannot repair inaccessible implementation. The error needs to be programmatically associated with the relevant field or control, exposed in text rather than color alone, and discoverable after submission. When several fields fail, users may need both a summary and a message beside each affected field.
The GOV.UK validation guidance recommends matching inline and summary messages, moving focus to the summary after validation, and preserving both passing and failing answers. It also advises against clearing fields when showing an error. These practices reduce re-entry and make the route back to the problem easier to understand.
Test accessibility patterns in the actual component. Focus, announcements, field associations, summaries, and dynamic messages interact with the framework and assistive technology. Pair copy review with the implementation checks in the related accessibility pass for AI-assisted writing.
Preservation claims require the same discipline. Say “Your other answers are saved” only when the tested product state guarantees it. If the failed action discarded a file but retained the rest of the form, state that distinction only when it materially helps recovery.
Separate Public Copy From Internal Diagnostics
An exception message written for developers is rarely safe or useful public copy. It may reveal a framework version, file path, database structure, query, storage location, account status, security rule, or dependency name. It may also be too unstable to support a durable user instruction.
The OWASP Error Handling Cheat Sheet warns that unhandled errors can expose technical information useful for reconnaissance. It recommends controlled error handling in which users receive an appropriate generic response while detailed evidence is captured through logging.
Generic does not have to mean useless. “We could not check your file. Try again in a few minutes” can be both safer and more actionable than a raw scanner exception. The internal record can separately contain the scanner response, service version, request trace, retry status, and timestamp.
If a public message includes a reference code, confirm support can use it and that it encodes no sensitive data. Treat logs as sensitive records: limit collection, access, and retention, and keep production traces and personal data out of unapproved AI services. The same boundary applies in the privacy checklist for AI-assisted writing.
Give AI A Bounded Drafting Job
Once the state record is approved, AI can propose concise variants, align related messages, or flag inconsistent terminology. Supply the verified facts rather than raw logs. Require the model to expose missing information instead of filling it in.
Task: Draft user-facing error-message candidates for the approved state records below. Do not diagnose the system or change product behavior.
Inputs: State ID, exact interface label, verified trigger, safe public facts, preserved or discarded data, approved recovery actions, prohibited disclosures, voice guidance, and length constraints.
Rules: Produce one message per state. Identify the affected object using its approved label. Describe only the verified problem. Give a correction or next action only when the state record supports it. Do not invent a cause, promise, timeline, saved state, permission, eligibility decision, or support channel. Do not expose internal codes, paths, versions, security rules, personal data, or raw exceptions. Mark missing facts as
[REVIEW: question].Output: Return the state ID, proposed message, facts used, and unresolved questions. Do not claim that the message is accessible, secure, tested, or approved.
The prompt constrains drafting; it does not validate the interface. A human reviewer must compare each candidate with the state record, and the implemented message must be tested by triggering the actual failure.
Worked Example: One Failed Upload, Five Different States
A team begins with one universal message: “Upload failed. Please try again.” Support tickets show that people retry files that can never succeed, while a temporary scanning outage looks identical to a format problem. Engineering and content build the following matrix before rewriting the copy.
| State and verified trigger | User-facing message | Recovery and preserved state | Internal-only evidence |
|---|---|---|---|
| UPLOAD_EMPTY No file was selected |
Choose a file to upload. | Return focus to the file control; retain other form answers | Validation event and component version |
| UPLOAD_TYPE Detected type is outside the approved list |
Choose a PDF, DOCX, or TXT file. | Select another file; retain other form answers | Detected type, extension, and validator result |
| UPLOAD_SIZE File exceeds the current 10 MB limit |
Choose a file smaller than 10 MB. | Reduce or replace the file; retain other form answers | Measured size, configured limit, and request trace |
| SCAN_UNAVAILABLE The scanning service returned a retryable failure |
We could not check your file. Try again in a few minutes. Your other answers are saved. | Retry later; the tested form state retains all non-file answers | Dependency response, retry status, timestamp, and trace ID |
| FILE_REJECTED The security service blocked the file |
We could not accept this file. Choose a different file or contact support. | Replace the file or use the approved support route | Security classification, rule, evidence, and restricted trace |
The five messages differ because the states differ. The type and size failures can reveal exact correction criteria. The temporary service failure can suggest a retry because the dependency marked it retryable. The saved-state sentence is permitted only because the team verified that behavior. The security rejection omits the rule while still providing an approved route forward.
Another service may use different formats, limits, or security disclosures. Derive every sentence from the product’s real state and threat model.
The team then triggers all five states in the implemented form. It discovers that the scanning failure preserves text fields on desktop but clears them on mobile. That is a product defect, not a wording problem. Until the behavior is fixed and retested, the message cannot promise that other answers are saved.
Test The Whole Recovery Path
Reviewing a copy document is not enough. Use the same literal execution principle as the procedure dry-run workflow: create each failure, observe the interface, follow the stated action, and confirm the resulting state.
- Trigger every state using a documented test case rather than a mocked screenshot alone.
- Confirm that the implemented state ID selects the intended message.
- Verify every format, size, date, limit, label, and next action against the authoritative product source.
- Check that the message does not infer a cause the system cannot establish.
- Confirm that passing and failing values are retained or cleared exactly as the copy states.
- Verify that inline messages are associated with the correct fields and that errors are described in text, not color alone.
- When a summary is used, confirm that focus reaches it and its links move to the correct controls.
- Complete the flow by keyboard and with representative screen-reader testing.
- Test narrow screens, zoom, text resizing, long labels, and supported languages.
- Follow every retry, replacement, cancellation, support, and alternate-channel action to its real destination.
- Test timeouts, repeat submissions, offline transitions, changed permissions, and dependency failures according to risk.
- Inspect the public response for stack traces, paths, versions, internal rules, identifiers, and personal data.
- Confirm that controlled logs capture enough evidence to investigate the state without relying on the user-visible sentence.
- Re-run affected states after any change to validation logic, limits, components, routing, or message text.
Automated tests can verify state-to-message mappings, constraints, links, and selected accessibility properties. Human testing remains necessary for clarity, context, focus order, assistive-technology behavior, and whether the proposed recovery actually makes sense.
Set A Human Release Gate
No single reviewer can establish every part of an error message. Assign approval according to consequence.
- Product or domain owner: confirms the state, consequence, available action, and any promise about saved work or timing.
- Engineer: confirms the trigger, mapping, implementation, retry behavior, and diagnostic separation.
- Content reviewer: checks labels, clarity, consistency, tone, and whether the message remains useful out of context.
- Accessibility reviewer: evaluates identification, suggestion, field association, summary, focus, and representative assistive-technology behavior.
- Security or privacy reviewer: approves detail boundaries for sensitive states and the handling of logs, identifiers, and user data.
- Accountable release owner: accepts the evidence and any documented limitation for the service’s actual risk.
Low-impact copy may combine several roles. Account recovery, payments, health, legal rights, identity, sensitive uploads, and irreversible actions may require independent or specialist review. These are routing decisions for the organization, not certifications an AI tool can issue.
Record the approved message with its state ID and authoritative constraints. If a limit or recovery route changes, route the affected messages back through review. Do not assume that a grammatically unchanged sentence remains correct after the underlying product changes.
Use Production Evidence To Improve The Journey
Track error frequency, repeated attempts, successful recovery, abandonment, support contacts, and state changes when policy and privacy controls allow it. A message viewed thousands of times may reveal a product problem that copy alone should not normalize.
If users repeatedly exceed a hidden limit, expose the limit before submission. If a required format is hard to produce, reconsider the input design. If a dependency fails frequently, fix reliability rather than testing warmer apologies. Use production evidence to improve the journey, and collect only the data needed for that purpose.
A Message Is Ready Only When Recovery Is Real
Reliable error copy begins with reliable state knowledge. The system identifies the condition. Product and engineering define what happened. Accessibility and security shape how it is communicated. AI can then help draft concise variants, while a human owner verifies the sentence against the implemented experience.
The goal is not to make failure sound human. It is to help a real person understand what happened, find the right place, and take an action that genuinely works without exposing information that should remain protected.
Refine Approved Error Copy, Then Retest
Once the state owner approves the trigger, constraint, saved-state behavior, recovery action, and disclosure boundary, the AI humanizer can help refine voice and rhythm. Lock state IDs, interface labels, formats, limits, promises, links, and security notes; review the diff and trigger every affected state again. The tool can improve expression, but it cannot determine product state or certify accessibility, security, or recovery.
Refine Approved Error Copy, Then Retest ->