انتقل إلى المحتوى
أمين أبوزيد
درس مخطط لهJNR-057-L03

مخرجات النموذج مدخلات غير موثوقة

  • الدرس 3 من 6
  • Junior
في هذا الدرس 4 موضوعات

هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.

نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.

في هذا الدرس

handle model output safely.

الموضوعات المخطط لها

  • Treat output like user input: validate, encode, never execute.
  • Ask for structured output (JSON) and validate it against a schema; reject what does not fit.
  • Encode before putting it into HTML; never inject it into SQL, shell commands, or file paths.
  • Do not let output decide privileged actions directly; check permissions in code.
  • Excessive agency: give the model few tools, with narrow rights, and require confirmation for risky ones.
تفاصيل المخطط المبدئي

عرض عملي

ProductSummary record with allowed fields; JSON that has extra or oversized fields is rejected.

اختبر فهمك

Should you run a SQL string produced by the model?

أظهر الإجابة

No. It is untrusted.

التطبيق

طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.

المختبر والتمارين الاختبار

تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.

اكتب للبحث في المستويات والمراحل والوحدات والدروس.