Implement a small tool registry with calculate and search_notes
Jump & context
Week 1: Application Foundations, Model Trust, Tools & Authorization Boundaries
The five hours
- 01
Concepts & system design
60 min· read · map the mechanismR01 — FastAPI dependencies & validation
R07 — JSON Schema allowlists & enums
Read the assigned sections; map the mechanism, threat model and trade-offs.
- 02
Project implementation
120 min· build · integrate · debugBuild a tool registry with
calculate,search_notes, andget_weather. Define strict Pydantic tool argument schemas and explicit tool allowlists.Build, integrate, debug and improve the increment in the active project.
- 03
Security lab
60 min· attack your own systemSeparate tool discovery from tool permission; verify that requesting an unknown or unauthorized tool is blocked by server code even if the model outputs the tool call.
Test the abuse case, failure path, authorization bypass or resource limit.
- 04
Verification & evidence
30 min· test · record evidenceTool permission matrix and automated unauthorized-tool rejection tests.
Add or run regression tests; record the 9-point evidence record.
- 05
Deliberate practice & Socratic review
30 min· explain aloud · update gapsAnswer the 8 Socratic questions without notes: What? Why? How? What if? Why not? How can I prove it? Where can it break? What have I learned?
Re-explain the hardest concept aloud, inspect one edge case, update the gap log.
- total5 h
Read today · inside the concepts block
R01 R07FastAPI tutorial, request bodies, dependencies, async, and Pydantic model validation.
Core schema types, required properties, additionalProperties: false, enums, and numeric/string bounds.
Read only the named sections needed for today's task. Reading sits inside the 60-minute concepts block; it is not extra time.
Free resources for this day
5 curated- docsJSON SchemaCreating your first schema
Required properties, type constraints, enums, and additionalProperties:false are exactly the strictness settings that stop a model from smuggling extra tool arguments into a call.
R07S7checked 2026-11-11 - videoDave Ebbelaar · 28:24OpenAI Function Calling - Full Beginner Tutorial
Builds the full loop of schema declaration, model tool_choice, argument parsing, and result return, which is the registry shape your calculate/search_notes/get_weather tools follow.
R01S7checked 2026-11-11 - videoVectorLab · 6:03Structured Outputs - How to Specify a JSON schema for your LLM Outputs
Shows schema-constrained generation end to end, including what happens when the model's output violates an enum or required field, which is the fail-closed behaviour to reproduce.
R07S7checked 2026-11-11 - articleAnthropicWriting effective tools for AI agents
Argues tool definitions are a contract: namespaced names, unambiguous descriptions, and tight input schemas reduce wrong-tool and wrong-argument calls, which is the point of an allowlist plus strict schemas.
S3S7checked 2026-11-11 - repoOpenAI CookbookHow to call functions with chat models
Runnable notebook with tool schemas, tool_call handling, and a dispatch table you can adapt into an explicit allowlist that rejects unregistered tool names.
S3S7moved 2026-11-11
Evidence record · 9-point standard
A lab is complete only when it produces evidence. Installing PyRIT, Garak, Presidio or TransformerLens is not completion. Saved on this device only.
Day notes
emptyThe two source formulations
verbatim · nothing summarisedProject & Stage Target
P1 (C1 foundation) | S3, S7
Core Implementation
Build a tool registry with calculate, search_notes, and get_weather. Define strict Pydantic tool argument schemas and explicit tool allowlists.
Security Lab
Separate tool discovery from tool permission; verify that requesting an unknown or unauthorized tool is blocked by server code even if the model outputs the tool call.
Verification & Evidence
Tool permission matrix and automated unauthorized-tool rejection tests.
Read Today (60m Concepts Block)
R01 (FastAPI dependencies & validation), R07 (JSON Schema allowlists & enums).
> Day 6 Post-Session: Take 1 full Rest Day before starting Week 2. Complete the Weekly Review in Part 7.
---