ProjectBuild an AI Voice Receptionist: the explanation · Module 15: Safety: emergencies, scope and personal data · part 17 of 23
Part 17 · Module 15: Safety: emergencies, scope and personal data
Module 15: Safety: emergencies, scope and personal data
24 min read·
About 40 minutes · Needs: Module 10 (languages and scripts) and Module 11 (the agent graph) · Code: backend/app/agent/guardrails.py, backend/app/core/pii.py, backend/app/agent/speech_guard.py
Where this fits
Safety (blue: this module) sits on both sides of the agent: before any model reads a turn and before any sentence is spoken.
A clinic phone line hears things a bank chatbot never does: chest pain, a child who is not breathing, a request for a dose of medicine. This module is the code that stands on both sides of the agent. Every caller turn passes through the input guard before any model sees it, and every sentence the agent writes passes through the speech gate before Kokoro speaks it. The same personal data masker also cleans stored transcripts, logs and everything sent to the tracing service.
The rest of this project is yours to keep
This project is bought on its own, once, and stays readable afterwards, including the parts added to it later.