---
title: Detecting sensitive content in media and providing intervention options
framework: sensitivecontentanalysis
role: article
role_heading: Article
path: sensitivecontentanalysis/detecting-nudity-in-media-and-providing-intervention-options
---

# Detecting sensitive content in media and providing intervention options

Alert people before displaying images or video that might be sensitive.

## Overview

Overview In iOS 17 and macOS 14, the Sensitive Content Warning user preference and the Communication Safety parental control in Screen Time let people indicate their desire to detect sensitive content in images and video. To provide people their preferred experience while those settings are active, use the Sensitive Content Analysis framework to check incoming media before displaying it. When the framework flags user-provided media as sensitive, intervene by adjusting the user interface in a way that explains the situation and gives the person options to proceed. Avoid displaying flagged content until the person makes a decision. The Sensitive Content Warning setting is for adults; Communication Safety in Screen Time is intended to protect content on the devices of children. Vary your app’s intervention strategy according to the active setting. For instance, keep interaction brief and unobstructive for adults; for children, use the full view, and communicate in age-appropriate language. The Sensitive Content Analysis framework doesn’t dictate your user interface. You can tailor your app’s experience according to the examples in apps such as Messages. The following image depicts Messages in iOS 17 when a potentially explicit image arrives from a contact while the Sensitive Content Warning setting is on. Messages blurs the image with a UI that gives the person the option to display the flagged content. It also provides a menu of options to the person, such as blocking the contact or accessing Apple-provided resources on the web for topics like grooming, harassment, and online safety.

important: Apple provides the Sensitive Content Analysis framework to prevent people from viewing unwanted content, not as a way for an app to report on someone’s behavior. To protect privacy, don’t transmit any information off the person’s device about whether the Sensitive Content Analysis framework identified an image or video as containing sensitive content. For more information, see the Developer Program License Agreement. Add the app entitlement The OS requires the com.apple.developer.sensitivecontentanalysis.client entitlement in your app’s code signature to use Sensitive Content Analysis. Calls to the framework fail to return positive results without it. You can add this entitlement to your app by turning on the Sensitive Content Analysis capability in Xcode; see Adding capabilities to your app. Any team member of the paid App Store developer program can add the entitlement to an app after enabling the capability in Xcode and then signing the Developer Program License Agreement on the Accounts website. note: The Sensitive Content Analysis entitlement isn’t available for Enterprise development or for people with free accounts. Check images or video for sensitive content To check a user-provided image for sensitive content, create an SCSensitivityAnalyzer object. let analyzer = SCSensitivityAnalyzer() An app can utilize the Sensitive Content Analysis framework by detecting sensitive content when the system sets analysisPolicy to either: An app can’t leverage the Sensitive Content Analysis framework when the system sets analysisPolicy to SCSensitivityAnalysisPolicy.disabled. This indicates one or more of the following: The app lacks the necessary com.apple.developer.sensitivecontentanalysis.client entitlement. Neither the Sensitive Content Warning user preference nor the Communication Safety setting in Screen Time are active. One of the sensitive content detection settings is active, but the person turned off sensitive-content warnings for your app in Settings. If analysisPolicy is SCSensitivityAnalysisPolicy.disabled, the Sensitive Content Analysis framework won’t detect sensitive content. // Check the current analysis policy. let policy = analyzer.analysisPolicy if policy == .disabled { return } If analysisPolicy is a value other than SCSensitivityAnalysisPolicy.disabled, you can check images or video for sensitive content. To check an image, call one of the analyzeImage functions passing in the user-provided image or a URL to an image. // Analyze an image file at a particular URL. let response = try await analyzer.analyzeImage(at: url)

// Analyze an image in memory. let response = try await analyzer.analyzeImage(image.cgImage) To analyze a video file, pass a video URL into the videoAnalysis function and wait on the hasSensitiveContent function. let handler = analyzer.videoAnalysis(forFileAt: videoFileUrl) let response = try await handler.hasSensitiveContent() note: To analyze a video stream rather than static files, see SCVideoStreamAnalyzer. Tailor responses to content categories When the framework detects sensitive content, check the detectedTypes property to determine the specific categories present. This enables your app to provide context-appropriate interventions based on the nature of the content. // Analyze an image and proceed if it contains sensitive content.      let analysis = try await analyzer.analyzeImage(at: imageURL)  guard analysis.isSensitive else {     displayContent(imageURL)     return } // Check for specific content types. let detectedTypes = analysis.detectedTypes // Check if the analysis detects nudity.   if detectedTypes.contains(.sexuallyExplicit) {     showContentWarning(         message: "This image may contain nudity.",         allowAccess: true     ) } // Check if the analysis detects gore or violence. if detectedTypes.contains(.goreOrViolence) {     blockContent(         message: "This image may contain violence or gore.",         offerResources: true     ) } // Handle the presenece of multiple content types differently. if detectedTypes.isSuperset(of: [.sexuallyExplicit, .goreOrViolence]) {     blockContent(         message: "This image may contain multiple types of sensitive content.",         offerResources: true     ) } Your app might choose to completely block content that contains graphic violence while allowing someone to view sexually explicit content after acknowledging a warning. The appropriate response depends on your app’s context and the active analysisPolicy. Consider implementing more cautious reveal mechanisms for gore and violence content compared to sexually explicit material. Because violent imagery can be traumatic on immediate exposure, progressive reveal interfaces—such as sliders that gradually remove blur—give people greater control over their exposure. In contrast, sexually explicit content interventions can use simpler acknowledgment patterns before revealing content. note: The Sensitive Content Analysis framework sets detectedTypes only when isSensitive is true. Your app can continue to use isSensitive alone if you don’t need to differentiate between content categories. Handle performance implications Although sensitivity checks incur additional image processing and introduce a delay while checking video, the presence of active user preferences indicate the person’s expectation to receive protections at the cost of time to review. Depending on the amount of time that checks take to complete, adjust your app’s UI to accommodate the delay. For example, while checking video for sensitive content, use the progress property on the videoAnalysis return value to provide the person with status in a custom UI during the process. let handler = analyzer.videoAnalysis(forFileAt: videoFileUrl)

// Track analysis and keep the person informed on progress. let progress = handler.progress Tailor user interface for the Sensitive Content Warning setting When your app detects sensitive content, present a UI that coordinates with the active analysisPolicy. When someone turns on the Sensitive Content Warning setting, keep the user interface brief. In addition: Display the UI in an unobstructive manner, such as inline with other content instead of using the full screen. Provide intervention as the app receives sensitive content from the network but allow the app to transmit unchecked content over the network. For example, by providing a blurred version of the potentially sensitive image in its normal location, Messages on iOS 17 and later implements inline intervention. Messages also keeps the information presented in the UI brief by providing a one-word button to display the image, and an icon button for more options.

Tailor user interface for the Communication Safety parental control When a person turns the Communication Safety option in Screen Time on, intervene in your app as it receives sensitive content over a network, and before transmitting sensitive content over a network. Display the intervention in a modal view and use child-appropriate language in your UI. For example, Messages on macOS 14 and iOS 17 interrupts the normal flow of the app by presenting a modal sheet that describes flagged content with broadly understood terms, such as “a sensitive photo”.

In addition, use two consecutive panes. The following image depicts Messages in iOS 17 when a child attempts to view a sensitive photo sent from a contact. Tapping “I’m sure” on the left raises the second pane on the right.

Inline interventions for the Sensitive Content Warning setting aim to interfere minimally with an adult’s workflow while giving them quick access to help resources. The additional navigation required in the Communication Safety setting provides children with the opportunity to make a considered choice, and tries to avoid ever catching them off guard.
