Add tool timeouts
Jump & context
Week 2: Prompt Injection, Crescendo Fuzzing, Streaming, Persistence & Cost Controls
The five hours
- 01
Concepts & system design
60 min· read · map the mechanismR01 — Async timeouts & exception handling
R10 — OWASP Error Handling & Logging Cheat Sheets
Read the assigned sections; map the mechanism, threat model and trade-offs.
- 02
Project implementation
120 min· build · integrate · debugAdd per-tool timeouts, bounded exponential-backoff retries, and safe error contracts to
P1.Build, integrate, debug and improve the increment in the active project.
- 03
Security lab
60 min· attack your own systemRun
D1injection cases combined with simulated tool timeouts and malformed tool outputs.Test the abuse case, failure path, authorization bypass or resource limit.
- 04
Verification & evidence
30 min· test · record evidenceCombined tool-security regression suite and residual-risk notes.
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 R10FastAPI tutorial, request bodies, dependencies, async, and Pydantic model validation.
Authorization, SQL Injection Prevention, File Upload, SSRF, Secrets Management, and Logging Cheat Sheets.
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- docsOWASP Cheat Sheet SeriesLogging
Specifies what belongs in a log event and what must never appear (credentials, tokens, sensitive payloads), which is the constraint your safe error contract has to satisfy while staying debuggable.
R10checked 2026-11-11 - videoArjanCodes · 24:02Retry Pattern: The Secret to Resilient Python Code
Covers the retry decorator, backoff, and which exceptions are safe to retry, including the idempotency question that decides whether a failed tool call may be repeated at all.
S7checked 2026-11-11 - videoYash Jain · 16:14Retry LLM API Calls Automatically with Python Tenacity
Applies bounded retries with exponential backoff to LLM provider calls, showing how to cap attempts so a slow model cannot turn into unbounded spend.
R03M5checked 2026-11-11 - articleAWS Architecture BlogExponential Backoff and Jitter
Gives the full-jitter formula and the measured reason plain exponential backoff still synchronizes clients into retry storms, which is the difference between bounded and unbounded retries.
M5S7checked 2026-11-11 - repoGitHubjd/tenacity
Retrying library with stop, wait, and retry conditions you can compose into per-tool attempt and deadline budgets rather than one global retry policy.
S7checked 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 & Deliverable Target
P1 | `D1` (Crescendo Attack Fuzzer) | S2, M5
Core Implementation
Add per-tool timeouts, bounded exponential-backoff retries, and safe error contracts to P1.
Security Lab
Run D1 injection cases combined with simulated tool timeouts and malformed tool outputs.
Verification & Evidence
Combined tool-security regression suite and residual-risk notes.
Read Today (60m Concepts Block)
R01 (Async timeouts & exception handling), R10 (OWASP Error Handling & Logging Cheat Sheets).
---