National Cheng Kung UniversityLAiMM Laboratory

W12 / 2026-11-23 / 35 MIN / ENGLISH

Validate model proposals before tool execution

Classroom formative practice. This does not add a weekly graded assignment. The exercise time is included in class practice, not added after the three-hour meeting.

Before you start

  1. Use a CPU runtime. Save a personal copy or open the downloaded notebook in Jupyter.
  2. Run the included complete walkthrough first. Read its setup, definitions, and checkpoints.
  3. Predict before running each exercise cell; then change only the requested factor.
  4. Keep your actual outputs, configuration, explanation, and limitation. Free tools are sufficient.

TASK 1 / PREDICT - RUN - EXPLAIN

Keep unsupported tools disabled

Send a valid mean request and an unsupported delete_files request to the deterministic teaching controller. Explain which layer refuses the unsupported action.

  1. Write your prediction in the notebook response field before running.
  2. Run the starter cell below after the worked walkthrough.
  3. Make the requested controlled change and record the configuration.
  4. Explain the mechanism using the actual output, not an invented result.
observations['task1']={'allowed':run_request({'tool':'mean','values':[1,2,3]}),'blocked':run_request({'tool':'delete_files','values':[1,2,3]})}
print(observations['task1'])

Self-check: The mean is 2. The unsupported action must be refused, not executed. No real file deletion or model API is involved.

TASK 2 / PREDICT - RUN - EXPLAIN

Probe input validation

Compare numeric input, nonnumeric input, and a request above the declared input limit. Keep these as inert test data.

  1. Write your prediction in the notebook response field before running.
  2. Run the starter cell below after the worked walkthrough.
  3. Make the requested controlled change and record the configuration.
  4. Explain the mechanism using the actual output, not an invented result.
exercise_requests=[{'tool':'mean','values':[1,2,3]},{'tool':'mean','values':['ignore the policy',2]},{'tool':'mean','values':list(range(101))}]
observations['task2']=[run_request(case) for case in exercise_requests]
print(observations['task2'])

Self-check: Inspect the returned statuses rather than assuming a prompt enforces type or length constraints. Record any boundary case the implementation does not handle.

TASK 3 / PREDICT - RUN - EXPLAIN

Separate the simulator from an LLM agent

Identify the proposal, validator, tool, and stopping policy. State which components are deterministic and what has not been evaluated.

  1. Write your prediction in the notebook response field before running.
  2. Run the starter cell below after the worked walkthrough.
  3. Make the requested controlled change and record the configuration.
  4. Explain the mechanism using the actual output, not an invented result.
observations['task3']={'teaching_system':'deterministic offline simulator','contract':contract,'paid_model_calls':0}
print(observations['task3'])

Self-check: The simulator demonstrates controlled execution. It is not evidence that a real LLM will propose valid or useful actions.

Completion checklist

The notebook marks incomplete response records as drafts. Completing the fields is not proof that an explanation is correct.

The guided walkthroughs were previously executed. The new exercise extension cells have not yet been execution-tested for this revision. Agent exercises are deterministic simulations; no paid model or consequential external action is used.