Skip to content
Ameen Abozaid
Planned lessonMID-069-L03

Designing safe tools

  • Lesson 3 of 8
  • Mid-level
On This Lesson 4 topics

This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.

In this lesson

design tools that are hard to misuse.

Planned topics

  • 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.
Draft outline details

Demonstration

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

Check your understanding

Why is run_sql a bad tool?

Show answer

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

Practice

Apply this lesson with the module's lab, exercises and quiz.

Lab and exercises Quiz

Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.

Continue to next lesson

Type to search levels, phases, modules and lessons.