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¶
- Go to your AI Studio project settings
- Navigate to AI Factory β Private AI Gateway
- Toggle “Enable Private Gateway”
- Select your privacy level:
- Standard: Zero Data Retention with all providers
- Enhanced: Standard + request sanitization + response validation
- 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¶
- Go to Private AI Gateway β Data Retention
- Verify Zero Data Retention is enabled for all providers
- Review provider privacy agreements
- 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¶
- Go to Private AI Gateway β Response Validation
- Enable validation rules
- Set action for failed validation:
- Block: Reject the response and retry
- Warn: Allow but flag for review
- Log: Allow but log the issue
Step 5: Audit Data Flow¶
Audit Dashboard¶
- Go to Private AI Gateway β Audit Log
- View all AI requests with:
- Timestamp: When the request was made
- Model: Which LLM was used
- Task: Associated AI task
- Data sanitized: Whether sensitive data was detected and removed
- Validation result: Whether the response passed validation
- Retention status: Confirmation of Zero Data Retention
Export Audit Reports¶
- Click “Export Report”
- Select date range
- Choose format (CSV, PDF, JSON)
- 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?¶
- Learn about Getting Started with AI Studio
- Explore Understanding the AI Factory
- Read about Monitoring Token Usage
Need Help?¶
- Documentation: docs.4geeks.io
- Community: community.4geeks.io
- Support: Available through the console dashboard
Still questions? Ask the community.