(version 2)

(import "system.sb")
(import "com.apple.corefoundation.sb")
(corefoundation)

(allow file*
    (subpath "/private/var/db/modelmanagerd/Library/Preferences")
    (subpath "/var/db/modelmanagerd/Library/Preferences")
    (subpath "/private/var/db/modelmanagerd/Library/RegionalSafetyAnalysis")
    (subpath "/var/db/modelmanagerd/Library/RegionalSafetyAnalysis")
    (subpath "/private/var/db/modelmanagerd/Library/Caches")
    (subpath "/var/db/modelmanagerd/Library/Caches")
    (subpath "/private/var/folders")
    (subpath "/var/folders")
    (literal "/private/var/db/modelmanagerd/Library")
    (literal "/var/db/modelmanagerd/Library")
)

(allow file-map-executable
    (subpath "/System/Library/Extensions")
    (subpath "/System/Library/AssetsV2/com_apple_MobileAsset_CN_GuardrailFramework")
)

(allow file-read* file-test-existence
     (literal "/private/var/db/modelmanagerd")
     (literal "/var/db/modelmanagerd")
     (literal "/private/var/db")
     (literal "/private/var")
     (literal "/private")
     (literal "/Library/Managed Preferences/_modelmanagerd")
     (literal "/etc/localtime")
     (literal "/etc/passwd")
     (literal "/private/etc")
     (literal "/etc")
     (literal "/usr")
     (literal "/var/db/.AppleSetupDone")
)

(allow file-read* file-test-existence
    (subpath "/AppleInternal/Library/UnifiedAssetFramework/AssetSets")
    (subpath "/var/db/timezone")
    (subpath "/AppleInternal/Library/UnifiedAssetFramework")
    (subpath "/Library/GPUBundles")
)

(allow iokit-get-properties
    (iokit-property "AGCInfo")
    (iokit-property "AGXCliqueTracingDefaults")
    (iokit-property "AGXInternalPerfCounterResourcesPath")
    (iokit-property "AGXLimitersDirName")
    (iokit-property "AGXParameterBufferMaxSize")
    (iokit-property "AGXParameterBufferMaxSizeEverMemless")
    (iokit-property "AGXParameterBufferMaxSizeNeverMemless")
    (iokit-property "AGXTraceCodeVersion")
    (iokit-property "CFBundleIdentifier")
    (iokit-property "CFBundleIdentifierKernel")
    (iokit-property "chip-id")
    (iokit-property "CommandSubmissionEnabled")
    (iokit-property "gpu-core-count")
    (iokit-property "GPUConfigurationVariable")
    (iokit-property "GPURawCounterBundleName")
    (iokit-property "GPURawCounterPluginClassName")
    (iokit-property "IOClass")
    (iokit-property "IOClassNameOverride")
    (iokit-property "IOGeneralInterest")
    (iokit-property "IOGLBundleName")
    (iokit-property "IOGLESBundleName")
    (iokit-property "IOMatchCategory")
    (iokit-property "IOMatchedAtBoot")
    (iokit-property "IONameMatch")
    (iokit-property "IONameMatched")
    (iokit-property "IOPersonalityPublisher")
    (iokit-property "IOPowerManagement")
    (iokit-property "IOProbeScore")
    (iokit-property "IOProviderClass")
    (iokit-property "IORegistryEntryPropertyKeys")
    (iokit-property "IOReportLegend")
    (iokit-property "IOReportLegendPublic")
    (iokit-property "IOSourceVersion")
    (iokit-property "KDebugVersion")
    (iokit-property "MetalPluginClassName")
    (iokit-property "MetalPluginName")
    (iokit-property "MetalStatisticsName")
    (iokit-property "model")
    (iokit-property "PerformanceStatistics")
    (iokit-property "Removable")
    (iokit-property "SafeEjectRequested")
    (iokit-property "SchedulerState")
    (iokit-property "SCMBuildTime")
    (iokit-property "SCMVersionNumber")
    (iokit-property "soc-generation")
    (iokit-property "SurfaceList")
    (iokit-property "vendor-id")
)

(allow iokit-open-service
    (iokit-user-client-class "AppleKeyStore")
    (iokit-user-client-class "AppleKeyStoreUserClient")
    (iokit-user-client-class "IOSurfaceRoot")
    (iokit-user-client-class "IOClassNameOverride")
    (iokit-registry-entry-class-prefix "AGXAcceleratorG")
)

(allow iokit-open-user-client
    (iokit-user-client-class "AGXDeviceUserClient")
    (iokit-user-client-class "H11ANEInDirectPathClient")
    (iokit-user-client-class "IOSurfaceAcceleratorClient")
    (iokit-user-client-class "IOSurfaceRootUserClient")
    (iokit-user-client-class "AppleKeyStoreUserClient")
    (iokit-registry-entry-class-prefix "AGXAcceleratorG")
)

(allow mach-lookup
    (global-name "com.apple.SystemConfiguration.configd")
    (global-name "com.apple.aiml.rapidresourcedelivery")
    (global-name "com.apple.coreservices.launchservicesd")
    (global-name "com.apple.lsd.mapdb")
    (global-name "com.apple.metadata.mds")
    (global-name "com.apple.modelcatalog.catalog")
    (global-name "com.apple.tccd.system")
    (global-name "com.apple.windowserver.active")
    (global-name "com.apple.appleneuralengine")
    (global-name "com.apple.siri.uaf.service")
    (global-name "com.apple.mobileasset.autoasset")
    (global-name "com.apple.mobileassetd.v2")
    (global-name "com.apple.biome.access.system")
    (global-name "com.apple.biome.compute.source")
    (global-name "com.apple.cvmsServ")
    (global-name "com.apple.CARenderServer")
    (global-name "com.apple.cvmsServ")
    (global-name "com.apple.MTLCompilerService")
    (global-name "com.apple.gpumemd.source")
)

(allow user-preference-read
    (preference-domain "kCFPreferencesAnyApplication")
)

(allow process-info* (target self))

(allow syscall-unix)
(allow syscall-mach)
(allow system-fcntl)
(allow system-mac-syscall)
