A model must return customer categories as JSON.
Do not pass invalid types or extra instructions to a downstream system.
Choose two appropriate practices.
Validate the schema, allowed values, lengths, and required fields, then regenerate, defer, or route failures to human review.
Detailed explanation
Injection and display attacks remain possible.
Types, fields, and values are not guaranteed.
Invalid output is not executed directly.
The downstream system receives an interpretable structure.
Check official documentation
Compare the following points with the official documentation.
Review output validation in Task 5.1 and the Bedrock structured-output guide. For hypothetical customer-category JSON, identify where to check missing required fields, disallowed categories, and excessive string lengths, and define a holding path for failures.
Official references
What to confirm
Distinguish JSON parsing, supported schema constraints, and application checks for lengths and business conditions.
Key points
- Schema
- Enum values
- Failure routing
Notes
- Environment: Reference review of official documentation and hypothetical examples; no AWS API calls, business data access, or downstream execution are required.
- Bedrock structured outputs enforces supported constraints; its documentation lists minimum/maximum and minLength/maxLength as unsupported. Enforce required length and numeric limits in the application.
- An allowed category may still be factually wrong for a customer. Data validation also does not replace authorization, parameterized SQL, or context-aware HTML encoding.
Foundation review
Structure and value checks
Parsable JSON may still omit a required field or contain a disallowed category. Check it against the downstream contract.
Supported schema constraints
Check which constraints the generation API supports. An application validator may support JSON Schema features that the generation API does not.