AEGIS-WP-2026-001Whitepaperv1.0

Building Safe and Compliant Enterprise LLM Deployments

A Whitepaper on Governance, Verification, Security, and Operational Readiness for Applied AI

Authors: AEGIS Research Team, Yatav Inc.
Published: March 2026
Affiliation: AEGIS Research, Yatav Inc.
governancecomplianceenterprise AIsecurity hardeningmulti-tenantGS certificationEU AI ActK-AI ActNIST AI RMFRBACPIIfederated learningagent security

Summary

Deploying large language models (LLMs) in enterprise environments demands more than model accuracy — it requires a comprehensive framework addressing governance, security, regulatory compliance, and operational resilience. This whitepaper presents the AEGIS (AI Engine for Guardrail & Inspection System) platform's production-grade infrastructure for safe enterprise LLM deployments. Drawing from an implemented codebase comprising 1,591+ passing tests, 32 database migration schemas, 14 agent security modules, and compliance mappings across three regulatory frameworks (EU AI Act, K-AI Act, NIST AI RMF), we detail the architectural patterns, middleware stacks, and operational practices required for responsible AI deployment. The platform supports multi-tenant SaaS with four subscription tiers, Redis-backed rate limiting, comprehensive audit logging with 23 event types, and GS quality certification (ISO/IEC 25051). We demonstrate how defense-in-depth security — spanning JWT/API-key authentication, RBAC+ABAC authorization, PII pseudonymization, and federated learning — can be integrated into a cohesive deployment architecture that satisfies both technical and regulatory requirements.

1. Introduction

1.1 The Enterprise AI Deployment Challenge

The rapid adoption of large language models in enterprise settings has exposed a critical gap between model capabilities and deployment readiness. While significant research attention has focused on model alignment and safety benchmarking [1, 2], comparatively little guidance exists for the infrastructure required to deploy LLM-based systems safely in regulated industries.

Enterprise LLM deployments face multifaceted challenges:

  • Governance: Who controls what the model can do, and how are policies enforced?
  • Security: How are the system and its data protected from both external threats and adversarial inputs?
  • Compliance: How does the deployment satisfy regulatory requirements across jurisdictions?
  • Operations: How is the system monitored, scaled, and maintained in production?

1.2 Scope and Contributions

This whitepaper presents AEGIS v5.2's production infrastructure, providing a reference architecture for enterprise LLM safety deployments. Our contributions include:

  1. A layered governance framework with policy-as-code, comprehensive audit trails, and role-based access control supporting hierarchical role inheritance.
  2. Defense-in-depth security architecture comprising 8 middleware layers, 14 agent security modules, and format-preserving PII pseudonymization.
  3. Regulatory compliance automation with machine-readable mappings to EU AI Act, K-AI Act, and NIST AI RMF.
  4. Verification methodology validated through 1,591+ automated tests, GS quality certification (ISO/IEC 25051), and continuous integration practices.
  5. Production-grade operational infrastructure with Docker/Kubernetes orchestration, Prometheus/Grafana monitoring, and multi-tenant SaaS isolation.

All descriptions in this whitepaper are grounded in implemented, tested code rather than theoretical designs.

1.3 Paper Organization

Section 2 presents the governance framework. Sections 3--6 detail security from authentication through privacy protection. Section 7 addresses regulatory compliance. Section 8 covers verification and quality assurance. Sections 9--11 present operational readiness, multi-tenancy, and deployment infrastructure. Section 12 discusses lessons learned, and Section 13 concludes.

2. Governance Framework

2.1 Policy-as-Code Architecture

AEGIS implements governance through a policy-as-code paradigm where safety rules are expressed as structured, version-controlled configurations rather than ad-hoc code. The TAG (Threat Assessment Gateway) policy engine provides the foundational governance layer.

Table I: TAG Policy Configuration Structure

ComponentDescriptionImplementation
Category RulesPer-threat-category thresholds and actionsTagConfig with 10+ categories
Severity TiersCRITICAL/HIGH/MEDIUM/LOW with graduated responsesEnum-based severity mapping
Action TypesBLOCK, MODIFY, ESCALATE, APPROVE, REASK, THROTTLE6-action verdict taxonomy
Custom PatternsOrganization-specific detection patternsRegex + semantic pattern matching
Escalation PathsAutomatic routing for ambiguous casesConfigurable escalation chains

