For agent builders
Hallucination Guard API plugs into your agent's output pipeline. One call before you ship the response. Catches invented citations, statutes, policy refs, made-up sources.
Built for agent builders
import { Prism } from "@prism/sdk";
const prism = new Prism({ apiKey: process.env.PRISM_API_KEY });
const chain = ChatPromptTemplate.fromMessages([...])
.pipe(model)
.pipe(async (output) => {
// Drop-in middleware before the user sees the response.
const verified = await prism.guard.verifyReferences({
text: output.content,
sources: state.retrievedDocs,
domain: "legal",
});
return verified.flagged_text;
});from prism import Prism
prism = Prism(api_key=os.environ["PRISM_API_KEY"])
response = query_engine.query(user_query)
verified = prism.guard.verify_references(
text=response.response,
sources=[node.text for node in response.source_nodes],
domain="financial",
)
final_text = verified["flagged_text"]# In your agent's tool list, register Prism as a verifier
from prism import Prism
prism = Prism(api_key=os.environ["PRISM_API_KEY"])
def verify_before_send(text: str, sources: list[str]) -> str:
return prism.guard.verify_references(
text=text, sources=sources, domain="legal"
)["flagged_text"]
# Your agent calls verify_before_send() right before the user sees
# any text that might cite a case, statute, or policy.Your agent generates → Prism verifies → user receives. The middleware adds ~150ms to the response and zero false-positive risk: existing [verify] markers are idempotent.
Why pick Prism over rolling your own
The regex set is the same one shipping in production across nine professional-vertical Prism modules. You inherit the tuning instead of writing your own from scratch.
Safe to call multiple times on the same text. Existing [verify] markers don't get duplicated. Run it inside a retry loop without thinking.
Won't corrupt mid-text. Pattern matches are sorted by offset; insertions happen in reverse. Concatenated outputs from multi-call agents stay coherent.
No cross-tenant data, no learning from your inputs. Your sources stay yours. Per-key usage counts and timestamps are stored for cap enforcement; the inputs themselves are not.
Pricing for agent workloads
Same tiers as the public developer plan. Switch up at any time.
$0
100 calls/mo
Prototyping
$97/mo
10,000 calls/mo
Early production
$497/mo
100,000 calls/mo
Volume
Custom
Negotiated
Dedicated infra
Hobbyist tier needs no card. Sign in, generate a key, ship.
The full API reference lives at /docs/api/hallucination-guard. Quickstart at /docs/quickstart.