Skip to main content

Module input_validation

Module input_validation 

Source
Expand description

Hardened input validation middleware for agent-generated CLI input.

AI agents may hallucinate or produce adversarial values. This module provides InputValidator, an opt-in validator that can be wired into the crate::cli::Cli dispatch loop as crate::middleware::Middleware, or called directly via InputValidator::validate_value and InputValidator::validate_parsed.

§Example

use argot_cmd::input_validation::InputValidator;
use argot_cmd::Middleware;
use argot_cmd::ParsedCommand;

// Enable all checks at once.
let validator = InputValidator::strict();

// Or selectively opt in.
let selective = InputValidator::new()
    .check_path_traversal()
    .check_control_chars();

Structs§

InputValidator
Opt-in validator for argument and flag values supplied to a parsed command.

Enums§

ValidationError
Errors produced by InputValidator.