How osamaqh4/hajiz-dlp-gateway works
Hajiz is an AI data-loss-prevention gateway for employee prompts and files. A client request enters through a provider adapter, is inspected by deterministic Tier A and—when warranted—semantic Tier B, then policy selects allow, pseudonymize, escalate, or block. The handler tokenizes approved spans, forwards sanitized content to the model, and restores values in ordinary and streamed replies. Audit records, live events, metrics, policy administration, and human escalation support governance and operations. The README documents these capabilities; some subsystem links use only the exact paths in the tree because their source was not sampled.
Main entry points: handler.js Request Handler · server.js HTTP Gateway · app.js Dashboard UI · index.js Tier Orchestrator
Components 20
Gateway Access
- HTTP Gateway
gateway/server.js - Provider Adapters
gateway/proxy/adapters.js
Detection
- Tier Orchestrator
gateway/detect/index.js - Pattern Detection
gateway/detect/tierA/index.js - Patterns And Checks
gateway/detect/tierA/patterns.js - Checksum Validators
gateway/detect/tierA/validators.js - Semantic Judge
gateway/detect/tierB/judge.js
Privacy Proxy
- Request Handler
gateway/proxy/handler.js - Token Vault
gateway/vault/vault.js - Stream Parser
gateway/proxy/sse.js
Governance
- Policy Engine
gateway/policy/policy.js - Policy Rules
policy.yaml - Audit Log
gateway/audit/audit.js - Audit Records
Operations Console
- Events And Metrics
gateway/lib/events.js - Dashboard UI
dashboard/app.js
Other components
- Employee Client
- Judge Endpoint
- AI Model API
- Human Reviewer
Connections 27
- Employee Client → HTTP Gateway: sends request
- HTTP Gateway → Provider Adapters: selects adapter
- HTTP Gateway → Request Handler: dispatches request
- Request Handler → Provider Adapters: extracts and rewrites
- Request Handler → Tier Orchestrator: submits prompt
- Tier Orchestrator → Pattern Detection: scans text
- Pattern Detection → Patterns And Checks: runs patterns
- Pattern Detection → Checksum Validators: validates matches
- Tier Orchestrator → Semantic Judge: judges when warranted
- Semantic Judge → Judge Endpoint: sends text
- Request Handler → Policy Engine: requests decision
- Tier Orchestrator → Policy Engine: reads thresholds
- Policy Engine → Policy Rules: loads and watches
- Request Handler → Token Vault: tokenizes and restores
- Request Handler → AI Model API: forwards sanitized request
- AI Model API → Request Handler: returns model response
- Request Handler → Stream Parser: parses stream
- Request Handler → Audit Log: appends decision
- HTTP Gateway → Audit Log: verifies chain
- Audit Log → Audit Records: reads and writes
- Request Handler → Events And Metrics: publishes request events
- HTTP Gateway → Events And Metrics: reads events and metrics
- HTTP Gateway → Dashboard UI: serves interface
- Dashboard UI → HTTP Gateway: requests state and events
- Dashboard UI → HTTP Gateway: submits review decision
- Human Reviewer → Dashboard UI: approves or declines
- Dashboard UI → Employee Client: shows restored answer