Spaces:
Running
Running
Create wattle_guard.py
Browse files- wattle_guard.py +34 -0
wattle_guard.py
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import wattle_guard # Import your script
|
| 3 |
+
|
| 4 |
+
def audit_url(url):
|
| 5 |
+
# Run the audit function from your script
|
| 6 |
+
report = wattle_guard.run_audit(url)
|
| 7 |
+
|
| 8 |
+
# Format the output nicely for the user
|
| 9 |
+
risk_level = report['data_sovereignty']['jurisdiction_risk']
|
| 10 |
+
location = report['data_sovereignty']['physical_location']
|
| 11 |
+
|
| 12 |
+
# Return a formatted string or JSON
|
| 13 |
+
return f"""
|
| 14 |
+
🇦🇺 WATTLE-GUARD AUDIT REPORT
|
| 15 |
+
-----------------------------
|
| 16 |
+
Target: {report['target']}
|
| 17 |
+
Location: {location}
|
| 18 |
+
Risk Level: {risk_level}
|
| 19 |
+
|
| 20 |
+
Full Technical Details:
|
| 21 |
+
{report}
|
| 22 |
+
"""
|
| 23 |
+
|
| 24 |
+
# Create the UI
|
| 25 |
+
iface = gr.Interface(
|
| 26 |
+
fn=audit_url,
|
| 27 |
+
inputs="text",
|
| 28 |
+
outputs="text",
|
| 29 |
+
title="🇦🇺 Wattle-Guard: Australian Sovereignty Validator",
|
| 30 |
+
description="Enter a URL (e.g., openai.com) to audit it against APP 8 & SOCI Act requirements.",
|
| 31 |
+
examples=["[https://openai.com](https://openai.com)", "[https://www.commbank.com.au](https://www.commbank.com.au)"]
|
| 32 |
+
)
|
| 33 |
+
|
| 34 |
+
iface.launch()
|