HaloGuard
A local-first hallucination firewall for LLM applications. HaloGuard sits between an LLM and the application consuming its output, scoring every response for hallucination risk before it reaches a user. Everything runs on the caller's machine -- no prompt, response, or context ever leaves the device.
Scoring modes
- Entailment mode (RAG-style): scores whether the response is supported by supplied
source context, using an NLI cross-encoder (
DeBERTa-v3-small). - Consistency mode (no context): scores whether the response is internally consistent, using the same NLI model over the response's own claims.
Verdicts
Every check returns a FirewallResult with:
score-- 0.0-1.0 hallucination risk (higher = more likely hallucinated)verdict--PASS/FLAG/BLOCK/UNKNOWNreason-- human-readable explanationmode_used-- which scorer ranlatency_ms-- how long the check took
UNKNOWN is the fail-open verdict returned when scoring itself fails and
strict_mode=False (the default). Set strict_mode=True to fail closed instead.
Honest limitations
HaloGuard is defense-in-depth, not a guarantee. An adversarially crafted response can read as entailed/consistent to any NLI model while still being false. The measured false-negative rate on the golden benchmark is the real accuracy statement; treat HaloGuard as one layer in a safety stack, not the only one.
Development status
v0.1.0 -- early. See CHANGELOG.md.
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file haloguard-0.1.0-py3-none-any.whl.
File metadata
- Download URL: haloguard-0.1.0-py3-none-any.whl
- Upload date:
- Size: 20.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e10fcde949205b0227780ae10d3c545ca713010849dd350f40084af18c21a6d
|
|
| MD5 |
d91c9bb63fd5edf89145d1b592690e22
|
|
| BLAKE2b-256 |
8d0aedfb12276b1901228a7ee84a00e3d0d5ebe5e0a9b209c9b8fb0f0bca7637
|