Files
praxis/server/guardrails/noop.py
T
Praxis CI b77536aa5e docs(P01): complete minimal-voice-loop phase
---ci---
phase: 1
milestone: v0.1
status: complete
requirements:
  covered: [REQ-VOICE-01, REQ-VOICE-02, REQ-VOICE-03, REQ-VOICE-04, REQ-SCEN-01, REQ-STATE-01, REQ-LLM-01, REQ-LLM-02, REQ-DEBRIEF-01, REQ-ORCH-01, REQ-ORCH-02, REQ-SCEN-FMT-01, REQ-NFR-LAT-01, REQ-NFR-SAFE-01, REQ-NFR-COST-01]
  partial: []
---/ci---
2026-08-01 13:28:42 +00:00

37 lines
1.3 KiB
Python

"""NoOpGuardrail — always-allow stub implementing the Guardrail interface (TASK-02-07).
SLICE-02 ships this stub so the Pipecat pipeline has the pluggable guardrail hook
in place from the first slice. SLICE-03 TASK-03-04 swaps in CustomerServiceGuardrail
with no pipeline change (D-019). The disclaimer text is defined here (matches the
RESEARCH.md safety baseline) so the pipeline can play it as the first AI utterance
even before the real ruleset lands.
"""
from __future__ import annotations
from server.services.base import Guardrail, GuardrailContext, GuardrailVerdict
# The session-start disclaimer (RESEARCH.md §Safety). Played as the first AI
# utterance of every session. Defined here so it exists from SLICE-02.
DISCLAIMER_TEXT = (
"This is an AI practice session for training purposes. "
"It is not a real conversation and no real company is involved."
)
class NoOpGuardrail(Guardrail):
"""Always-allow stub (SLICE-02 placeholder for the Guardrail slot)."""
name = "noop"
async def check(
self, text: str, context: GuardrailContext | None = None
) -> GuardrailVerdict:
return GuardrailVerdict(allowed=True, reason="noop guardrail — all allowed", category="ok")
@property
def session_start_disclaimer(self) -> str:
return DISCLAIMER_TEXT
__all__ = ["NoOpGuardrail", "DISCLAIMER_TEXT"]