The policy engine supports domain-specific configurations. For example, a healthcare deployment can enforce HIPAA-specific rules:

TagConfig {
    category: ThreatCategory::PrivacyViolation,
    severity: Severity::Critical,
    action: VerdictAction::Block,
    patterns: vec!["patient_data", "medical_record", "diagnosis"],
    escalation: Some(EscalationPath::ComplianceOfficer),
    regulatory_refs: vec!["HIPAA §164.502", "EU_AI_Act_Art52"],
}

2.2 Audit Trail System

Comprehensive audit logging is implemented through 23 distinct event types covering every significant system interaction.

Table II: Audit Event Taxonomy

CategoryEvent TypesData Captured
AuthenticationUserLogin, UserLogout, TokenRefresh, ApiKeyCreated, ApiKeyRevokedUser ID, IP, timestamp, method
AuthorizationPermissionGranted, PermissionDenied, RoleChangedResource, action, role, outcome
Safety OperationsContentBlocked, ContentModified, ThreatDetected, EscalationTriggeredInput hash, verdict, confidence, tier
ConfigurationPolicyUpdated, ModelConfigChanged, ThresholdAdjustedBefore/after values, change author
SystemServiceStarted, ServiceStopped, HealthCheckFailed, RateLimitExceededService name, status, metrics
DataDataExported, DataDeleted, PiiDetected, PiiPseudonymizedData type, scope, method

Each audit event is structured with:

pub struct AuditEvent {
    pub id: Uuid,
    pub timestamp: DateTime<Utc>,
    pub event_type: AuditEventType,   // 23 variants
    pub actor: ActorInfo,              // user_id, role, ip_address
    pub resource: ResourceInfo,        // resource_type, resource_id
    pub action: ActionInfo,            // action_type, outcome, details
    pub metadata: serde_json::Value,   // extensible context
    pub tenant_id: Option<TenantId>,   // multi-tenant isolation
}

2.3 Verdict Explanation and Transparency

Every safety judgment produces a structured VerdictExplanation providing full transparency into the decision process:

Table III: VerdictExplanation Schema

FieldTypePurpose
decision_tierDecisionTierWhich tier (Rule/ML/Judge) made the decision
layer_explanationsPer-layer analysis results
pattern_matchesSpecific patterns that triggered
token_attributionsPer-token risk attribution
confidencef64Overall confidence score
regulatory_refsApplicable regulatory references
recommended_actionVerdictActionSystem recommendation

This structured explanation supports both human review and automated compliance reporting, satisfying the EU AI Act's transparency requirements (Article 13).

3. Authentication and Authorization

3.1 Dual Authentication System

AEGIS implements dual authentication supporting both interactive (JWT) and programmatic (API Key) access patterns.

JWT Authentication:

  • RS256 asymmetric signing for token integrity
  • Configurable expiration (default: 1 hour access, 7 days refresh)
  • Embedded claims: user_id, tenant_id, roles, permissions
  • Token refresh with rotation to prevent replay attacks

API Key Authentication:

  • SHA-256 hashed storage (plaintext never persisted)
  • Per-key scope restrictions (read-only, write, admin)
  • Rate limit binding per API key
  • Revocation with immediate effect across all nodes
┌─────────────────────────────────────────────────┐
│              Authentication Flow                 │
│                                                  │
│  Request ──► Extract Token/Key                   │
│              ├── JWT ──► Verify Signature         │
│              │          ├── Check Expiry          │
│              │          └── Extract Claims        │
│              └── API Key ──► Hash & Lookup        │
│                             ├── Check Scope       │
│                             └── Check Rate Limit  │
│              ▼                                    │
│         Authenticated Identity                    │
│              ▼                                    │
│         Authorization Check (RBAC + ABAC)         │
│              ▼                                    │
│         Request Processing                        │
└─────────────────────────────────────────────────┘

3.2 RBAC + ABAC Hybrid Authorization

Authorization combines Role-Based Access Control (RBAC) with Attribute-Based Access Control (ABAC) for fine-grained permission management.

Table IV: Role Hierarchy

RoleInherits FromKey Permissions
SuperAdminAll rolesSystem configuration, tenant management
TenantAdminAnalyst, OperatorTenant settings, user management, policy config
OperatorAnalystRun evaluations, modify configurations
AnalystViewerView reports, export data, run queries
Viewer---Read-only access to dashboards and results

