Module 14 · Responsible systems

Module 14: Bounded agents and AI workflows

Read the overview and learning outcomes here, then follow the learning route. Return to this page’s run instructions for the complete study.

Connect a real local LLM router to narrowly allowed read-only tools, with exact evidence and enforceable limits.

This module works independently: no earlier notebook state, Canvas assignment, paid AI account, or GPU is required. Allow approximately 2–3 hours plus first installation/downloads. Small CPU runs demonstrate mechanisms, not production readiness.

Learning outcomes

Learning route

Follow foundation → concepts and small cases → guided construction → independent practice. Use solutions after your attempt, then connect your work to the complete reference below.

Entry support and topics

Use the foundation bridge if these concepts are new. Basic Python/functions/files and the train/validation/test distinction are assumed with support from Module 2 and Module 5.

A valid tool call is not necessarily the right action for the user's intent. This core deliberately constrains routing to three enumerated plans and one read-only call. Mean completion log-probability ranks plans; it is not calibrated confidence. Hard policy checks live outside the model.

Real data and its limits

UCI Wine Quality; real red-wine chemistry and human ratings. See the central source register for citation, rights, archive hash, and limitations.

Sources, licenses, hashes, and model provenance distinguish external records from original teaching code. No generated dataset or invented labels are used in this module. Public files still require responsible handling. Source versions are fixed after verified acquisition; changed cached/upstream bytes cause an error. The first data/model download requires internet; retain the cache for offline replay.

The complete workflow

The authored request file separates six demonstrations, six validation controls and 26 labelled test requests. A real local LLM scores count/alcohol/refuse labels; these map to summary/feature/refuse plans. Class-score offsets are chosen using validation controls only. The executor supplies an exact allowlisted argument schema. A bounded plan → observe → answer workflow uses at most three steps and one read-only call. The answer displays returned source values. Measure routing accuracy, missed refusals and the confusion table separately from the permission boundary: no destructive, shell, upload or credential tool exists.

The request controls are authored examples, not a representative sample of real users. A model can choose an irrelevant read tool for an unsafe request; that counts as a routing error even though no unsafe operation can execute.

Run and inspect

Download the complete source or use a checkout. Work from its ml_ai_it folder. Use the isolated CPU framework environment. Run framework commands in the Linux CPU reference environment; see the support matrix for platform coverage. Reading the reports needs no framework installation. In commands below, python means your environment executable; use its full path if not activated. If a download link does not open, use the offline access route.

python examples/bounded-assistant/scripts/run.py --output runs/module14

Use a fresh output directory for a new run; completed studies are not silently overwritten. Open runs/module14/index.html or read summary.txt/summary.json and the companion CSV tables. Read the verified worked report without installing an execution interface.

Key artifacts:

The shared implementation is under src/practical_ml_ai; scripts and commented notebook call the same functions. Keep the notebook inside the complete source tree. Named results and captioned/scoped tables support interpretation without a chart or screenshot. For interface choices and test coverage, see the accessibility guide.

Read selectively

Practice and continue

Complete original practice, then compare worked feedback. Instructor notes map evidence and explain adaptation.

This completes the 14-module sequence. Revisit the evaluation, deployment, and governance evidence together before proposing a real system.

Build understanding step by step

Use the guided construction and mastery check before the full study. New programmers should start with Python Foundation and readiness; use the glossary for notation.