A model generates JSON for a review workflow.
Invalid values must not be executed.
Choose two practices.
Validate schema, types, enums, lengths, and ranges, and route failures to retry, hold, or human review instead of execution.
Detailed explanation
Malformed and invalid values are rejected.
Uncertain output is handled safely.
Generated text becomes executable code.
Syntax and meaning differ.
Check official documentation
Compare the following points with the official documentation.
Review Task 5.1 and output-validation guidance. For a hypothetical review result that fails validation, outline retry-count and time limits, a holding path, human escalation, and the conditions that prevent downstream processing.
Official references
What to confirm
Explain bounded regeneration and holding or review paths without automatically executing invalid output.
Key points
- JSON schema
- Range
- Hold
Notes
- Environment: Reference review of official documentation and hypothetical examples; no AWS API calls, business data access, or downstream execution are required.
- Truncated JSON, an unsupported schema request, and a business-rule violation have different causes. Distinguish the cause and retry eligibility instead of repeating the same request indefinitely.
- Regeneration concerns an unaccepted candidate output. If downstream work has already partially run, separately prevent duplicate execution of that work.
Foundation review
Failure routing
Keep a result that fails validation out of the business workflow and send it to a defined regeneration, holding, or human-review path.
Bounded retries
Limit retry counts or time and escalate unresolved cases. A validation failure does not imply that regeneration will necessarily fix it.