ABAC Attributes extend RBAC with contextual checks:

AttributeTypeExample Policy
tenant_idIdentityUsers can only access their own tenant's data
ip_rangeNetworkAdmin access restricted to corporate VPN
time_windowTemporalDestructive operations only during maintenance windows
resource_sensitivityDataPII access requires explicit pii_reader permission
request_rateBehavioralBurst requests trigger additional verification

The permission boundary module (permission_boundary.rs, 639 lines) implements this hybrid model:

pub struct PermissionBoundary {
    role_permissions: HashMap<Role, HashSet<Permission>>,
    abac_policies: Vec<AbacPolicy>,
    inheritance_graph: RoleGraph,
}

impl PermissionBoundary {
    pub fn check_access(&self, actor: &Actor, resource: &Resource,
                        action: &Action, context: &Context) -> AccessDecision {
        // 1. RBAC: Check role-based permissions (with inheritance)
        let rbac_result = self.check_rbac(actor, resource, action);
        // 2. ABAC: Apply attribute-based constraints
        let abac_result = self.check_abac(actor, resource, action, context);
        // 3. Combine: Both must permit (conjunction)
        AccessDecision::combine(rbac_result, abac_result)
    }
}

4. Security Hardening

4.1 Middleware Security Stack

AEGIS deploys an 8-layer middleware stack where every request passes through multiple security checks before reaching application logic.

Table V: Middleware Stack (Execution Order)

LayerModuleFunctionOverhead
1security_headersCSP, HSTS, X-Frame-Options, X-Content-Type
2rate_limitRedis sliding window, per-tenant quotas
3authJWT/API Key validation, identity extraction
4rbac_checkRole + attribute authorization
5input_validationSQL injection, XSS, path traversal detection
6request_loggingStructured request/response audit logging
7sensitive_scrubScrub PII/secrets from logs and responses
8error_handlerSanitized error responses (no stack traces)
TotalEnd-to-end middleware overhead

4.2 Input Validation and Injection Prevention

The security middleware implements pattern-based detection for common injection attacks:

SQL Injection Detection:

  • Pattern matching for UNION SELECT, DROP TABLE, '; --, OR 1=1
  • Parameterized query enforcement at the ORM layer
  • Prepared statement validation for dynamic queries

XSS Prevention:

  • Script tag detection (<script>, javascript:, on*= event handlers)
  • Content-Security-Policy headers restricting inline scripts
  • Output encoding for all user-supplied content in responses

Path Traversal Protection:

  • Rejection of ../, ..\\, encoded variants (%2e%2e)
  • Canonicalization of all file paths before access
  • Chroot-style containment for file operations

4.3 Sensitive Data Scrubbing

A dedicated scrubbing layer ensures sensitive information never leaks through logs or error responses:

pub struct SensitiveDataScrubber {
    patterns: Vec<ScrubPattern>,
}

impl SensitiveDataScrubber {
    pub fn scrub(&self, content: &str) -> String {
        // Patterns include:
        // - Credit card numbers (Luhn-validated)
        // - Social security numbers
        // - API keys and tokens (Bearer, sk-*, etc.)
        // - Email addresses in error contexts
        // - IP addresses in non-audit contexts
        self.patterns.iter().fold(
            content.to_string(),
            |acc, pattern| pattern.apply(&acc)
        )
    }
}

4.4 Security Headers

Table VI: Deployed Security Headers

HeaderValuePurpose
Content-Security-PolicyPrevent XSS via inline scripts
Strict-Transport-Securitymax-age=31536000; includeSubDomainsEnforce HTTPS
X-Frame-OptionsDENYPrevent clickjacking
X-Content-Type-OptionsnosniffPrevent MIME sniffing
X-XSS-Protection1; mode=blockBrowser XSS filter
Referrer-Policystrict-origin-when-cross-originControl referrer leakage
Permissions-PolicyRestrict browser APIs

4.5 Security Audit Classification

All security fixes follow a priority classification system:

Table VII: Security Fix Priority Classification

PriorityCriteriaSLAExamples
P0 --- CriticalExploitable vulnerability, data exposure riskImmediateMissing auth on endpoints, SQL injection
P1 --- HighSecurity weakness, defense gap24 hoursMissing rate limiting, weak input validation
P2 --- MediumHardening opportunity, best practice gap1 weekMissing security headers, log scrubbing
P3 --- LowCode quality, defense-in-depth improvement1 monthError message verbosity, unused imports

