๐Ÿš€ Everything is free โ€” help us improve! Submit feedback and shape the platform.
๐ŸงชTDD Challengeยทintermediateยทโฑ๏ธ 35โ€“55mยทโญ 200 XP

M-068Build an AI Safety Guardrails Pipeline

Description

Nebula Corp's chatbot has no safety filters โ€” it happily leaks PII, follows injected instructions, and generates harmful content. Build a complete safety pipeline with input validation (prompt injection detection, topic boundaries), output filtering (PII redaction, harmful content blocking), and safety event logging.

Test Cases (3)

Blocks prompt injection
Should detect and block prompt injection
Input:testInjectionBlock()
Expected:CONTAINS:injection
Redacts PII from output
Should redact emails and phone numbers
Input:testPiiRedaction()
Expected:CONTAINS:REDACTED
Full pipeline filters output
Should redact PII in the full pipeline
Input:testFullPipeline()
Expected:CONTAINS:REDACTED

Related Lessons

Click Run / Check to validate your solution