Skip to content

πŸ€– Explain with AI

Using the Private AI Gateway for Enterprise-Grade Privacy

Overview

The Private AI Gateway is 4Geeks AI Studio’s enterprise-grade privacy layer. It ensures your proprietary code never leaves your secure perimeter to train public models, using Zero Data Retention policies and private routing to all LLM providers.

In this tutorial, you’ll learn:

  • How the Private AI Gateway works
  • How to configure privacy settings
  • How Zero Data Retention is enforced
  • How to audit data flow and compliance
  • How to set up custom data handling policies

How the Private AI Gateway Works

Your Code ──────► Private AI Gateway ──────► LLM Providers
                      β”‚
                      β”œβ”€β”€ Encrypted tunnel to all LLM APIs
                      β”œβ”€β”€ Zero Data Retention enforcement
                      β”œβ”€β”€ Request sanitization
                      β”œβ”€β”€ Response validation
                      └── Complete audit logging

Key Privacy Features

Feature Description
Zero Data Retention Your code is never stored by LLM providers
Encrypted Transit All data in transit is encrypted (TLS 1.3)
Request Sanitization Sensitive data (secrets, keys) is automatically removed
Response Validation Output is checked for data leakage before returning
Audit Logging Complete log of all AI requests and responses
Private Routing Direct, private connections to LLM providers

Step 1: Enable the Private AI Gateway

  1. Go to your AI Studio project settings
  2. Navigate to AI Factory β†’ Private AI Gateway
  3. Toggle “Enable Private Gateway”
  4. Select your privacy level:
  5. Standard: Zero Data Retention with all providers
  6. Enhanced: Standard + request sanitization + response validation
  7. Maximum: Enhanced + private network routing + custom data policies

Step 2: Configure Zero Data Retention

Provider Agreements

The Private AI Gateway enforces Zero Data Retention with all LLM providers:

Provider Zero Data Retention Verified
Claude 4.5 (Anthropic) Yes β€” API data not used for training βœ…
GPT-5 (OpenAI) Yes β€” API data not used for training βœ…
Gemini 3 Pro (Google) Yes β€” API data not used for training βœ…
DeepSeek Yes β€” API data not used for training βœ…

Configuration

  1. Go to Private AI Gateway β†’ Data Retention
  2. Verify Zero Data Retention is enabled for all providers
  3. Review provider privacy agreements
  4. Set data retention period for audit logs (default: 90 days)

Step 3: Configure Request Sanitization

The gateway automatically detects and removes sensitive data from requests:

Detected Patterns

Pattern Type Examples Action
API Keys sk-xxx, AKIAxxx, ghp_xxx Replace with [REDACTED]
Passwords Hardcoded passwords in code Replace with [REDACTED]
Database URLs postgresql://user:pass@host Replace with [REDACTED]
JWT Tokens eyJhbGciOi... Replace with [REDACTED]
Email Addresses user@company.com Optional: replace or keep
IP Addresses 192.168.1.1 Optional: replace or keep

Custom Patterns

Add your own sensitive data patterns:

custom_patterns:
  - name: "Internal API URLs"
    pattern: "https://api\\.internal\\.company\\.com/.*"
    action: "redact"

  - name: "Employee IDs"
    pattern: "EMP-\\d{6}"
    action: "redact"

  - name: "Customer Names"
    pattern: "customer_name:\\s*\"[^\"]+\""
    action: "redact"

Step 4: Set Up Response Validation

The gateway validates AI responses before returning them to your repository:

Validation Rules

Rule Description
No data leakage Ensures AI doesn’t echo back sensitive data
No hallucinated secrets Checks for patterns that look like credentials
Code integrity Verifies generated code doesn’t contain malicious patterns
Compliance check Ensures output meets your compliance requirements

Configuration

  1. Go to Private AI Gateway β†’ Response Validation
  2. Enable validation rules
  3. Set action for failed validation:
  4. Block: Reject the response and retry
  5. Warn: Allow but flag for review
  6. Log: Allow but log the issue

Step 5: Audit Data Flow

Audit Dashboard

  1. Go to Private AI Gateway β†’ Audit Log
  2. View all AI requests with:
  3. Timestamp: When the request was made
  4. Model: Which LLM was used
  5. Task: Associated AI task
  6. Data sanitized: Whether sensitive data was detected and removed
  7. Validation result: Whether the response passed validation
  8. Retention status: Confirmation of Zero Data Retention

Export Audit Reports

  1. Click “Export Report”
  2. Select date range
  3. Choose format (CSV, PDF, JSON)
  4. Download for compliance documentation

Step 6: Configure Custom Data Policies

For enterprise customers with specific compliance requirements:

Data Residency

Specify where data can be processed:

Region Available Notes
US βœ… All providers have US endpoints
EU βœ… GDPR-compliant endpoints
LATAM βœ… Regional endpoints for Costa Rica, Brazil
Asia Pacific Partial Limited provider support

Compliance Frameworks

Map your gateway configuration to compliance frameworks:

Framework Requirements Gateway Support
SOC 2 Type II Data protection, access controls βœ… Full support
HIPAA Protected health information βœ… With BAA
GDPR EU data protection βœ… Full support
PCI DSS Payment card data βœ… Full support
ISO 27001 Information security management βœ… Full support

Best Practices

Privacy-First Development

  • Never commit secrets to your repository β€” use environment variables
  • Review sanitization logs regularly to catch new patterns
  • Update custom patterns when new types of sensitive data emerge
  • Audit quarterly to ensure compliance with your policies

Team Training

  • Educate developers on what constitutes sensitive data
  • Establish clear policies for handling credentials and secrets
  • Use secret management tools (Vault, AWS Secrets Manager) instead of hardcoded values
  • Review audit logs as part of your regular development process

Compliance Documentation

  • Export audit reports for compliance audits
  • Maintain data processing records as required by GDPR
  • Document your privacy configuration for internal reviews
  • Update policies when regulations change

What’s Next?

Need Help?


Still questions? Ask the community.