Crate kindlyguard

Crate kindlyguard 

Source
Expand description

§KindlyGuard

Security-focused MCP (Model Context Protocol) server for AI protection.

This crate provides a unified interface to the KindlyGuard server functionality. The CLI tools are available as a separate binary crate that should be installed with cargo install kindly-guard-cli.

§Features

  • Unicode Security: Advanced detection and prevention of Unicode-based attacks
  • Injection Protection: Guards against various injection attempts (SQL, command, etc.)
  • Real-time Monitoring: Continuous threat detection and alerting
  • MCP Protocol Integration: Seamless integration with the Model Context Protocol
  • CLI Tools: Command-line utilities for scanning and monitoring

§Usage

§As a Library

use kindlyguard::server::{SecurityScanner, Threat};
use kindlyguard::server::config::ScannerConfig;

// Create a scanner with default configuration
let config = ScannerConfig::default();
let scanner = SecurityScanner::new(config)?;

// Scan some text for threats
let threats = scanner.scan_text("Hello, world!")?;
println!("Found {} threats", threats.len());

§Running the MCP Server

The server can be run using the kindly-guard binary:

kindly-guard --config /path/to/config.toml

§Using the CLI

The CLI tools can be accessed through the kindly-guard-cli binary:

kindly-guard-cli scan --path /path/to/scan
kindly-guard-cli monitor --config /path/to/config.toml

§Modules

  • server: Core server functionality including scanners, detectors, and MCP protocol

§Re-exports

This crate re-exports the main functionality from:

For CLI tools, install the kindly-guard-cli crate:

cargo install kindly-guard-cli

For more detailed documentation, please visit: https://github.com/samduchaine/kindly-guard

Re-exports§

pub use kindly_guard_server as server;

Modules§

prelude
Prelude module for convenient imports

Structs§

Config
Main configuration structure for KindlyGuard
ScannerConfig
Scanner configuration for threat detection settings
SecurityContext
Security context for command execution
SecurityScanner
Main security scanner combining all threat detection
Threat
Represents a detected security threat

Enums§

KindlyError
KindlyGuard error types with actionable recovery strategies
Severity
Threat severity levels
ThreatType
Types of security threats that can be detected

Type Aliases§

KindlyResult
Type alias for Result with KindlyError