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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Build script for jailguard.
//!
//! Currently a no-op. The C ABI header at `include/jailguard.h` is
//! committed to git and regenerated explicitly via `make regen-c-header`
//! (which invokes the standalone `cbindgen` binary). This avoids the
//! quirks of running cbindgen from build.rs (where macro expansion is
//! incomplete and several symbols come through as opaque).

fn main() {
    println!("cargo:rerun-if-changed=src/c_api.rs");
    println!("cargo:rerun-if-changed=cbindgen.toml");

    // napi-rs build helper — only runs when the `napi` feature is on.
    #[cfg(feature = "napi")]
    napi_build::setup();
}