How occludra/gateway works
Occludra is a self-hosted AI security gateway with a Python SDK. An application sends an OpenAI-compatible chat request; the gateway authenticates it, resolves provider/model settings, scans messages for sensitive data and injection patterns, then blocks or redacts before forwarding to an LLM provider. The README documents the Presidio service as the gateway’s PII scanning backend. The graph focuses on these self-hosted runtime capabilities; managed-cloud features are documented but not represented in this repository tree. Some internal DLP and response details are unsampled, so their connections are limited to documented relationships.
Main entry points: proxy.py Chat Handler · app/main.py Gateway App · app/main.py Presidio Service · client.py SDK Client
Components 18
Gateway API
- Gateway App
proxy-api/app/main.py - Chat Handler
proxy-api/app/routers/proxy.py - API Key Auth
proxy-api/app/auth.py - Gateway Config
proxy-api/app/config.py - API Models
proxy-api/app/models.py - Health Route
proxy-api/app/routers/health.py - Request Logging
proxy-api/app/log_utils.py
Safety Scanning
- DLP Client
proxy-api/app/dlp.py - Presidio Service
presidio/app/main.py - Custom Recognizers
presidio/app/recognizers.py - Scan Models
presidio/app/models.py - Anonymization
presidio/app/post_processor.py
Provider Routing
- Provider Routing
proxy-api/app/providers.py - LLM Provider
Python SDK
- SDK Client
sdk/python/aisg/client.py - Typed Responses
sdk/python/aisg/models.py - SDK Errors
sdk/python/aisg/exceptions.py
Other components
- Client Application
Connections 18
- Client Application → Gateway App: sends requests
README.md - Gateway App → Chat Handler: routes requests
proxy-api/app/main.py - Gateway App → Health Route: registers route
proxy-api/app/main.py - Gateway App → Request Logging: configures logging
proxy-api/app/main.py - Chat Handler → API Key Auth: authenticates
proxy-api/app/routers/proxy.py - Chat Handler → Gateway Config: loads settings
proxy-api/app/routers/proxy.py - Chat Handler → API Models: validates request
proxy-api/app/routers/proxy.py - Chat Handler → DLP Client: scans messages
proxy-api/app/routers/proxy.py - DLP Client → Presidio Service: requests scan
README.md - Presidio Service → Custom Recognizers: builds analyzer
presidio/app/main.py - Presidio Service → Scan Models: uses scan models
presidio/app/main.py - Presidio Service → Anonymization: uses anonymizer
presidio/app/main.py - Chat Handler → Provider Routing: forwards completion
proxy-api/app/routers/proxy.py - Provider Routing → LLM Provider: calls upstream
README.md - Client Application → SDK Client: uses SDK
README.md - SDK Client → Gateway App: calls API
README.md - SDK Client → Typed Responses: parses responses
sdk/python/aisg/client.py - SDK Client → SDK Errors: raises errors
sdk/python/aisg/client.py