amitbhatt6075's picture
Complete fresh start - FINAL UPLOAD
0914e96
class SafetyGuard:
# Is list ko baad mein badha sakte ho
BLACKLIST_WORDS = {
"ignore instructions", "system prompt", "password", "secret key",
"hack", "bypass"
}
@staticmethod
def validate_input(text: str) -> bool:
"""Input clean hai ya nahi check karna."""
if not text or len(text.strip()) == 0:
return False
lower_text = text.lower()
for word in SafetyGuard.BLACKLIST_WORDS:
if word in lower_text:
return False # Unsafe found
return True
@staticmethod
def sanitize(text: str) -> str:
"""Extra spaces clean karna."""
return " ".join(text.split())