v1.4

Security Model

Defense-in-depth security from network edge to model inference.

Security Architecture

FowyldAI implements multiple security layers. Each layer operates independently — a failure in one does not compromise others.

LayerMechanismDefault
NetworkBuilt-in network guard blocks all outbound trafficEnabled
TransportTLS 1.3 with optional mTLS for API authenticationConfigurable
AuthenticationAPI key with scoped permissionsDisabled (local)
AuthorizationPer-key scope restrictions (ask, models, health, admin)All scopes
InputRequest validation, size limits, injection filteringEnabled
InferenceSandboxed model execution, memory isolationEnabled
AuditStructured local logging of all API interactionsEnabled

Authentication

API key authentication is optional for local deployments and recommended for production.

security:
  api_key_required: true
  api_keys:
    - name: "app-backend"
      key: "fai_xxxxxxxxxxxxxxxxxxxx"
      scopes: ["ask", "models", "embeddings"]
    - name: "monitoring"
      key: "fai_yyyyyyyyyyyyyyyyyyyy"
      scopes: ["health"]

Keys are validated on every request. Scopes restrict which endpoints each key can access.

Transport Security

Enable TLS for encrypted communication. For mutual TLS (mTLS), provide a CA certificate:

tls:
  enabled: true
  cert_path: "/app/certs/server.pem"
  key_path: "/app/certs/server-key.pem"
  mtls:
    enabled: true
    ca_path: "/app/certs/ca.pem"
Production recommendation Always enable TLS in production, even on internal networks. Use mTLS when FowyldAI is accessed by automated services.

Input Validation

All incoming requests are validated before reaching the inference engine:

Inference Isolation

Models execute in sandboxed processes with:

Audit Logging

Every API interaction is logged locally with structured metadata:

{
  "timestamp": "2026-04-23T10:15:00Z",
  "event": "api_request",
  "endpoint": "/ask",
  "method": "POST",
  "api_key_name": "app-backend",
  "tokens_in": 45,
  "tokens_out": 312,
  "model": "fowyld-general",
  "latency_ms": 1180,
  "status": 200
}

Logs are written to /app/logs/audit.jsonl and never sent externally.

Security Checklist

ItemLocal DevProduction
API key authenticationOptionalRequired
TLS encryptionOptionalRequired
Rate limitingOptionalRecommended
Network guardEnabledEnabled
Audit loggingEnabledEnabled
Docker --network noneOptionalRecommended