# SEC-018 — Input-Validation an Tool-Boundaries (Pydantic strict / Zod)
# Status: PASS
# Reasoning: Alle 10 Tool-Input-Models nutzen `ConfigDict(strict=True, str_strip_whitespace=True, extra="forbid")` — strict-Mode + extra-forbid explizit gesetzt. String-Felder (channel_id, show_id, votation_id, geolocation_id) haben whitelist-pattern `^[A-Za-z0-9_-]+$` und min/max_length. Numerische Felder (page, page_size, year_from/to) haben ge/le-Constraints. canton hat `^[A-Za-z]{2,4}$`, query (weather) `^[\w\s.\-']+$`. CHANGELOG dokumentiert "23 neue Unit-Tests in tests/test_unit.py decken Strict-Mode-Enforcement, Extra-Field-Rejection und alle Pattern-Constraints ab."

## Modus: code_review (Schema-Coverage)
$ grep -c "ConfigDict(strict=True" src/srgssr_mcp/tools/*.py
aggregation.py:1, audio.py:1, epg.py:1, polis.py:2, video.py:3, weather.py:2
=> Total 10 Input-Models — alle mit strict=True.

## Modus: code_review (Strict + extra=forbid)
$ grep -E "ConfigDict\(strict" src/srgssr_mcp/tools/ -r
Alle 10 Models: ConfigDict(strict=True, str_strip_whitespace=True, extra="forbid")
=> PASS: strict-Mode + extra=forbid + str_strip_whitespace.

## Modus: code_review (Field-Constraints)
$ grep -B2 -A3 "Field(" src/srgssr_mcp/tools/ | grep -E "min_length|max_length|pattern|ge=|le="
- Strings: min_length=1, max_length=100/200, pattern="^[A-Za-z0-9_-]+$" für IDs
- canton: pattern="^[A-Za-z]{2,4}$"
- weather query: pattern="^[\w\s.\-']+$"
- Ints: page (ge=1), page_size (ge=1, le=50), year_from/to (ge=1900, le=2100)
=> PASS: Whitelist-basierte Patterns, ge/le-Bounds vorhanden.

## Modus: code_review (Whitelist statt Blacklist)
Patterns sind Whitelist-basiert (`^[A-Za-z0-9_-]+$` etc.) — Pass-Pattern erfüllt.
Keine Blacklist-Pattern (`^(?!.*evil)`) gefunden.

## Modus: runtime_test
N/A: nicht ausgeführt. Statisch validiert: Pydantic v2 mit strict=True würde z.B. `{"limit": 99999}` rejecten (le=50), `{"query": "test "}` ablehnen (Pattern-Mismatch), `{"evil": "field"}` rejecten (extra=forbid).

## Modus: documentation_check (CHANGELOG-Coverage)
CHANGELOG.md, [Unreleased]/Security:
"Input Validation Hardening (SEC-018): Alle 10 Pydantic-Tool-Input-Models laufen jetzt im Pydantic-strict-Mode (keine implizite Type-Coercion "5" → 5); extra="forbid" war bereits vorhanden. Zusätzlich Pattern-Constraints für alle freien String-Felder ergänzt..."
=> PASS: SEC-018-Hardening explizit als CHANGELOG-Eintrag.

## NOTE
ValidationError wird vom FastMCP-Framework als Protocol-Error (JSON-RPC -32602) gehandhabt, nicht als Execution-Error mit isError:true. Das ist FastMCP-Default und für reine Schema-Validation akzeptabel (siehe OBS-001).