5. Agent Security Architecture

5.1 The Agent Security Challenge

LLM-powered agents that interact with external tools, APIs, and data sources introduce attack surfaces beyond traditional prompt injection. AEGIS addresses this with 14 specialized agent security modules.

5.2 Agent Security Module Inventory

Table VIII: 14 Agent Security Modules

#ModuleThreat AddressedDetection Method
1direct_prompt_injection (DPI)Direct adversarial promptsPattern + ML classifier
2indirect_prompt_injection (IPI)Hidden instructions in retrieved dataContext boundary analysis
3stochastic_attack (STAC)Probabilistic jailbreak attemptsStatistical distribution analysis
4memory_poisoningCorrupted conversation memoryMemory integrity verification
5reasoning_manipulationChain-of-thought exploitationReasoning consistency checks
6tool_disguiseMalicious tools masquerading as benignTool signature verification
7supply_chainCompromised model weights or dataProvenance chain validation
8credential_guardCredential leakage through promptsSecret pattern detection
9autonomy_controlUnauthorized autonomous actionsAction boundary enforcement
10token_monitorToken budget exhaustion attacksUsage tracking and limits
11tool_chain_anomalyUnusual tool invocation sequencesSequence anomaly detection
12permission_boundaryPrivilege escalation attemptsRBAC+ABAC enforcement
13mcp_trustUntrusted MCP server connectionsTrust score evaluation
14credential_guard (enhanced)Runtime credential exposureReal-time scanning

5.3 Tool Chain Anomaly Detection

The tool chain anomaly detector monitors sequences of tool invocations for suspicious patterns:

Normal:  search → read → summarize → respond
Anomaly: search → execute_code → read_credentials → send_email
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         Unusual tool sequence: execution + credential access + exfiltration

Detection uses a Markov chain model of expected tool transition probabilities, flagging sequences with cumulative surprise exceeding a configurable threshold.

5.4 MCP Trust Evaluation

The Model Context Protocol (MCP) trust module evaluates external server connections:

Trust FactorWeightAssessment
Server identity verification0.30TLS certificate, domain reputation
Historical behavior0.25Past interaction success rate
Capability declarations0.20Scope of requested permissions
Data handling policy0.15Privacy policy compliance
Community reputation0.10Registry ratings, audit history

Connections below the trust threshold (default: 0.7) are blocked with detailed explanations logged for audit.

6. Privacy and Data Protection

6.1 PII Proxy Engine

The PII Proxy Engine provides format-preserving pseudonymization for 7 personally identifiable information types.

Table IX: PII Types and Pseudonymization Strategies

PII TypeDetection PatternPseudonymization MethodFormat Preserved
Credit CardLuhn-valid 16-digitRandom Luhn-valid number
Phone NumberInternational formatsPrefix-preserving random
EmailRFC 5322 patternDomain-preserving hash
SSN/IDCountry-specific formatsFormat-preserving encryption
NameNER + pattern matchingConsistent pseudonym mapping
AddressStructured address parsingLocality-preserving transform
Date of BirthDate format detectionAge-bracket preserving shift

Key properties of the pseudonymization engine:

  • Session isolation: Each session maintains independent pseudonym mappings
  • Consistency: The same real value always maps to the same pseudonym within a session
  • Reversibility: Authorized users can restore original values via restore() API
  • Auto/Confirm modes: Automatic pseudonymization or user-confirmed replacement
  • DOM integration: MutationObserver + TreeWalker for real-time response pseudonymization

6.2 Federated Learning Infrastructure

For organizations requiring model improvement without data centralization, AEGIS provides three federated learning strategies:

Table X: Federated Learning Strategies

StrategyModulePrivacy GuaranteeCommunication Cost
FedAvgfed_avg.rsData locality (no raw data shared)
Secure Aggregationsecure_aggregation.rsCryptographic (no individual updates visible)
Differential Privacydifferential_privacy.rs

The DP-SGD implementation clips per-sample gradients and adds calibrated Gaussian noise:

θ_{t+1} = θ_t - η · (1/B) · Σ_i [clip(∇L_i, C) + N(0, σ²C²I)]

