Create prompts that can be tested and rolled back
Separate instructions from data, compare prompt techniques and preserve a reproducible version.
The extraction contract
The billing team needs invoice number and currency in a predictable structure. One batch contains footers asking the reader to perform an unrelated task. How should the application handle the batch?
Anatomy of a prompt
State the task, permitted evidence, audience and output contract. Mark supplied records as data. A negative instruction can describe something to omit, but a positive example of the desired output usually makes a format easier to test.
Examples and templates
Zero-shot uses an instruction without demonstrations. One-shot and few-shot add one or several examples. A template reuses a prompt structure with named input variables. For multistep tasks, decompose the work and ask for verifiable intermediate outputs or a concise justification.
Improving prompts experimentally
Try a clear instruction before adding examples. Change one variable, compare on a held-out set and count schema failures or unsupported statements. Broad requests such as “make it good” give reviewers no acceptance criterion.
Risks of untrusted instructions
Treat external text, tool results and retrieved documents as untrusted inputs. Separate them from system instructions. Limit downstream permissions and validate generated arguments. Audit a rejected request without exposing confidential prompts or a user’s private content.
Versioned releases
Use Bedrock Prompt Management to maintain drafts, variants, variables and versions. Pin a reviewed prompt version in production, record the model and parameters, compare candidate versions on the same fixtures, and keep a rollback reference.
Work through the decision
Compare your reasoning
Provide a bounded template, label the invoice as source data and require the expected fields. Validate the output against the schema and reconcile values to the document. An unrelated footer cannot authorize action. Human-review records with missing evidence.
Change one constraint
A new few-shot prompt improves format accuracy on the development invoices. What evidence should precede rollout?
Check your answer
Compare old and candidate versions on held-out layouts and languages. Record failures, latency and cost. Pin the evaluated version and specify the previous version for rollback.
Revisit the recording
The PartyRock example uses prompts to build an interactive adventure around Japanese words. Reuse the idea of a small repeatable input when comparing prompt variants. PartyRock · 7:52:18.
Pin the prompt used by a flow
In the flow demonstration, a revised prompt requests XML. The flow still has to select the revised version before its output changes. If a downstream parser starts failing, inspect the version actually deployed and replay a known input against the old and new versions before changing the parser. Watch at 5:50:50.
Sources and further practice
AWS exam objectives · AWS documentation for this case.
Project instructions, rules, and skills · Claude Certified Architect – Foundations · Return to the study map.
Create prompts that can be tested and rolled back quiz
Answer 5 questions. Check each answer for an explanation.