Voice-specific guardrails
VoiceGateway provides project-scoped, LLM-side guardrails for voice agents. Guardrails are injected through the existingvoicegateway.inference.LLM(...) drop-in path, so agent code keeps the same LiveKit construction pattern.
Guardrails do not create a proxy session service, do not inspect raw audio, and do not intercept arbitrary tool calls. They append a versioned system prompt block to the LiveKit chat context and register one reserved LiveKit function tool named report_guardrail_action.
Policy model
Guardrail policies live per project. The default is disabled, with every category set tooff.
piifinancialmedicalprompt_injectionoff_topic
redact: answer without repeating the sensitive detail.block: decline the current turn with a brief, neutral response.alert: continue normally and write an audit event.off: disable that category.
Runtime behavior
On the first guarded LLM chat in a session, VoiceGateway freezes the active project policy. Later dashboard or API edits affect new sessions only. When guardrails are active:- VoiceGateway appends a
<voicegateway_guardrails version="v0.6.0">block after existing system/developer instructions. - VoiceGateway registers
report_guardrail_action(category, action, context_excerpt). - A user-defined tool with the same name is rejected for that session.
- Audit rows are written to
guardrail_eventswithevent_type = fired.
guardrails_activeguardrails_bypassedguardrail_policy_snapshotguardrail_events
Bypass
Use bypass only for trusted internal sessions where the operator intentionally wants no injection. VoiceGateway records a bypass audit event when the frozen policy would otherwise be active.event_type = bypassed; category and action are NULL.
CLI
voicegw guardrails talks to the dashboard API:
VOICEGW_API_KEY when your dashboard API requires auth.
API
Server API:GET /v1/projects/{id}/guardrailsPOST /v1/projects/{id}/guardrailsGET /v1/guardrails/eventsGET /v1/guardrails/aggregate
/api/....
Aggregates count only fired rows. Event listings can include both fired and bypassed.