graph TD
    subgraph SecurityModel["Security Model - Llama Stack Distribution"]
        direction TB

        subgraph NoRBAC["No RBAC Resources Defined"]
            Note1["This component is a stateless<br/>container service, not a<br/>Kubernetes operator"]
            Note2["Runs as non-root user<br/>(CNB_USER_ID)"]
            Note3["No Kubernetes API access<br/>(except LM Eval use_k8s=true)"]
        end

        subgraph AuthDelegation["Authentication Delegation"]
            direction TB
            AllEndpoints["/v1/* (all endpoints)<br/>Methods: GET, POST<br/>Auth: None (built-in)"]

            AllEndpoints -->|"delegated to"| Enforcement

            subgraph Enforcement["Enforcement Options (Deploying Operator)"]
                direction LR
                KRBAC["kube-rbac-proxy<br/>sidecar container"]
                NetPol["NetworkPolicy<br/>restricting access"]
                Mesh["Service Mesh<br/>mTLS"]
                OAuthProxy["OpenShift Route<br/>+ OAuth Proxy"]
            end
        end

        subgraph Secrets["Secrets Management"]
            direction TB
            subgraph BuildSecrets["Build-Time Secrets"]
                BOT_PAT["BOT_PAT<br/>GitLab wheel registry<br/>Provisioned: Manual/Konflux"]
                GitAuth["git_auth_secret<br/>Tekton pipeline source<br/>Provisioned: Konflux/PaC"]
            end

            subgraph RuntimeSecrets["Runtime Secrets (env vars)"]
                direction LR
                InferenceKeys["VLLM_API_TOKEN<br/>AWS_BEARER_TOKEN_BEDROCK<br/>WATSONX_API_KEY<br/>AZURE_API_KEY<br/>OPENAI_API_KEY"]
                VectorKeys["MILVUS_TOKEN<br/>QDRANT_API_KEY<br/>POSTGRES_PASSWORD"]
                ToolKeys["BRAVE_SEARCH_API_KEY<br/>TAVILY_SEARCH_API_KEY<br/>KUBEFLOW_PIPELINES_TOKEN"]
                StorageKeys["AWS_ACCESS_KEY_ID<br/>AWS_SECRET_ACCESS_KEY"]
            end
        end

        subgraph TLSConfig["TLS & Certificate Configuration"]
            direction LR
            SystemTrust["System Trust Store<br/>(UBI9 ca-certificates)"]
            FMSCert["FMS_SSL_CERT_PATH<br/>TrustyAI custom cert"]
            MilvusCerts["MILVUS_CA_PEM_PATH<br/>MILVUS_CLIENT_PEM_PATH<br/>mTLS client certs"]
        end
    end

    style Note1 fill:#fff2cc,stroke:#d6b656
    style Note2 fill:#fff2cc,stroke:#d6b656
    style Note3 fill:#fff2cc,stroke:#d6b656
    style AllEndpoints fill:#f8cecc,stroke:#b85450
    style KRBAC fill:#d5e8d4,stroke:#82b366
    style NetPol fill:#d5e8d4,stroke:#82b366
    style Mesh fill:#d5e8d4,stroke:#82b366
    style OAuthProxy fill:#d5e8d4,stroke:#82b366
    style BOT_PAT fill:#e1d5e7,stroke:#9673a6
    style GitAuth fill:#e1d5e7,stroke:#9673a6
    style InferenceKeys fill:#dae8fc,stroke:#6c8ebf
    style VectorKeys fill:#dae8fc,stroke:#6c8ebf
    style ToolKeys fill:#dae8fc,stroke:#6c8ebf
    style StorageKeys fill:#dae8fc,stroke:#6c8ebf
    style SystemTrust fill:#d5e8d4,stroke:#82b366
    style FMSCert fill:#d5e8d4,stroke:#82b366
    style MilvusCerts fill:#d5e8d4,stroke:#82b366
