Crate llm_shield_core

Crate llm_shield_core 

Source
Expand description

§LLM Shield Core

Core types, traits, and utilities for the LLM Shield security toolkit.

§SPARC Methodology - Specification Phase

This module defines the core abstractions for the LLM Shield system:

  • Scanner: Core trait for all security scanners
  • ScanResult: Standardized result type
  • Risk: Risk assessment types
  • Error: Comprehensive error handling

§Enterprise-Grade Design Principles

  1. Type Safety: Strong typing throughout
  2. Async-First: All scanners support async operations
  3. Composability: Scanners can be chained and combined
  4. Observability: Comprehensive tracing and metrics
  5. Error Context: Rich error types with context

Re-exports§

pub use error::Error;
pub use error::Result;
pub use result::Entity;
pub use result::RiskFactor;
pub use result::ScanResult;
pub use result::Severity;
pub use scanner::InputScanner;
pub use scanner::OutputScanner;
pub use scanner::Scanner;
pub use scanner::ScannerType;
pub use types::ScannerConfig;
pub use types::ScannerMetadata;
pub use vault::Vault;

Modules§

error
Error types for LLM Shield
result
Scan result types
scanner
Scanner trait and types
types
Common types for configuration and metadata
vault
Vault for cross-scanner state management

Constants§

VERSION
Version information

Functions§

init
Library initialization

Attribute Macros§

async_trait