Insert user name, product name, and request text into a prompt.
Prevent values from becoming instructions or executable HTML.
Choose two appropriate practices.
Escape and delimit variables as data, validate them, and sanitize generated output before display or execution.
Detailed explanation
XSS and sensitive-display risks remain.
Both injection and display attacks are addressed.
They can change the prompt structure.
Values are less able to alter prompt structure.
Check official documentation
Compare the following points with the official documentation.
AWS公式AIF-C01 Domain 2.3・5.1のプロンプトインジェクションと出力保護を確認する。
Official references
What to confirm
テンプレート変数を信頼された指示から分離する実装を説明できる。
Key points
- Variables
- Escaping
- Sanitization
Notes
- Environment: AWS公式AIF-C01試験ガイドとAWS公式ドキュメントの確認
- Compare the definition with the AIF-C01 objective and the service documentation before applying it.
- Keep the concept separate from a particular answer choice or implementation step.
Foundation review
Template variable
An external value inserted into a predefined prompt or message template.
Escaping
Encoding special characters so inserted data cannot change the surrounding syntax or role.