where C is the clipping bound and σ is calibrated to achieve the target (ε, δ) privacy budget per the moments accountant.

6.3 Embedding Scanner

The embedding scanner detects PII leakage in vector representations using:

  • Cosine similarity search: Identifying embeddings suspiciously close to known PII representations
  • LSH-based approximate nearest neighbor: Scalable detection across large embedding stores
  • Canary token injection: Planted synthetic PII to verify pipeline integrity

7. Regulatory Compliance

7.1 Multi-Framework Compliance Engine

The regulatory reporting module (regulatory_report.rs, 620 lines) generates compliance assessments against four regulatory frameworks simultaneously.

Table XI: Regulatory Framework Coverage

FrameworkArticles/Functions MappedKey RequirementsAEGIS Coverage
EU AI ActArticles 6, 9, 13, 14, 52, 71Risk classification, transparency, human oversightFull
K-AI ActArticles 4, 7, 10, 15Safety standards, impact assessment, accountabilityFull
NIST AI RMFGovern, Map, Measure, ManageRisk identification, assessment, mitigation, monitoringFull
ISO/IEC 25051Sections 5--9Software quality, documentation, testingGS Certified

7.2 EU AI Act Compliance Mapping

Table XII: EU AI Act Article Mapping

ArticleRequirementAEGIS Implementation
Art. 6Risk-based classificationThreat taxonomy with CVSS-like AI severity scoring
Art. 9Risk management systemSABER statistical risk framework, continuous monitoring
Art. 13TransparencyVerdictExplanation schema, per-layer audit trails
Art. 14Human oversightESCALATE verdict, manual review queues, override capability
Art. 52Transparency obligationsAI-generated content marking, interaction disclosure
Art. 71Penalties frameworkSeverity-based response (BLOCK/MODIFY/THROTTLE)

7.3 K-AI Act Compliance

ArticleRequirementAEGIS Implementation
Art. 4Safety and reliability standards3-Tier defense pipeline, 1,591+ tests, GS certification
Art. 7Impact assessment
Art. 10Accountability and transparency23-type audit logging, verdict explanations
Art. 15User protectionPII pseudonymization, rate limiting, content filtering

7.4 NIST AI RMF Mapping

FunctionSub-functionAEGIS Implementation
GovernPolicies, roles, accountabilityTAG policy engine, RBAC+ABAC, audit trails
MapContext, risk identificationThreat taxonomy (OWASP Top 10), attack vector catalog
MeasureAssessment, metrics
ManageMitigation, monitoring, response3-Tier defense, Prometheus metrics, auto-escalation

7.5 Automated Compliance Reporting

The system generates structured compliance reports:

pub struct RegulatoryReport {
    pub framework: RegulatoryFramework,
    pub assessment_date: DateTime<Utc>,
    pub overall_compliance: ComplianceLevel,  // Full, Partial, NonCompliant
    pub article_assessments: Vec<ArticleAssessment>,
    pub gaps: Vec<ComplianceGap>,
    pub recommendations: Vec<Recommendation>,
    pub evidence_refs: Vec<EvidenceReference>,  // Links to audit logs, test results
}

8. Verification and Quality Assurance

8.1 Test Coverage

AEGIS maintains comprehensive automated testing across all components:

Table XIII: Test Suite Summary

ComponentTest CountCoverage Focus
aegis-defense944 unit + 43 integrationAll defense algorithms, Korean/multilingual modules
aegis-core28Core data structures, verdict logic
aegis-ml83ML inference, embedding scanner, federated learning
aegis-redteam146All 8 attack algorithms, meta-attack generator
Chrome Extension28 (Vitest)PII proxy engine, detection layers
API Integration150+Endpoint validation, auth flows, error handling
Total1,591+Full-stack coverage

8.2 GS Quality Certification

AEGIS has achieved GS (Good Software) certification under ISO/IEC 25051, validated through 9 certification documents:

Table XIV: GS Certification Document Suite

DocumentStandard ReferenceContent
Product DescriptionProduct scope, target users, operating environment
Functional SpecificationAll functional requirements with traceability
Test DocumentationTest plans, cases, results, coverage analysis
User DocumentationInstallation, configuration, operation guides
Quality RequirementsISO/IEC 25010Functionality, reliability, usability, efficiency, maintainability, portability
Installation GuideStep-by-step deployment procedures
API ReferenceOpenAPI 3.0Complete REST API documentation
Security AssessmentInternalPenetration test results, vulnerability remediation
Performance ReportInternalLoad testing, latency benchmarks, scalability analysis

