Case study · Live demo · open source

Harbor

A legal-risk check for the moment a manager hears something they were never trained to hear.

Status
Demo stage. Open source under the MIT license.
Stack
TypeScript, Next.js, pnpm monorepo, Vitest
Tests
190 passing across 5 packages

The problem

An employee tells their manager, “I have anxiety and I need flexible hours.” Under the Americans with Disabilities Act, that can be a request for a reasonable accommodation, even though the employee never used those words. Most frontline managers don't know that.

What the manager says next (“we can't do that, it wouldn't be fair to the team”) can become evidence in an EEOC charge. A general-purpose chatbot doesn't help. Ask it, and it will happily draft a reply that creates more exposure.

What I built

  1. Trigger detection first

    189 trigger phrases flag ADA, FMLA, FLSA, Title VII, and retaliation triggers in the manager's own description, plus two safety patterns (self-harm and violence) that escalate right away. They run before anything else, on the manager's own words.

  2. The same four steps, every time

    Name the trigger. List the phrases not to say and the law behind each one. Give a compliant first response. Route the case to HR. The shape never changes, so managers learn it.

  3. A privacy layer that fails closed

    Names, birth dates, Social Security numbers, contact details, and medical details become tokens right after trigger detection, so retrieval and generation only see tokens. If a name or other identifier from the manager's text shows up in a response, the gate blocks it and the case goes to HR.

  4. An output scanner that can't be tricked easily

    Every generated response is checked for legal-advice framing and advisory phrases before it appears. The scanner first normalizes look-alike Cyrillic letters, zero-width characters, and HTML entities, so those tricks can't sneak a phrase through.

  5. Deterministic from end to end

    No language model and no API key. Retrieval is keyed to the detected trigger, and the answer is assembled from 7 company policy sections and 8 federal sources, so the same question always gets the same answer. A seven-node Corrective RAG graph runs it on a custom 81-line executor (no LangGraph), with at most three re-retrievals, two regenerations, and 12 calls.

  6. Every failure hands off

    Too many loops, no usable citations, a blown budget, a failed dependency, or a failed compliance gate: each one routes the case to a person instead of guessing.

How it fits together

Shaded steps are the guardrails. Every step is deterministic code with no language model, and any step can send the case to HR instead of continuing.

Screenshot

Harbor live demo after running the ADA sample: the compliance gate shows output verified, step 1 flags an ADA accommodation trigger, and step 2 lists phrases not to say.
The live demo on the ADA sample. The compliance gate passes, the trigger is named, and the do-not-say list follows. Captured November 2, 2026.

Results so far

  • 190

    automated tests passing, including bypass attempts with look-alike characters and hidden characters.

  • MIT

    license. Anyone can read exactly how the guardrails work.

  • 8

    trigger patterns: six legal, two safety. Each one sets an HR notification flag.

Not built yet

  • Name detection uses a list of common first names plus nearby cue words (“my employee”), so an unusual name with no cue word nearby can slip past the tokenizer.
  • Training mode (role-play practice with scoring) is designed, not built.
  • HR notification is flagged in every triggered response; sending the notification is not wired up yet.
  • The tamper-proof audit trail and the encrypted vault are designed, not built.
  • Citation grading passes by construction, since every citation is copied from its source. A grader for free-written text is not built.