jailguard 0.1.2

Pure-Rust prompt-injection detector with 1.5MB embedded MLP classifier. 98.40% accuracy, p50 14ms CPU inference, 8-class attack taxonomy. Apache-2.0/MIT alternative to Rebuff and Lakera Guard.
Documentation
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.

[package]
edition = "2021"
rust-version = "1.85"
name = "jailguard"
version = "0.1.2"
authors = ["Yury Fedoseev"]
build = "build.rs"
include = [
    "src/lib.rs",
    "src/embedded.rs",
    "src/error.rs",
    "src/model_manager.rs",
    "src/network.rs",
    "src/python.rs",
    "src/c_api.rs",
    "models/neural_binary_200k.json",
    "models/tokenizer.json",
    "Cargo.toml",
    "build.rs",
    "cbindgen.toml",
    "LICENSE-MIT",
    "LICENSE-APACHE",
    "README.md",
    "CHANGELOG.md",
    "examples/quick_start.rs",
    "python/",
]
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "Pure-Rust prompt-injection detector with 1.5MB embedded MLP classifier. 98.40% accuracy, p50 14ms CPU inference, 8-class attack taxonomy. Apache-2.0/MIT alternative to Rebuff and Lakera Guard."
documentation = "https://docs.rs/jailguard"
readme = "README.md"
keywords = [
    "prompt-injection",
    "llm-security",
    "guardrails",
    "jailbreak-detection",
    "onnx",
]
categories = [
    "text-processing",
    "science",
]
license = "MIT OR Apache-2.0"
repository = "https://github.com/yfedoseev/jailguard"

[package.metadata.cargo-shear]
ignored = ["ort-sys"]

[features]
c-api = []
cpu = []
default = []
download = [
    "full",
    "dep:reqwest",
    "dep:tokio",
    "dep:csv",
]
full = [
    "dep:burn",
    "dep:burn-ndarray",
    "dep:parking_lot",
    "dep:tracing",
    "dep:unicode-segmentation",
    "dep:rand",
    "dep:uuid",
    "dep:dirs",
    "dep:lru",
    "dep:regex",
]
napi = [
    "dep:napi",
    "dep:napi-derive",
    "dep:napi-build",
]
pretrained = ["full"]
python = ["pyo3"]
semantic-embeddings = []
training = [
    "full",
    "dep:rand",
]

[lib]
name = "jailguard"
crate-type = [
    "cdylib",
    "rlib",
    "staticlib",
]
path = "src/lib.rs"

[[example]]
name = "quick_start"
path = "examples/quick_start.rs"

[dependencies.burn]
version = "0.20"
optional = true
default-features = false

[dependencies.burn-ndarray]
version = "0.20"
optional = true
default-features = false

[dependencies.csv]
version = "1.3"
optional = true

[dependencies.dirs]
version = "6.0"
optional = true

[dependencies.lru]
version = "0.18"
optional = true

[dependencies.napi]
version = "2"
features = ["napi8"]
optional = true
default-features = false

[dependencies.napi-derive]
version = "2"
optional = true

[dependencies.ndarray]
version = "0.16"

[dependencies.once_cell]
version = "1"

[dependencies.ort]
version = "=2.0.0-rc.9"

[dependencies.ort-sys]
version = "=2.0.0-rc.9"

[dependencies.parking_lot]
version = "0.12"
optional = true

[dependencies.pyo3]
version = "0.24"
features = [
    "abi3-py38",
    "extension-module",
]
optional = true

[dependencies.rand]
version = "0.9"
optional = true

[dependencies.regex]
version = "1"
optional = true

[dependencies.reqwest]
version = "0.13"
features = [
    "json",
    "stream",
]
optional = true

[dependencies.serde]
version = "1"
features = ["derive"]

[dependencies.serde_json]
version = "1"

[dependencies.sha2]
version = "0.11"

[dependencies.thiserror]
version = "2"

[dependencies.tokenizers]
version = "0.23"
features = [
    "onig",
    "progressbar",
]
default-features = false

[dependencies.tokio]
version = "1"
features = ["full"]
optional = true

[dependencies.tracing]
version = "0.1"
optional = true

[dependencies.unicode-segmentation]
version = "1.13"
optional = true

[dependencies.ureq]
version = "3"

[dependencies.uuid]
version = "1"
features = [
    "v4",
    "serde",
]
optional = true

[dev-dependencies.criterion]
version = "0.8"

[dev-dependencies.tokio]
version = "1"
features = [
    "rt-multi-thread",
    "macros",
]

[build-dependencies.napi-build]
version = "2"
optional = true

[lints.clippy]
cargo_common_metadata = "warn"
cloned_instead_of_copied = "warn"
dbg_macro = "deny"
doc_markdown = "warn"
explicit_iter_loop = "warn"
flat_map_option = "warn"
fn_params_excessive_bools = "warn"
inefficient_to_string = "warn"
manual_let_else = "warn"
map_unwrap_or = "warn"
needless_pass_by_value = "warn"
redundant_closure_for_method_calls = "warn"
semicolon_if_nothing_returned = "warn"
todo = "deny"
unimplemented = "deny"
unnecessary_wraps = "warn"
unused_async = "warn"

[lints.rust]
unsafe_code = "warn"