โ† Back to Dashboard
1. Prompt Contracts and Output Schemas2. Template Variables and Reuse

Prompt Contracts and Output Schemas

๐Ÿ“š Prompt Engineering on Bedrockโฑ 10 minโญ 70 XP

Production Prompt Contracts

Treat prompts as versioned contracts. Define task, boundaries, allowed tools, output format, and refusal behavior.

Role: Incident Analyst
Task: Classify ticket priority
Output: JSON {"priority":"P1|P2|P3","reason":"..."}
Safety: If unsure, return {"priority":"P3","reason":"insufficient evidence"}

Contracts reduce ambiguity and make regression testing possible.

๐Ÿงช Knowledge Check
Press 1-4 to select1 of 2
Why use explicit output schemas in prompts?
To increase hallucinations
To simplify downstream parsing and validation
To avoid retries forever
To replace IAM
Prompt Contracts and Output Schemas Tutorial | Prompt Engineering on Bedrock โ€” AWS Bedrock Academy