8.3 Continuous Integration Pipeline

┌──────────┐    ┌──────────┐    ┌──────────┐    ┌──────────┐    ┌──────────┐
│  Commit  │───►│  Lint +  │───►│  Build   │───►│  Test    │───►│  Deploy  │
│  Push    │    │  Format  │    │  (Cargo) │    │  1,591+  │    │  Staging │
└──────────┘    └──────────┘    └──────────┘    └──────────┘    └──────────┘
                 rustfmt          cargo build     cargo test      docker-
                 clippy           --release       --all           compose up

8.4 Security Testing

  • Static Analysis: Clippy lints with #![deny(clippy::all)], custom security lint rules
  • Dependency Audit: cargo audit integrated into CI pipeline
  • Input Fuzzing: Property-based testing with proptest for parser modules
  • Penetration Testing: Manual and automated security assessment per GS certification

9. Operational Readiness

9.1 Health Check System

AEGIS implements three-tier health checking for Kubernetes-compatible orchestration:

Table XV: Health Check Endpoints

EndpointPurposeChecks PerformedUse Case
/healthGeneral healthService version, uptimeHuman monitoring
/health/liveLiveness probeProcess alive, memory OKK8s liveness probe
/health/readyReadiness probeDB connected, Redis connected, models loadedK8s readiness probe

9.2 Prometheus Metrics

12 metric types are exported for comprehensive observability:

Table XVI: Prometheus Metric Types

MetricTypeDescription
aegis_requests_totalCounterTotal requests by endpoint, method, status
aegis_request_duration_secondsHistogramRequest latency distribution (P50, P95, P99)
aegis_active_connectionsGaugeCurrent active connections
aegis_verdict_totalCounterVerdicts by type (APPROVE/BLOCK/MODIFY/...)
aegis_tier_latency_secondsHistogramPer-tier processing latency
aegis_threat_detected_totalCounterThreats by category and severity
aegis_model_inference_secondsHistogramML model inference time
aegis_cache_hits_totalCounterRedis cache hit/miss ratio
aegis_rate_limit_exceeded_totalCounterRate limit violations by tenant
aegis_pii_detected_totalCounterPII detections by type
aegis_audit_events_totalCounterAudit events by type
aegis_system_memory_bytesGaugeProcess memory usage

9.3 Alerting Configuration

AlertConditionSeverityResponse
High Error RateCriticalPage on-call
Latency SpikeWarningInvestigate
Memory PressureWarningScale up
Threat SurgeCriticalSecurity review
Auth FailuresCriticalPotential brute force

9.4 Fail-Safe Policies

When components fail, AEGIS defaults to safe behavior:

Component FailureDefault BehaviorRationale
ML Classifier unavailableEscalate to LLM JudgeMaintain safety with higher-tier review
LLM Judge unavailableApply conservative rule-based blockingPrefer false positives over false negatives
Redis unavailableIn-memory rate limiting with conservative limitsMaintain protection with degraded capacity
Database unavailableRead-only mode from cachePreserve existing configurations
All tiers unavailableBlock all non-whitelisted requestsFail-closed for safety

10. Multi-Tenant SaaS Architecture

10.1 Tenant Isolation Model

AEGIS supports multi-tenant deployment with strict data isolation:

┌────────────────────────────────────────────────┐
│                  API Gateway                    │
│          (Tenant ID extraction + routing)       │
├────────────────────────────────────────────────┤
│  Tenant A    │  Tenant B    │  Tenant C        │
│  ┌────────┐  │  ┌────────┐  │  ┌────────┐     │
│  │ Config │  │  │ Config │  │  │ Config │     │
│  │ Policies│  │  │ Policies│  │  │ Policies│   │
│  │ Quotas │  │  │ Quotas │  │  │ Quotas │     │
│  └────────┘  │  └────────┘  │  └────────┘     │
├────────────────────────────────────────────────┤
│           Shared Infrastructure                 │
│  (PostgreSQL with row-level security,           │
│   Redis with key prefixing)                     │
└────────────────────────────────────────────────┘

10.2 Subscription Tiers

Table XVII: SaaS Subscription Tiers

