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

تصميم أدوات آمنة

  • الدرس 3 من 8
  • Mid-level
في هذا الدرس 4 موضوعات

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

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

في هذا الدرس

design tools that are hard to misuse.

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

  • Narrow scope: get_order_status(orderId), not run_sql(query) or call_any_api(url).
  • Typed, constrained parameters: enums, ranges, patterns; reject everything else.
  • Idempotency: the same call twice has the same effect.
  • Clear error results ("not found", "not allowed") so the model can explain, without leaking internals.
  • Return only the fields the answer needs.
تفاصيل المخطط المبدئي

عرض عملي

java
record OrderStatusArgs(@Positive long orderId) {}
// result: {status:"SHIPPED", eta:"2026-11-02"}  or  {error:"NOT_FOUND"}

اختبر فهمك

Why is run_sql a bad tool?

أظهر الإجابة

It is unbounded; one bad argument reads or destroys anything.

التطبيق

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

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

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

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