---
config:
  layout: elk
  elk:
    mergeEdges: True
    nodePlacementStrategy: NETWORK_SIMPLEX
---

graph LR
   %%{init: {'flowchart': {'nodeSpacing': 25, 'rankSpacing': 150, 'padding': 5, 'wrappingWidth': 250}}}%%
    classDef hidden display: none;
    classDef allControl stroke:#4285f4,stroke-width:2px,stroke-dasharray: 5 5

    subgraph controls
    subgraph controlsData ["Data Controls"]
        controlModelPrivacyEnhancingTechnologies[Privacy Enhancing Technologies for Model Training]
        controlRetrievalAndVectorSystemIntegrity[Retrieval and Vector System Integrity Management]
        controlRuntimePrivacyEnhancingTechnologies[Privacy Enhancing Technologies for Inference]
        controlTrainingDataManagement[Training Data Management]
        controlTrainingDataSanitization[Training Data Sanitization]
        controlUserDataManagement[User Data Management]
    end

    subgraph controlsInfrastructure ["Infrastructure Controls"]
        controlComponentIdentityProvenance[Component Identity Provenance]
        controlInterComponentTransportSecurity[Inter-Component Transport Security]
        controlIsolatedConfidentialComputing[Isolated and Confidential Computing]
        controlModelAndDataAccessControls[Model and Data Access Controls]
        controlModelAndDataExecutionIntegrity[Model and Data Execution Integrity]
        controlModelAndDataIntegrityManagement[Model and Data Integrity Management]
        controlModelAndDataInventoryManagement[Model and Data Inventory Management]
        controlOrchestratorAndRouteIntegrity[Orchestrator and Route Integrity]
        controlSecureByDefaultMLTooling[Secure-by-Default ML Tooling]
    end

    subgraph controlsModel ["Model Controls"]
        controlAdversarialTrainingAndTesting[Adversarial Training and Testing]
        controlInputValidationAndSanitization[Input Validation and Sanitization]
        controlOutputValidationAndSanitization[Output Validation and Sanitization]
    end

    subgraph controlsApplication ["Application Controls"]
        controlAgentCredentialIsolation[Agent Credential Isolation]
        controlAgentExecutionBounds[Agent Execution Bounds]
        controlAgentIntegrityManagement[Agent Integrity Management]
        controlAgentInventoryManagement[Agent Inventory Management]
        controlAgentObservability[Agent Observability]
        controlAgentPluginPermissions[Agent Permissions]
        controlAgentPluginUserControl[Agent User Control]
        controlApplicationAccessManagement[Application Access and Resource Management]
        controlUserTransparencyAndControls[User Transparency and Controls]
    end

    subgraph controlsAssurance ["Assurance Controls"]
        controlIncidentResponseManagement[Incident Response Management]
        controlRedTeaming[Red Teaming]
        controlThreatDetection[Threat Detection]
        controlVulnerabilityManagement[Vulnerability Management]
    end

    subgraph controlsGovernance ["Governance Controls"]
        direction LR
        controlInternalPoliciesAndEducation[Internal Policies and Education]
        controlProductGovernance[Product Governance]
        controlRiskGovernance[Risk Governance]
        controlUserPoliciesAndEducation[User Policies and Education]
    end

    end

    subgraph components
    subgraph componentsInfrastructure ["Infrastructure Components"]
        componentDataFilteringAndProcessing[Data Filtering and Processing]
        componentDataSources[Data Sources]
        componentDataStorage[Data Storage Infrastructure]
        componentTrainingData[Training Data]
        subgraph componentsModels ["Models"]
            componentModelServing[Model Serving Infrastructure]
            componentModelStorage[Model Storage]
        end
    end

    subgraph componentsModel ["Model Components"]
        componentModelFrameworksAndCode[Model Frameworks and Code]
        componentRAGContent[Retrieval Augmented Generation & Content]
        componentTheModel[The Model]
        subgraph componentsModelSubgroup ["Model Subgroup"]
            componentModelEvaluation[Model Evaluation]
            componentModelTrainingTuning[Training and Tuning]
        end
        subgraph componentsSubgroup4 ["Subgroup4"]
            componentMemory[Model Memory]
            componentOrchestrationInputHandling[Input Handling]
            componentOrchestrationOutputHandling[Output Handling]
            componentTools[External Tools and Services]
        end
    end

    subgraph componentsApplication ["Application Components"]
        componentAgentInputHandling[Input Handling]
        componentAgentOutputHandling[Output Handling]
        componentAgentSystemInstruction[Agent System Instructions]
        componentAgentUserQuery[Agent User Query]
        componentApplication[Application]
        componentApplicationInputHandling[Input Handling]
        componentApplicationOutputHandling[Output Handling]
        componentReasoningCore[Agent Reasoning Core]
    end

    end

    %% Control to Component relationships
    controlModelPrivacyEnhancingTechnologies --> componentsModelSubgroup
    controlRuntimePrivacyEnhancingTechnologies --> componentModelServing
    controlTrainingDataManagement --> componentDataSources
    controlTrainingDataManagement --> componentTrainingData
    controlTrainingDataManagement --> componentsModelSubgroup
    controlTrainingDataSanitization --> componentDataFilteringAndProcessing
    controlUserDataManagement --> componentDataStorage
    controlModelAndDataInventoryManagement --> componentsModelSubgroup
    controlModelAndDataInventoryManagement --> componentsModels
    controlModelAndDataAccessControls --> componentsModelSubgroup
    controlModelAndDataAccessControls --> componentsModels
    controlModelAndDataIntegrityManagement --> componentsModelSubgroup
    controlModelAndDataIntegrityManagement --> componentsModels
    controlModelAndDataExecutionIntegrity --> componentTheModel
    controlModelAndDataExecutionIntegrity --> componentsModels
    controlSecureByDefaultMLTooling --> componentsModelSubgroup
    controlSecureByDefaultMLTooling --> componentsModels
    controlInputValidationAndSanitization --> componentAgentInputHandling
    controlInputValidationAndSanitization --> componentOrchestrationInputHandling
    controlOutputValidationAndSanitization --> componentAgentOutputHandling
    controlOutputValidationAndSanitization --> componentOrchestrationOutputHandling
    controlAdversarialTrainingAndTesting --> componentTheModel
    controlApplicationAccessManagement --> componentApplication
    controlUserTransparencyAndControls --> componentApplication
    controlAgentPluginUserControl --> componentReasoningCore
    controlAgentPluginPermissions --> componentMemory
    controlAgentPluginPermissions --> componentRAGContent
    controlAgentPluginPermissions --> componentReasoningCore
    controlAgentPluginPermissions --> componentTools
    controlRedTeaming -.-> components
    controlVulnerabilityManagement -.-> components
    controlThreatDetection -.-> components
    controlIncidentResponseManagement -.-> components
    controlAgentObservability --> componentAgentInputHandling
    controlAgentObservability --> componentAgentOutputHandling
    controlAgentObservability --> componentOrchestrationInputHandling
    controlAgentObservability --> componentOrchestrationOutputHandling
    controlAgentObservability --> componentReasoningCore
    controlIsolatedConfidentialComputing --> componentMemory
    controlIsolatedConfidentialComputing --> componentModelServing
    controlIsolatedConfidentialComputing --> componentModelTrainingTuning
    controlIsolatedConfidentialComputing --> componentReasoningCore
    controlRetrievalAndVectorSystemIntegrity --> componentDataFilteringAndProcessing
    controlRetrievalAndVectorSystemIntegrity --> componentDataSources
    controlRetrievalAndVectorSystemIntegrity --> componentDataStorage
    controlOrchestratorAndRouteIntegrity --> componentApplication
    controlOrchestratorAndRouteIntegrity --> componentModelServing
    controlAgentInventoryManagement --> componentOrchestrationInputHandling
    controlAgentInventoryManagement --> componentOrchestrationOutputHandling
    controlAgentInventoryManagement --> componentReasoningCore
    controlAgentInventoryManagement --> componentTools
    controlAgentIntegrityManagement --> componentModelServing
    controlAgentIntegrityManagement --> componentOrchestrationInputHandling
    controlAgentIntegrityManagement --> componentReasoningCore
    controlAgentIntegrityManagement --> componentTools
    controlAgentCredentialIsolation --> componentReasoningCore
    controlAgentCredentialIsolation --> componentsSubgroup4
    controlInterComponentTransportSecurity --> componentApplication
    controlInterComponentTransportSecurity --> componentModelServing
    controlInterComponentTransportSecurity --> componentOrchestrationInputHandling
    controlInterComponentTransportSecurity --> componentOrchestrationOutputHandling
    controlInterComponentTransportSecurity --> componentTools
    controlComponentIdentityProvenance --> componentApplication
    controlComponentIdentityProvenance --> componentModelServing
    controlComponentIdentityProvenance --> componentOrchestrationInputHandling
    controlComponentIdentityProvenance --> componentOrchestrationOutputHandling
    controlComponentIdentityProvenance --> componentTools
    controlAgentExecutionBounds --> componentOrchestrationInputHandling
    controlAgentExecutionBounds --> componentOrchestrationOutputHandling
    controlAgentExecutionBounds --> componentReasoningCore

    %% Apply styling to controls mapped to 'all'
    controlIncidentResponseManagement:::allControl
    controlRedTeaming:::allControl
    controlThreatDetection:::allControl
    controlVulnerabilityManagement:::allControl

    %% Edge styling
    linkStyle 29,30,31,32 stroke:#4285f4,stroke-width:3px,stroke-dasharray: 8 4
    linkStyle 0,4,7,8,9,10,11,12,14,15,16,56 stroke:#34a853,stroke-width:2px
    linkStyle 2,25,33,37,38,42,47,51,57,61,62,66,67 stroke:#9c27b0,stroke-width:2px
    linkStyle 3,26,34,39,43,48,52,58,63,68 stroke:#ff9800,stroke-width:2px,stroke-dasharray: 5 5
    linkStyle 27,35,40,44,49,53,59,64,69 stroke:#e91e63,stroke-width:2px,stroke-dasharray: 10 2
    linkStyle 28,36,41,50,54,60,65 stroke:#C95792,stroke-width:2px,stroke-dasharray: 10 5

%% Node style definitions
    style components fill:#f0f0f0,stroke:#666666,stroke-width:3px,stroke-dasharray: 10 5
    style controls fill:#f0f0f0,stroke:#666666,stroke-width:3px,stroke-dasharray: 10 5
    style componentsInfrastructure fill:#e6f3e6,stroke:#333333,stroke-width:2px
    style componentsApplication fill:#e6f0ff,stroke:#333333,stroke-width:2px
    style componentsModel fill:#ffe6e6,stroke:#333333,stroke-width:2px
    style componentsModels fill:#d4e6d4,stroke:#333,stroke-width:1px
    style componentsModelSubgroup fill:#f0e6e6,stroke:#333,stroke-width:1px
    style componentsSubgroup4 fill:#f0e6e6,stroke:#333,stroke-width:1px
