Kilometers CLI includes client-side risk detection to identify potentially dangerous MCP operations and prioritize security monitoring.
The CLI analyzes MCP events in real-time using pattern matching, content analysis, and payload size evaluation to assign risk scores from 10 (low) to 100 (critical).
System files, credentials, and admin operations
/etc/passwd/etc/shadow/.ssh/id_rsa/root//etc/sudoers/proc//sys/Environment files, database queries, and sensitive operations
.envconfig.jsondatabase.json/var/log/SELECT.*FROM.*usersDELETE.*FROMDROP.*TABLEStandard MCP operations and basic tool usage
tools/callresources/readprompts/getresources/listRisk scores vary based on the MCP method and the content being accessed. The same method can have different risk levels depending on the parameters.
resources/readCan access sensitive filestools/callCan execute system operationsresources/writeCan modify filesprompts/getMay expose sensitive promptstools/listList available toolsresources/listList available resourcespingBasic connectivity checkTurn on client-side risk analysis
KM_ENABLE_RISK_DETECTION=true km your-mcp-serverOnly capture events with high risk scores (75+)
KM_HIGH_RISK_ONLY=true km your-mcp-serverSee risk scores for all events in debug output
KM_DEBUG=true KM_ENABLE_RISK_DETECTION=true km your-mcp-serverComplete security-focused configuration
KM_ENABLE_RISK_DETECTION=true \
KM_HIGH_RISK_ONLY=true \
KM_PAYLOAD_SIZE_LIMIT=5120 \
KM_DEBUG=true \
km your-mcp-serverWhen debug mode is enabled with risk detection, you'll see detailed risk analysis:
[km] Captured request: method=resources/read, risk=HIGH(85), size=245 [km] Risk analysis: Pattern match '/etc/passwd' triggered HIGH risk [km] Captured response: method=resources/read, risk=HIGH(75), size=1024 [km] Filtered request: method=ping, risk=LOW(10), size=32 [km] Successfully sent batch of 2 events to API