TierRate LimitFeaturesTarget
Free100 req/hrBasic safety check (Tier 1 only)Evaluation
Starter1,000 req/hrTier 1 + 2, basic audit logsSmall teams
Professional10,000 req/hrAll 3 tiers, full audit, compliance reportsEnterprise
EnterpriseCustomCustom policies, dedicated resources, SLALarge org

Feature gating is implemented at the middleware level:

pub fn check_feature_access(tenant: &Tenant, feature: Feature) -> bool {
    match (tenant.plan, feature) {
        (Plan::Free, Feature::LlmJudge) => false,
        (Plan::Free, Feature::ComplianceReport) => false,
        (Plan::Starter, Feature::ComplianceReport) => false,
        (Plan::Enterprise, _) => true,
        _ => tenant.plan.includes(feature),
    }
}

10.3 Rate Limiting

Redis-backed sliding window rate limiting with per-tenant quotas:

  • Algorithm: Sliding window log (precise, no boundary issues)
  • Granularity: Per-tenant, per-API-key, per-endpoint
  • Headers: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
  • Burst allowance: 2x sustained rate for 10-second windows
  • Graceful degradation: Falls back to in-memory counting if Redis is unavailable

11. Deployment Infrastructure

11.1 Docker Composition

Table XVIII: Service Architecture

ServiceImagePortRole
aegis-apiCustom (Rust)8000API Gateway + middleware
aegis-mlCustom (Rust + ONNX)8081ML inference service
aegis-redteamCustom (Rust)8082Red team evaluation service
aegis-vlaCustom (Rust)8083VLA (Vision-Language-Action) service
postgresPostgreSQL 165432Primary database
redisRedis 76379Cache, rate limiting, sessions
prometheusPrometheus9090Metrics collection
grafanaGrafana3000Visualization dashboards
alertmanagerAlertmanager9093Alert routing

11.2 Database Schema

32 SQL migration files manage the database schema evolution:

Schema AreaTablesPurpose
Coretenants, users, api_keysIdentity management
Safetyverdicts, threat_events, escalationsSafety operation records
Configpolicies, thresholds, model_configsSystem configuration
Auditaudit_events, access_logsCompliance audit trail
Billingsubscriptions, usage_records, invoicesSaaS billing
RedTeamevaluations, attack_results, saber_reportsRed team assessment data

11.3 Kubernetes Deployment Considerations

  • Horizontal Pod Autoscaling: Based on CPU utilization and request queue depth
  • Pod Disruption Budgets: Minimum 2 replicas for API and ML services
  • Network Policies: Strict inter-service communication rules
  • Secret Management: Kubernetes secrets with optional HashiCorp Vault integration
  • Rolling Updates: Zero-downtime deployments with readiness probe gating

12. Discussion and Lessons Learned

12.1 Defense-in-Depth is Non-Negotiable

Our experience deploying AEGIS across multiple environments confirms that no single security measure is sufficient. The combination of network-level controls (security headers, rate limiting), application-level checks (auth, input validation), and AI-specific safeguards (agent security modules, SABER risk analysis) creates overlapping protection zones where a failure in one layer is caught by another.

12.2 Compliance as Code

Treating regulatory requirements as machine-readable artifacts rather than static documents enables continuous compliance monitoring. Our automated compliance reporting has reduced audit preparation time by an estimated 70% compared to manual documentation approaches.

12.3 The Multi-Tenant Challenge

Achieving true tenant isolation while maintaining resource efficiency requires careful architectural decisions:

  • Row-level security in PostgreSQL provides strong data isolation without per-tenant database overhead
  • Redis key prefixing enables shared infrastructure with logical separation
  • Feature gating at middleware prevents unauthorized access to tier-restricted features

12.4 Operational Observability

The 12 Prometheus metric types and 23 audit event types provide comprehensive visibility, but volume management is critical. Key practices:

  • Structured logging (JSON format) enables efficient log analysis
  • Metric cardinality control prevents Prometheus storage explosion
  • Audit log retention policies balance compliance requirements with storage costs

12.5 Security Hardening Prioritization

The P0/P1/P2/P3 priority classification (Table VII) proved essential for systematic security improvement. In our most recent security audit:

  • P0 fixes: Authentication enforcement on previously unprotected endpoints
  • P1 fixes: Rate limiting, input validation strengthening
  • P2 fixes: Security header deployment, sensitive data scrubbing

