Skip to content

14.11 Security Architecture & Air-Gap Defense ​

1. What It Is in Plain Words ​

Security architecture defines the defense-in-depth principles—perimeter controls, identity verification, transport encryption, and data sanitization—that protect a system from data breaches, code injection, and unauthorized tampering.


2. How THIS Project Uses It ​

The platform implements an Air-Gapped, Zero-Outbound Security Architecture:

  • Zero Cloud API Dependence: The backend makes zero outbound requests to cloud AI services (OpenAI, AWS, Anthropic).
  • Network Isolation: Operates with zero internet connectivity once containerized.
  • Input Validation Sanitization: All incoming payloads are strictly typed and parsed via Pydantic v2 ([app.py:L61-L67](file:///Users/avishjain/avishjain9-repos/21-bis-compliance-engine/app.py#L61-L67)).
  • Domain Guardrail Filtering: Protects the regulatory boundary via a deterministic 4-tier filter in [guardrail.py](file:///Users/avishjain/avishjain9-repos/21-bis-compliance-engine/guardrail.py).

3. Comparison with Security Models ​

Security ControlCloud-Dependent AI ArchitectureAir-Gapped Local Architecture (Used)
Data Leakage RiskHigh (User queries transmitted to third-party cloud servers)Zero (Vectors remain in local host RAM)
Prompt Injection RiskSevere (LLM jailbreaks can leak instructions or bypass filters)Immune (No generative LLM; deterministic vector search)
Secret Management RiskHigh (API keys in .env or CI/CD pipelines can be compromised)Zero (No API keys or external credentials exist)
Compliance OverheadHigh (Requires DPDP/GDPR third-party vendor audits)Minimal (100% data residency compliance)

4. Trade-offs Accepted ​

  • Public Internal Access: In its default configuration, any user with network access to port 8000 can invoke /chat because user authentication and role-based access control (RBAC) are not yet integrated.

5. What Breaks at Scale ​

  • At 10x Load: Security posture remains sound.
  • At 100x Load: Lack of authentication prevents attributing which user or department generated a specific audit pack.
  • At 1000x Load: Lack of IP-based rate limiting allows brute-force resource exhaustion.

6. How a Senior Engineer Would Improve It ​

  1. Integrate JWT-based RBAC using OAuth 2.0 with asymmetric RSA keys (RS256).
  2. Escape all user-supplied text strings in CSV generation to neutralize CSV formula injection (=, +, -, @).
  3. Restrict CORSMiddleware from allow_origins=["*"] to explicit enterprise domain origins.

7. 30-Second Spoken Answer ​

"Our security architecture is built on complete air-gap isolation: because FastEmbed and FAISS execute locally in memory, no proprietary manufacturing blueprints or product queries are ever transmitted over external networks. Furthermore, because we use deterministic vector retrieval rather than an autoregressive LLM, our engine is mathematically immune to prompt injection attacks."