djaydenvanhattem3 commited on
Commit
da03a69
·
verified ·
1 Parent(s): 4ba3ede

Create security_service.py

Browse files
Files changed (1) hide show
  1. ai-bot/services/security_service.py +12 -0
ai-bot/services/security_service.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from utils.security_scanner import scan_input
2
+
3
+ def check_security(input_text: str):
4
+ threats = scan_input(input_text)
5
+
6
+ if threats:
7
+ return {
8
+ "blocked": True,
9
+ "reason": f"Dangerous patterns detected: {threats}"
10
+ }
11
+
12
+ return {"blocked": False}