Alienseeker commited on
Commit
d2ae9e6
Β·
verified Β·
1 Parent(s): 2584cf6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +381 -110
app.py CHANGED
@@ -1,9 +1,6 @@
1
  """
2
  TSZ (Thyris Safe Zone) - Interactive Demo
3
  ==========================================
4
- This demo showcases how TSZ detects and redacts sensitive information
5
- before it reaches LLMs or third-party APIs.
6
-
7
  GitHub: https://github.com/thyrisAI/safe-zone
8
  Website: https://thyris.ai
9
  """
@@ -13,13 +10,8 @@ import re
13
  from dataclasses import dataclass
14
  from typing import List, Tuple
15
 
16
- # ============================================================================
17
- # PII Detection Patterns (Simplified version of TSZ's detection engine)
18
- # ============================================================================
19
-
20
  @dataclass
21
  class Detection:
22
- """Represents a detected PII entity"""
23
  type: str
24
  value: str
25
  start: int
@@ -27,11 +19,6 @@ class Detection:
27
  confidence: str
28
 
29
  class TSZDetector:
30
- """
31
- Simplified PII detector that mimics TSZ's detection capabilities.
32
- The real TSZ uses more sophisticated pattern matching and validators.
33
- """
34
-
35
  PATTERNS = {
36
  "EMAIL": {
37
  "pattern": r'\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b',
@@ -61,7 +48,7 @@ class TSZDetector:
61
  "TC_KIMLIK": {
62
  "pattern": r'\b[1-9][0-9]{10}\b',
63
  "placeholder": "[TC_KIMLIK]",
64
- "description": "Turkish National ID (TC Kimlik)"
65
  },
66
  "IBAN": {
67
  "pattern": r'\b[A-Z]{2}[0-9]{2}[A-Z0-9]{4}[0-9]{7}([A-Z0-9]?){0,16}\b',
@@ -92,34 +79,19 @@ class TSZDetector:
92
  "pattern": r'\beyJ[A-Za-z0-9-_]+\.eyJ[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\b',
93
  "placeholder": "[JWT_TOKEN]",
94
  "description": "JSON Web Tokens"
95
- },
96
- "DATE_OF_BIRTH": {
97
- "pattern": r'\b(?:0[1-9]|[12][0-9]|3[01])[/-](?:0[1-9]|1[0-2])[/-](?:19|20)[0-9]{2}\b',
98
- "placeholder": "[DOB]",
99
- "description": "Dates of birth"
100
  }
101
  }
102
 
103
  def detect(self, text: str) -> Tuple[List[Detection], str]:
104
- """
105
- Detect PII in text and return detections + redacted text.
106
-
107
- Returns:
108
- Tuple of (list of detections, redacted text)
109
- """
110
  detections = []
111
  redacted_text = text
112
 
113
  for pii_type, config in self.PATTERNS.items():
114
  pattern = config["pattern"]
115
- placeholder = config["placeholder"]
116
-
117
  for match in re.finditer(pattern, text, re.IGNORECASE):
118
  value = match.group()
119
-
120
  if pii_type == "TC_KIMLIK" and len(value) != 11:
121
  continue
122
-
123
  detections.append(Detection(
124
  type=pii_type,
125
  value=value,
@@ -129,25 +101,16 @@ class TSZDetector:
129
  ))
130
 
131
  detections.sort(key=lambda x: x.start, reverse=True)
132
-
133
  for det in detections:
134
  placeholder = self.PATTERNS[det.type]["placeholder"]
135
  redacted_text = redacted_text[:det.start] + placeholder + redacted_text[det.end:]
136
-
137
  detections.sort(key=lambda x: x.start)
138
 
139
  return detections, redacted_text
140
 
141
- # ============================================================================
142
- # Gradio Interface
143
- # ============================================================================
144
-
145
  detector = TSZDetector()
146
 
147
  def analyze_text(text: str) -> Tuple[str, str, str]:
148
- """
149
- Main analysis function for Gradio interface.
150
- """
151
  if not text.strip():
152
  return "", "Please enter some text to analyze.", ""
153
 
@@ -157,7 +120,6 @@ def analyze_text(text: str) -> Tuple[str, str, str]:
157
  return text, "No sensitive information detected.", "**0** PII entities found"
158
 
159
  report_lines = ["### Detected Entities\n"]
160
-
161
  by_type = {}
162
  for det in detections:
163
  if det.type not in by_type:
@@ -183,84 +145,393 @@ EXAMPLES = [
183
  ["Merhaba, ben Ahmet Yilmaz. TC Kimlik numaram 12345678901.\nTelefon: 0532 123 45 67\nIBAN: TR330006100519786457841326"],
184
  ]
185
 
186
- with gr.Blocks(title="TSZ - Thyris Safe Zone Demo") as demo:
187
 
188
  gr.Markdown("""
189
- # TSZ (Thyris Safe Zone) - Interactive Demo
 
190
 
191
- **TSZ** is an open-source PII detection and guardrails engine that prevents sensitive data
192
- from leaking to LLMs and third-party APIs.
193
-
194
- [GitHub](https://github.com/thyrisAI/safe-zone) | [Website](https://thyris.ai) | Apache 2.0 License
195
  """)
196
 
197
- with gr.Row():
198
- with gr.Column():
199
- input_text = gr.Textbox(
200
- label="Input Text",
201
- placeholder="Paste text containing emails, phone numbers, credit cards, API keys, passwords, etc...",
202
- lines=8
203
- )
204
-
205
- analyze_btn = gr.Button("Analyze & Redact", variant="primary")
 
 
 
 
 
 
 
 
 
 
 
 
 
206
 
207
- gr.Markdown("### Try These Examples")
208
- gr.Examples(
209
- examples=EXAMPLES,
210
- inputs=input_text
211
- )
212
 
213
- with gr.Column():
214
- stats_output = gr.Markdown(label="Statistics")
215
-
216
- redacted_output = gr.Textbox(
217
- label="Redacted Output (Safe to send to LLMs)",
218
- lines=8,
219
- interactive=False
220
- )
221
-
222
- detection_report = gr.Markdown(label="Detection Report")
223
-
224
- gr.Markdown("""
225
- ---
226
- ### Supported Detection Types
227
-
228
- | Category | Types |
229
- |----------|-------|
230
- | **Personal Info** | Email, Phone (US/TR), SSN, TC Kimlik, Date of Birth |
231
- | **Financial** | Credit Cards, IBAN |
232
- | **Technical** | IP Addresses, API Keys, AWS Keys, Passwords, JWT Tokens |
233
-
234
- ---
235
-
236
- ### Get the Full Version
237
-
238
- This demo uses a simplified detection engine. The full **TSZ** includes:
239
- - More comprehensive pattern matching with validators
240
- - Configurable guardrails and policies
241
- - REST API with hot-reloadable rules
242
- - High-performance Go implementation with Redis caching
243
-
244
- ```bash
245
- git clone https://github.com/thyrisAI/safe-zone.git
246
- cd safe-zone
247
- docker-compose up -d
248
- ```
249
-
250
- Built by [Thyris.AI](https://thyris.ai)
251
- """)
252
-
253
- analyze_btn.click(
254
- fn=analyze_text,
255
- inputs=[input_text],
256
- outputs=[redacted_output, detection_report, stats_output]
257
- )
258
-
259
- input_text.submit(
260
- fn=analyze_text,
261
- inputs=[input_text],
262
- outputs=[redacted_output, detection_report, stats_output]
263
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
264
 
265
  if __name__ == "__main__":
266
  demo.launch()
 
1
  """
2
  TSZ (Thyris Safe Zone) - Interactive Demo
3
  ==========================================
 
 
 
4
  GitHub: https://github.com/thyrisAI/safe-zone
5
  Website: https://thyris.ai
6
  """
 
10
  from dataclasses import dataclass
11
  from typing import List, Tuple
12
 
 
 
 
 
13
  @dataclass
14
  class Detection:
 
15
  type: str
16
  value: str
17
  start: int
 
19
  confidence: str
20
 
21
  class TSZDetector:
 
 
 
 
 
22
  PATTERNS = {
23
  "EMAIL": {
24
  "pattern": r'\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b',
 
48
  "TC_KIMLIK": {
49
  "pattern": r'\b[1-9][0-9]{10}\b',
50
  "placeholder": "[TC_KIMLIK]",
51
+ "description": "Turkish National ID"
52
  },
53
  "IBAN": {
54
  "pattern": r'\b[A-Z]{2}[0-9]{2}[A-Z0-9]{4}[0-9]{7}([A-Z0-9]?){0,16}\b',
 
79
  "pattern": r'\beyJ[A-Za-z0-9-_]+\.eyJ[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\b',
80
  "placeholder": "[JWT_TOKEN]",
81
  "description": "JSON Web Tokens"
 
 
 
 
 
82
  }
83
  }
84
 
85
  def detect(self, text: str) -> Tuple[List[Detection], str]:
 
 
 
 
 
 
86
  detections = []
87
  redacted_text = text
88
 
89
  for pii_type, config in self.PATTERNS.items():
90
  pattern = config["pattern"]
 
 
91
  for match in re.finditer(pattern, text, re.IGNORECASE):
92
  value = match.group()
 
93
  if pii_type == "TC_KIMLIK" and len(value) != 11:
94
  continue
 
95
  detections.append(Detection(
96
  type=pii_type,
97
  value=value,
 
101
  ))
102
 
103
  detections.sort(key=lambda x: x.start, reverse=True)
 
104
  for det in detections:
105
  placeholder = self.PATTERNS[det.type]["placeholder"]
106
  redacted_text = redacted_text[:det.start] + placeholder + redacted_text[det.end:]
 
107
  detections.sort(key=lambda x: x.start)
108
 
109
  return detections, redacted_text
110
 
 
 
 
 
111
  detector = TSZDetector()
112
 
113
  def analyze_text(text: str) -> Tuple[str, str, str]:
 
 
 
114
  if not text.strip():
115
  return "", "Please enter some text to analyze.", ""
116
 
 
120
  return text, "No sensitive information detected.", "**0** PII entities found"
121
 
122
  report_lines = ["### Detected Entities\n"]
 
123
  by_type = {}
124
  for det in detections:
125
  if det.type not in by_type:
 
145
  ["Merhaba, ben Ahmet Yilmaz. TC Kimlik numaram 12345678901.\nTelefon: 0532 123 45 67\nIBAN: TR330006100519786457841326"],
146
  ]
147
 
148
+ with gr.Blocks(title="TSZ - Thyris Safe Zone Demo", theme=gr.themes.Soft()) as demo:
149
 
150
  gr.Markdown("""
151
+ # πŸ›‘οΈ TSZ (Thyris Safe Zone)
152
+ **Enterprise-grade PII detection and guardrails gateway** that prevents sensitive data from leaking to LLMs and third-party APIs.
153
 
154
+ [![GitHub](https://img.shields.io/badge/GitHub-Repository-black?logo=github)](https://github.com/thyrisAI/safe-zone)
155
+ [![Website](https://img.shields.io/badge/Website-thyris.ai-blue)](https://thyris.ai)
156
+ [![License](https://img.shields.io/badge/License-Apache%202.0-green)](https://github.com/thyrisAI/safe-zone/blob/main/LICENSE)
 
157
  """)
158
 
159
+ with gr.Tabs():
160
+ # Tab 1: Interactive Demo
161
+ with gr.TabItem("πŸ” Interactive Demo"):
162
+ with gr.Row():
163
+ with gr.Column():
164
+ input_text = gr.Textbox(
165
+ label="Input Text",
166
+ placeholder="Paste text containing emails, phone numbers, credit cards, API keys...",
167
+ lines=8
168
+ )
169
+ analyze_btn = gr.Button("Analyze & Redact", variant="primary")
170
+ gr.Markdown("### Try These Examples")
171
+ gr.Examples(examples=EXAMPLES, inputs=input_text)
172
+
173
+ with gr.Column():
174
+ stats_output = gr.Markdown(label="Statistics")
175
+ redacted_output = gr.Textbox(
176
+ label="Redacted Output (Safe to send to LLMs)",
177
+ lines=8,
178
+ interactive=False
179
+ )
180
+ detection_report = gr.Markdown(label="Detection Report")
181
 
182
+ analyze_btn.click(fn=analyze_text, inputs=[input_text], outputs=[redacted_output, detection_report, stats_output])
183
+ input_text.submit(fn=analyze_text, inputs=[input_text], outputs=[redacted_output, detection_report, stats_output])
 
 
 
184
 
185
+ # Tab 2: API Reference
186
+ with gr.TabItem("πŸ“š API Reference"):
187
+ gr.Markdown("""
188
+ ## TSZ API Reference
189
+
190
+ TSZ is an enterprise-grade PII detection and guardrails gateway. It acts as a zero-trust middleware between your applications and external systems (LLMs, SaaS APIs, third-party services).
191
+
192
+ ---
193
+
194
+ ### Base Information
195
+
196
+ **Base URL (Docker Compose):**
197
+ ```
198
+ http://localhost:8080
199
+ ```
200
+
201
+ **Production:**
202
+ ```
203
+ https://tsz.your-company.com
204
+ ```
205
+
206
+ **Content Type:** `application/json`
207
+
208
+ ---
209
+
210
+ ### Confidence & Guardrails Model
211
+
212
+ TSZ uses a hybrid confidence system:
213
+
214
+ | Confidence | Action |
215
+ |------------|--------|
216
+ | < 0.30 | ALLOW (ignored) |
217
+ | 0.30 – 0.85 | MASK (redact) |
218
+ | β‰₯ 0.85 | AUTO-BLOCK |
219
+
220
+ ---
221
+
222
+ ### POST /detect
223
+
224
+ Primary endpoint for PII detection and redaction.
225
+
226
+ **Request:**
227
+ ```json
228
+ {
229
+ "text": "My email is user@company.com",
230
+ "rid": "request-123",
231
+ "guardrails": ["TOXIC_LANGUAGE"]
232
+ }
233
+ ```
234
+
235
+ **Response:**
236
+ ```json
237
+ {
238
+ "redacted_text": "My email is [EMAIL]",
239
+ "detections": [
240
+ {
241
+ "type": "EMAIL",
242
+ "value": "user@company.com",
243
+ "placeholder": "[EMAIL]",
244
+ "start": 12,
245
+ "end": 28,
246
+ "confidence_score": "0.78",
247
+ "confidence_explanation": {
248
+ "source": "HYBRID",
249
+ "regex_score": "0.55",
250
+ "ai_score": "0.90",
251
+ "final_score": "0.78"
252
+ }
253
+ }
254
+ ],
255
+ "blocked": false,
256
+ "contains_pii": true,
257
+ "overall_confidence": "0.78"
258
+ }
259
+ ```
260
+
261
+ **cURL Example:**
262
+ ```bash
263
+ curl -X POST http://localhost:8080/detect \\
264
+ -H "Content-Type: application/json" \\
265
+ -d '{
266
+ "text": "Contact john@example.com",
267
+ "rid": "req-001",
268
+ "guardrails": ["TOXIC_LANGUAGE"]
269
+ }'
270
+ ```
271
+
272
+ ---
273
+
274
+ ### POST /v1/chat/completions
275
+
276
+ OpenAI-compatible LLM Gateway with built-in guardrails.
277
+
278
+ **Headers:**
279
+ - `X-TSZ-RID`: Request ID for audit logs
280
+ - `X-TSZ-Guardrails`: Comma-separated validators (e.g., `TOXIC_LANGUAGE,PII`)
281
+ - `X-TSZ-Guardrails-Mode`: `final-only` | `stream-sync` | `stream-async`
282
+ - `X-TSZ-Guardrails-OnFail`: `filter` | `halt`
283
+
284
+ **Request:**
285
+ ```bash
286
+ curl -X POST http://localhost:8080/v1/chat/completions \\
287
+ -H "Content-Type: application/json" \\
288
+ -H "X-TSZ-Guardrails: TOXIC_LANGUAGE" \\
289
+ -d '{
290
+ "model": "gpt-4",
291
+ "messages": [
292
+ {"role": "user", "content": "My credit card is 4111111111111111"}
293
+ ],
294
+ "stream": false
295
+ }'
296
+ ```
297
+
298
+ **Python SDK Example:**
299
+ ```python
300
+ from openai import OpenAI
301
+
302
+ client = OpenAI(
303
+ base_url="http://localhost:8080/v1",
304
+ api_key="dummy" # TSZ uses env var
305
+ )
306
+
307
+ resp = client.chat.completions.create(
308
+ model="gpt-4",
309
+ messages=[{"role": "user", "content": "Hello"}],
310
+ extra_headers={
311
+ "X-TSZ-Guardrails": "TOXIC_LANGUAGE,PII",
312
+ "X-TSZ-Guardrails-Mode": "stream-sync"
313
+ }
314
+ )
315
+ ```
316
+
317
+ ---
318
+
319
+ ### Pattern Management
320
+
321
+ | Method | Endpoint | Description |
322
+ |--------|----------|-------------|
323
+ | `POST` | `/patterns` | Create pattern |
324
+ | `GET` | `/patterns` | List patterns |
325
+ | `DELETE` | `/patterns/{id}` | Delete pattern |
326
+
327
+ **Create Pattern:**
328
+ ```json
329
+ {
330
+ "Name": "PHONE_NUMBER",
331
+ "Regex": "\\\\+?[0-9]{10,13}",
332
+ "Category": "PII",
333
+ "IsActive": true,
334
+ "BlockThreshold": 0.9
335
+ }
336
+ ```
337
+
338
+ ---
339
+
340
+ ### Allowlist / Blocklist
341
+
342
+ | Method | Endpoint | Description |
343
+ |--------|----------|-------------|
344
+ | `POST` | `/allowlist` | Add trusted value |
345
+ | `GET` | `/allowlist` | List allowlist |
346
+ | `DELETE` | `/allowlist/{id}` | Remove item |
347
+ | `POST` | `/blacklist` | Add blocked value |
348
+ | `GET` | `/blacklist` | List blocklist |
349
+ | `DELETE` | `/blacklist/{id}` | Remove item |
350
+
351
+ ---
352
+
353
+ ### Validators & Guardrails
354
+
355
+ | Method | Endpoint | Description |
356
+ |--------|----------|-------------|
357
+ | `POST` | `/validators` | Create validator |
358
+ | `GET` | `/validators` | List validators |
359
+ | `DELETE` | `/validators/{id}` | Delete validator |
360
+
361
+ **AI Validator Example:**
362
+ ```json
363
+ {
364
+ "name": "TOXIC_LANGUAGE",
365
+ "type": "AI_PROMPT",
366
+ "rule": "Is this text toxic? Answer YES or NO.",
367
+ "expected_response": "NO"
368
+ }
369
+ ```
370
+
371
+ ---
372
+
373
+ ### Health & Admin
374
+
375
+ | Endpoint | Description |
376
+ |----------|-------------|
377
+ | `GET /healthz` | Liveness probe |
378
+ | `GET /ready` | Readiness probe (DB + Redis) |
379
+ | `POST /admin/reload` | Clear caches |
380
+
381
+ ---
382
+
383
+ ### Client SDKs
384
+
385
+ **Python:**
386
+ ```bash
387
+ pip install "tszclient-py @ git+https://github.com/thyrisAI/safe-zone.git@main"
388
+ ```
389
+
390
+ ```python
391
+ from tszclient_py import TSZClient
392
+ client = TSZClient("http://localhost:8080")
393
+ result = client.detect("test@example.com")
394
+ ```
395
+
396
+ **Go:**
397
+ ```go
398
+ import "github.com/thyrisAI/safe-zone/pkg/tszclient-go"
399
+ client := tszclient.New("http://localhost:8080")
400
+ result, _ := client.Detect("test@example.com")
401
+ ```
402
+
403
+ ---
404
+
405
+ πŸ“– **Full Documentation:** [API_REFERENCE.md](https://github.com/thyrisAI/safe-zone/blob/main/docs/API_REFERENCE.md)
406
+ """)
407
+
408
+ # Tab 3: Quick Start
409
+ with gr.TabItem("πŸš€ Quick Start"):
410
+ gr.Markdown("""
411
+ ## Get Started with TSZ
412
+
413
+ ### Docker (Recommended)
414
+
415
+ ```bash
416
+ git clone https://github.com/thyrisAI/safe-zone.git
417
+ cd safe-zone
418
+ docker-compose up -d
419
+ ```
420
+
421
+ TSZ will be available at `http://localhost:8080`
422
+
423
+ ---
424
+
425
+ ### Environment Variables
426
+
427
+ ```bash
428
+ # LLM Gateway Configuration
429
+ THYRIS_AI_MODEL_URL=https://api.openai.com/v1
430
+ THYRIS_AI_API_KEY=sk-your-key
431
+ THYRIS_AI_MODEL=gpt-4
432
+
433
+ # Confidence Thresholds
434
+ CONFIDENCE_ALLOW_THRESHOLD=0.30
435
+ CONFIDENCE_BLOCK_THRESHOLD=0.85
436
+
437
+ # Admin API Key
438
+ ADMIN_API_KEY=your-secure-admin-key
439
+ ```
440
+
441
+ ---
442
+
443
+ ### Test the API
444
+
445
+ ```bash
446
+ curl -X POST http://localhost:8080/detect \\
447
+ -H "Content-Type: application/json" \\
448
+ -d '{"text": "Email: test@example.com", "rid": "test-001"}'
449
+ ```
450
+
451
+ ---
452
+
453
+ ### Architecture
454
+
455
+ ```
456
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
457
+ β”‚ Your App │────▢│ TSZ │────▢│ LLM API β”‚
458
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
459
+ β”‚
460
+ β”Œβ”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”
461
+ β”‚ Audit Log β”‚
462
+ β”‚ + Redis β”‚
463
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
464
+ ```
465
+
466
+ ---
467
+
468
+ ### Key Features
469
+
470
+ | Feature | Description |
471
+ |---------|-------------|
472
+ | **Hybrid Detection** | Regex + AI-powered confidence scoring |
473
+ | **Real-time Redaction** | Context-preserving placeholders |
474
+ | **LLM Gateway** | OpenAI-compatible proxy with guardrails |
475
+ | **Streaming Support** | sync/async modes for SSE |
476
+ | **Hot-reload Rules** | Update patterns via API |
477
+ | **Audit Trail** | Full logging for compliance |
478
+
479
+ ---
480
+
481
+ πŸ“– **Documentation:** [github.com/thyrisAI/safe-zone/docs](https://github.com/thyrisAI/safe-zone/tree/main/docs)
482
+ """)
483
+
484
+ # Tab 4: About
485
+ with gr.TabItem("ℹ️ About"):
486
+ gr.Markdown("""
487
+ ## About TSZ (Thyris Safe Zone)
488
+
489
+ Developed by **Thyris.AI** as an open-source enterprise AI security solution.
490
+
491
+ ### Why TSZ?
492
+
493
+ | Challenge | TSZ Solution |
494
+ |-----------|--------------|
495
+ | PII leaking to LLMs | Real-time detection & redaction |
496
+ | GDPR/KVKK compliance | Data never leaves your perimeter |
497
+ | Toxic content in AI | AI-powered guardrails |
498
+ | Audit requirements | Complete request logging |
499
+ | Integration complexity | OpenAI-compatible gateway |
500
+
501
+ ---
502
+
503
+ ### Detection Types
504
+
505
+ | Category | Types |
506
+ |----------|-------|
507
+ | **Personal Info** | Email, Phone, SSN, TC Kimlik, DOB |
508
+ | **Financial** | Credit Card, IBAN |
509
+ | **Technical** | API Keys, AWS Keys, Passwords, JWT |
510
+ | **Custom** | User-defined patterns |
511
+
512
+ ---
513
+
514
+ ### Compliance Ready
515
+
516
+ - βœ… GDPR (EU)
517
+ - βœ… KVKK (Turkey)
518
+ - βœ… CCPA (California)
519
+ - βœ… HIPAA (Healthcare)
520
+ - βœ… PCI-DSS (Payment)
521
+
522
+ ---
523
+
524
+ ### Links
525
+
526
+ - πŸ”— **GitHub:** [thyrisAI/safe-zone](https://github.com/thyrisAI/safe-zone)
527
+ - 🌐 **Website:** [thyris.ai](https://thyris.ai)
528
+ - πŸ“„ **License:** Apache 2.0
529
+ - πŸ“– **Docs:** [Documentation](https://github.com/thyrisAI/safe-zone/tree/main/docs)
530
+
531
+ ---
532
+
533
+ Built with ❀️ by [Thyris.AI](https://thyris.ai)
534
+ """)
535
 
536
  if __name__ == "__main__":
537
  demo.launch()