Originally created by: fu351
Doberman core ships one built-in subjective detector today: TokenChannelDetector (src/doberman/engine/detectors/token_channels.py), wired into BUILTIN_DETECTOR_TYPES in src/doberman/engine/detectors/__init__.py. Add a second built-in detector that flags suspiciously large base64-looking payloads inside tool-call arguments — a common exfiltration shape (smuggling file/secret contents out as an encoded blob). Mirror TokenChannelDetector's structure — a Guardrail with evaluate(action, ctx) -> GuardrailResult, running in the subjective guardrail so it can only raise risk to AUTH, never BLOCK, and never lower a verdict — and register it in BUILTIN_DETECTOR_TYPES the same way.
Needs a new ReasonCode (src/doberman/models.py, class ReasonCode) plus a one-line human explanation — every AUTH/BLOCK must carry both.
You'll need to reason explicitly about false positives: legitimately binary-ish arguments show up constantly (embedded images, patch/diff payloads, minified/base64 assets), so a naive "any long base64-looking string" rule will fire on benign traffic. Make the size threshold configurable rather than a hardcoded magic number.
Additive engine change (new detector) — raise-only by construction, but requires understanding the subjective-guardrail contract, the redaction discipline, and designing a threshold/heuristic that isn't naively noisy.
src/doberman/engine/detectors/token_channels.py — the existing detector to mirrorsrc/doberman/engine/detectors/__init__.py — BUILTIN_DETECTOR_TYPES registrationsrc/doberman/models.py — class ReasonCode for the new codetests/unit/test_detector_token_channels.py — the sibling test pattern to followsrc/doberman/engine/detectors/base64_blob.py) implementing the Guardrail interfaceBUILTIN_DETECTOR_TYPES (src/doberman/engine/detectors/__init__.py)ReasonCode added, with a one-line human explanation on every AUTH it raisesruff check . && ruff format --check . and lint-imports passpytest passespip install -e ".[dev]"
ruff check . && ruff format --check .
lint-imports
pytest tests/unit/test_detector_base64_blob.py -v
pytest --cov=doberman --cov-report=term-missing
token_channels.py)New here? Start with CONTRIBUTING.md. Issues are labelled level-1 (docs only) through level-10 (new subsystem) — pick one at your level and climb. Comment to claim an issue before starting.
Ticket changed by: fu351