Detectors Overview

kiteguard ships six built-in detectors. Each detector is a pure Rust function that takes a string input and returns a Verdict.

Detector inventory

DetectorTriggered byConfigurable?
commandsBash tool commandsYes — bash.block_patterns
pathsRead/Write/Edit file pathsYes — file_paths.block_read/write
piiPrompts, file content, responsesPartially — types list + enable flags
secretsFile content, responsesNo — hardcoded patterns
injectionAll text inputsNo — hardcoded patterns (toggle only)
urlsWebFetch/WebSearch URLsYes — urls.block_domains

Execution model

Each detector receives the full input string and returns either Verdict::Allow or Verdict::Block { rule, reason }. The evaluator layer is responsible for routing tool inputs to the right detector(s).

Multiple detectors can run on a single input. The first Block verdict wins and short-circuits evaluation.

Performance

All detectors use compiled Regex objects cached at startup. Pattern compilation happens once per binary invocation. Typical evaluation time per input: < 1 ms.

No detector makes network calls (webhook dispatch happens after evaluation in main.rs).

Source locations

DetectorSource file
commandssrc/detectors/commands.rs
pathssrc/detectors/paths.rs
piisrc/detectors/pii.rs
secretssrc/detectors/secrets.rs
injectionsrc/detectors/injection.rs
urlssrc/detectors/urls.rs