Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -21,7 +21,7 @@ def analyze_prompt(user_prompt):
|
|
| 21 |
Only return a concise result in this exact format:
|
| 22 |
|
| 23 |
- Detected Vulnerability: <list types or "None">
|
| 24 |
-
- Risk Level: <Low / Medium / High>
|
| 25 |
- Short Explanation (1 sentence)
|
| 26 |
|
| 27 |
Prompt to analyze:
|
|
@@ -38,7 +38,7 @@ def analyze_prompt(user_prompt):
|
|
| 38 |
# Step 2: Suggest a safer reformulation of the prompt (conditional)
|
| 39 |
rewrite_prompt = f"""
|
| 40 |
You are an AI security assistant.
|
| 41 |
-
Based on the following analysis of a user prompt, output a safer version of the prompt ONLY if
|
| 42 |
If the analysis indicates no risk, simply return the original prompt as-is.
|
| 43 |
|
| 44 |
Analysis Result:
|
|
|
|
| 21 |
Only return a concise result in this exact format:
|
| 22 |
|
| 23 |
- Detected Vulnerability: <list types or "None">
|
| 24 |
+
- Risk Level: <Not Risky / Low / Medium / High>
|
| 25 |
- Short Explanation (1 sentence)
|
| 26 |
|
| 27 |
Prompt to analyze:
|
|
|
|
| 38 |
# Step 2: Suggest a safer reformulation of the prompt (conditional)
|
| 39 |
rewrite_prompt = f"""
|
| 40 |
You are an AI security assistant.
|
| 41 |
+
Based on the following analysis of a user prompt, output a safer version of the prompt ONLY if the risk level is concerning.
|
| 42 |
If the analysis indicates no risk, simply return the original prompt as-is.
|
| 43 |
|
| 44 |
Analysis Result:
|