What it is
Photograph an item, pick your animal (dog, cat, or horse), and get a toxicity verdict with cited sources and a poison-hotline fallback. The person I built it for is a panicking owner at 2 a.m., so the whole thing aims at a trustworthy answer and the shortest path to safety, working offline if it has to. SniffSafe is the product name; PetGuard is the codename it still carries in the repo and the API.
Safe by construction
The core rule of the architecture is that the vision model only identifies, and the cited database decides. No inference path can produce a "safe" verdict on its own; that word is only reachable through an explicit database record with a citation attached. This is enforced by an invariant test in the suite, and it has already paid for itself. When a new "caution" toxicity class was added, a catch-all else branch would have let unknown values fall straight through to "safe," and the invariant caught the false-safe bug before it could ship.
Building the hazard database
The hazard database was re-derived from primary and public-domain toxicology sources, veterinary manuals, FDA material, and university extensions, by an 80-agent research workflow: one researcher and one adversarial verifier per item, across 40 items. The verifiers threw out fabricated citations, forced 16 claims that could not be confirmed down to "unknown," and split records where species diverge in ways that matter, like an insecticide that a dog tolerates and a cat does not survive. Every record carries full quotes and source URLs in a provenance file. Severity grading leans toward caution on purpose, and that lean is written down where anyone can see it.
Engineering highlights
- Pluggable vision providers. A mock provider keeps development free and keyless, production runs a cheap vision model through OpenRouter, and premium providers slot in behind the same interface.
- An offline lethal core. The adjudication logic and hazard data compile into an offline pack inside the app, guarded by a test that fails if the pack ever drifts from its canonical source.
- Deployed and hardened. The backend is a Cloudflare Worker, live in production, with per-IP rate limiting and image-size caps.
- Honest tiering. A 12-axis production audit graded the app at prototype tier, and that verdict lives in the repo instead of being rounded up. What drives the roadmap is the gap list the audit produced.