12.6 Agent Security is an Emerging Frontier

The 14 agent security modules represent one of the most novel aspects of AEGIS. As LLM agents gain autonomy --- executing tools, managing memory, making decisions --- the attack surface expands dramatically. Our modular approach allows new threat detectors to be added without architectural changes.

13. Conclusion

This whitepaper has presented AEGIS's comprehensive approach to enterprise LLM deployment safety, covering governance, security, compliance, and operational readiness. Key takeaways:

  1. Governance requires structure: Policy-as-code, structured audit trails, and transparent verdict explanations are foundational for responsible AI deployment.

  2. Security must be layered: The 8-layer middleware stack, 14 agent security modules, and PII pseudonymization engine provide defense-in-depth against both traditional and AI-specific threats.

  3. Compliance can be automated: Machine-readable regulatory mappings across EU AI Act, K-AI Act, and NIST AI RMF enable continuous compliance monitoring rather than periodic manual audits.

  4. Verification must be comprehensive: 1,591+ automated tests, GS quality certification, and structured CI/CD pipelines ensure that safety properties are maintained through development and deployment.

  5. Operations need observability: 12 Prometheus metric types, 3-tier health checks, and fail-safe policies enable reliable production operation with rapid incident response.

The AEGIS platform demonstrates that safe enterprise LLM deployment is achievable with deliberate architectural choices, rigorous testing, and continuous monitoring. As the regulatory landscape for AI continues to evolve, platforms that embed compliance into their architecture --- rather than treating it as an afterthought --- will be best positioned to meet emerging requirements.

References

[1] J. Wei et al., "Jailbroken: How does LLM safety training fail?" NeurIPS, 2023.

[2] A. Zou et al., "Universal and transferable adversarial attacks on aligned language models," arXiv:2307.15043, 2023.

[3] European Parliament, "Regulation (EU) 2024/1689 --- Artificial Intelligence Act," Official Journal of the European Union, 2024.

[4] National Institute of Standards and Technology, "AI Risk Management Framework (AI RMF 1.0)," NIST AI 100-1, 2023.

[5] 과학기술정보통신부, "인공지능 산업 육성 및 신뢰 기반 조성 등에 관한 법률 (K-AI Act)," 2025.

[6] OWASP Foundation, "OWASP Top 10 for LLM Applications," v1.1, 2023.

[7] ISO/IEC, "ISO/IEC 25051:2014 --- Software engineering --- Systems and software Quality Requirements and Evaluation (SQuaRE)," 2014.

[8] M. Abadi et al., "Deep learning with differential privacy," ACM CCS, 2016.

[9] B. McMahan et al., "Communication-efficient learning of deep networks from decentralized data," AISTATS, 2017.

[10] K. Bonawitz et al., "Practical secure aggregation for privacy-preserving machine learning," ACM CCS, 2017.

[11] A. Narayanan and V. Shmatikov, "Robust de-anonymization of large sparse datasets," IEEE S&P, 2008.

[12] NIST, "NIST Special Publication 800-53: Security and Privacy Controls," Rev. 5, 2020.

[13] S. Yao et al., "Tree of attacks: Jailbreaking black-box LLMs with auto-generated subtrees," arXiv:2312.02119, 2023.

[14] C. Dwork and A. Roth, "The algorithmic foundations of differential privacy," Foundations and Trends in Theoretical Computer Science, 2014.

[15] R. Shokri et al., "Membership inference attacks against machine learning models," IEEE S&P, 2017.

[16] F. Tramer et al., "Stealing machine learning models via prediction APIs," USENIX Security, 2016.

[17] P. Kairouz et al., "Advances and open problems in federated learning," Foundations and Trends in ML, 2021.

[18] N. Carlini et al., "Extracting training data from large language models," USENIX Security, 2021.

[19] M. Fredrikson et al., "Model inversion attacks that exploit confidence information," ACM CCS, 2015.

[20] TI-DSA, "GS인증 품질기준 --- 소프트웨어 품질인증 기준," 한국정보통신기술협회, 2023.

Assets & Downloads

Executive SummaryComing Soon
Slide DeckComing Soon
Demo VideoComing Soon

Interested in applying this research?

Contact the AEGIS Research team to learn how this work can support your AI deployment needs.