prism-core (pip install prism-honesty)
A fail-closed honesty gate for LLM answers grounded in user-provided sources.
The audit checks a draft against the source material (plus the user's own statements) and flags only unsupported facts — invented credentials, metrics, dates, scope — while leaving motivation, tone, framing, and hedged language alone. Deterministic backstops keep it honest in both directions:
- fail-closed — if the auditor can't produce a usable verdict (truncated, malformed, transport error), the draft is not certified. No silent pass.
- verbatim backstop — a flagged claim whose exact phrase appears contiguously in the source is rescued (auditor false positive); a same-meaning inflation is never rescued.
- no truncation games — an over-long source is fitted by relevance to the draft, not head-cut (head-cutting was the bug where critical content slid past the cut).
Standard library only. No provider, framework, or chat-UI dependency: the model call is injected by you.
Usage
import asyncio
from prism_core.audit import fact_audit
async def my_complete(messages, model, *, max_tokens, temperature,
reasoning_effort, session, label, return_finish):
# call whatever provider you like; return (raw_text, finish_reason)
...
result = asyncio.run(fact_audit(
full_request="Write my resume summary. I mentored two interns.",
source="Mentored two interns on an internal tool.",
candidate="Senior engineer who led a team of 50 engineers.",
complete_fn=my_complete,
model="your-model-id",
max_tokens=2000,
reasoning_effort="max",
))
# -> {"unsupported": ["led a team of 50 engineers"], "verdict": "FABRICATION"}
# or {"verdict": "ERROR", ...} when no usable verdict arrives (fail closed)
Contents
| module | what it holds |
|---|---|
prism_core.audit |
fact_audit() + the audit prompt (SYSTEM_FACT_AUDIT) |
prism_core.verifier |
token normalization, verbatim backstop, relevance-fit, fail-closed sentinel, <source> delimiter |
prism_core.messages |
channel-neutral chat-message helpers (content extraction, image split, inline-source heuristic) |
License
MIT (this directory). The parent project, PrismAI,
is AGPL-3.0 — only prism_core/ is MIT.
Status
This is what I use in production, extracted so my own code has a real boundary. Published without promises: no roadmap, PRs may not get merged.
Metadata
Release files for prism-honesty 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| prism_honesty-0.1.0.tar.gz | 8.0 kB | Without provenance | Details for prism_honesty-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| prism_honesty-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for prism_honesty-0.1.0-py3-none-any.whl |
Total release size: 17.8 kB
Release files / prism_honesty-0.1.0.tar.gz
| Download URL | prism_honesty-0.1.0.tar.gz |
|---|---|
| Size | 8.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2df4ca9470d057e47545b59e9f1afefd1f281378f1befa8d6712f2fe229061d3
|
|
BLAKE2b-256 checksum How to use checksums |
bd8d4efa41e15bfe3bca21e559170d7b6ee7bf9fa5f98b4876053044ef7e0d00
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / prism_honesty-0.1.0-py3-none-any.whl
| Download URL | prism_honesty-0.1.0-py3-none-any.whl |
|---|---|
| Size | 9.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bc7cae74f2f29bd5282524f7cf9ad20c248b0a5121480ae0e93e8442a0f5f1fb
|
|
BLAKE2b-256 checksum How to use checksums |
50140c2562a979fa3643736ebc14930d084e3a913b3300b5aaaa7c816bd943df
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for prism-honesty 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.