Skip to main content

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 / UNKNOWN
  • reason -- human-readable explanation
  • mode_used -- which scorer ran
  • latency_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

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

haloguard-0.1.0-py3-none-any.whl (20.2 kB view details)

Uploaded Python 3

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

Hashes for haloguard-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4e10fcde949205b0227780ae10d3c545ca713010849dd350f40084af18c21a6d
MD5 d91c9bb63fd5edf89145d1b592690e22
BLAKE2b-256 8d0aedfb12276b1901228a7ee84a00e3d0d5ebe5e0a9b209c9b8fb0f0bca7637

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

This release

0.1.0 This release

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page