How app developers can reduce the risk of AI-generated NCII
Written by
Yacine Jernite and Margaret Mitchell, Hugging Face
Published
Developers building AI image and video tools want to prevent their models from being used for abuse. But even for developers with the best intentions, finding purpose-built solutions to protect models from misuse is not easy – traditional guardrails can be too large or costly to effectively implement, or not fine-tuned to this specific challenge.
Small, targeted models are one way to change that: specifically trained for safety use-cases and light enough for any application context developers to run. Our recent efforts at ROOST around AI models are centered around ways to make specific harm prevention technologies – including hate speech, non-consensual intimate imagery, and self-harm detection – available for platforms of any size, including by building open source, small, targeted safety models in recent partnerships, like in the case of a suicide-prevention guardrail with Mila.
In their guest post, originally published here, Yacine Jernite and Margaret Mitchell from Hugging Face walk through the different ways developers can guard against NCII, and introduce their open model built for this.
Addressing NCII Risk Factors: Governance Interventions and Technical Mitigations
The development of generative AI over the last five years has drastically changed the scope of tasks that AI tools can be applied to, particularly in terms of media generation and manipulation. In particular, image editing models trained to transform an image based on a natural language prompt have become increasingly performant in the last years, responding to user queries with increased faithfulness and in some cases photo-realism.
These models can be deployed as broad-use AI-powered image (and more recently video) editing tools that can respond to any kind of natural language directions, or adapted to support different kinds of specific image editing capabilities: separating or extending an image’s background, removing unwanted content, upscaling blurry images, virtual clothes try-on (e.g., as integrated in Gemini products), or fabricating different views of a given scene, among others.
All of these tools can provide direct value to their users. At the same time, easier image manipulation also lowers the barrier for image-based abuse. Using someone’s likeness without their consent to depict them in demeaning or objectifying ways now requires less technical know-how than with traditional image editing software, including in cases of Image-Based Sexual Abuse (IBSA) and Non-Consensual Intimate Imagery (NCII).
Governing AI-enabled image editing technology in a way that enables development and research (including on its biases and limitations) while minimizing NCII risk requires a multi-stakeholder approach that works on the entire development and deployment chain for AI systems. In order to support this work, we first address definitional and regulatory aspects of NCII risk, outlining the differences between managing purpose-built versus general-use systems. We then review different approaches to technical mitigations that help lower risks at the level of deployed AI-powered image editing apps, particularly apps that provide general editing capabilities through natural language prompting. We also highlight the role of collaboration among diverse organizations in answering the full breadth of questions raised by these issues in our conclusion.

1. Defining NCII: challenges and regulation
Understanding and addressing AI systems’ contributions to NCII risk requires grappling with the difficulty of defining NCII at the level of a system’s technical activity: most systems receive descriptive natural language and image inputs, stripped of important context about e.g. the source of the image or the intended use of the output. More than a technical difficulty, this points to a fundamental need to account for context in efforts to mitigate NCII risks.
Consider two scenarios:
- In the first one, an employee at a company takes a picture of a colleague without their awareness and uses an AI image editing model to create a depiction of their likeness in lingerie, then shares it with a third colleague.
- In the second one, a person sees an example of a swimsuit for sale they like, uses a virtual try-on app with the swimsuit and a personal picture, and sends the output to a friend to ask for feedback.
Without any additional context, the inputs and outputs of the AI model processing the requests in both of these cases look substantially similar, but we understand them as very different actions; one harmful, one less obviously so. This comparison showcases just one way in which the concepts of both consent and intimacy defy generally applicable decontextualized definitions.
When formulating NCII risk mitigation strategies, this question of context suggests two complementary categories of approaches for different categories of systems, depending on how they are built and presented.
Apps built for abuse vs. general-purpose tools
The first category covers systems whose context of use can be inferred. For example, various “nudification apps” advertised and monetised on different app stores clearly encourage users to generate sexualized images of people without their consent. Alternatively, image generation models trained (or fine-tuned) on the likeness of a specific person, particularly people whose social media activity is vulnerable to scraping can facilitate breaches of consent. For these cases, the system itself is a factor of harm; and so can be subject to general bans and moderation rules. The question of technical guardrails within the system is less relevant, since the core utility is the one that is deemed to increase NCII risks.
The second category is that of general-use systems. While they are often primarily designed for benign use cases, many have capabilities that can be leveraged in support of NCII. Banning these as “NCII-capable systems” would constitute a category error given the inherent coupling between context of use and NCII harm. However, their contribution to the risk landscape can be mitigated by increasing friction against categories of use that have a higher likelihood of facilitating abuse.
Under this paradigm, rather than focusing on blocking individual cases whose context is not legible at the level of a system’s inputs or outputs, design interventions should work on modifying the overall capability landscape of the system to decrease its utility to potential abusers while preserving it for others and avoiding disproportionate additional costs.
Relevant design trade-offs start at the very earliest stages of model training, for example when developers choose to curate training data so that it includes photorealistic depictions of people’s faces. Without them, a system powered by the trained model could still be useful for helping with general graphic design, image background manipulation, or plot generation; but would be less performant in upscaling old portraits or virtual clothes try-on, or in supporting forms of abuse that rely on manipulating the likeness of a person.
Similar interventions, each with their own trade-offs, can be explored all along the development chain by the people in charge of the particular steps, from the general system specification (a broad-use system that takes natural language prompts as input to manipulate media vs. a model trained end-to-end specifically for graphic design support in dedicated software), to the deployment hardware and resources supporting a system (more compute support means both more ease of use and more risk), to post-hoc guardrails (e.g., block any requests that are likely to have a subject end up with less clothing than they started with). Each of these involve trade-offs with respect to cost, user rights including non-discrimination and privacy, and utility. We discuss options and considerations for post-hoc guardrails further in Section 2 of this article.
What the Take It Down Act and the EU AI Act require
These epistemic and technical considerations are reflected in the regulatory approach taken by the US and EU in addressing NCII risks:
- In the US, the federal statute addressing AI-generated NCII material most directly is the Take It Down Act, which introduces requirements for covered platforms to make it easier to signal and take down such material, as well as penalties for the publishing of such content without the consent of an identifiable person depicted. While published material has already caused harm, this framing allows to account for the dimensions of consent and for the specific use of the material. “Intimate visual depictions” in the Act follows the definition introduced in the 2022 Consolidated Appropriations Act focused on nudity of certain body parts and exchange of bodily fluids.
- Conversely, the “nudification app ban”, introduced in the omnibus changes of the EU AI Act, approaches the issue from the two angles introduced in the paragraphs above: on the one hand, a full ban on the specific categories of apps that have a clear NCII intent (“nudification” apps), and on the other hand, starting December 2nd 2026, a requirement for broad-use AI image editing systems that are “put on the EU market” to increase friction on abuses by adding technical mitigations that “sufficiently reduce in each specific case the likelihood of generating or manipulating such material”; although definitions of state-of-the-art or “sufficiently” in this text are still subject to further specification.
2. App-Level Technical Mitigations: Three ways to add guardrails to your app
The “technical measures and safeguards” mentioned in the approved version of the updated EU AI Act include: “data cleaning, refusal training, safe prompt design and output controls, runtime prompt guardrails, content classification and filtering mechanisms, usage restrictions, abuse detection mechanisms, and notice and action mechanisms”. Of these, prompt guardrails and content filtering mechanisms stand out as two that can generally be implemented at the level of a model’s inputs and outputs. Conversely, the list is missing approaches that allow a user to indicate a strong form of consent through technical tools. We review all three technical approaches below.

Approach 1: Likeness and Consent
The most reliable way to ensure that AI-powered image editing systems are not used in ways that violate a person’s consent is to bar them from being used on people at all. This closes off valid use cases, including virtual try-on with a person’s own likeness or image upscaling on portraits, but also makes the systems drastically less useful off-the-shelf for NCII abuses.
The simplest way to do this is to run image classification on the input image, and block the request when the image includes a depiction of a person. Alternatively, for applications like virtual try-on where manipulating images of a person is a core functionality, face matching technology could be employed in conjunction with a verified picture of the user to ensure they only apply them to their own likeness.
However, while both can present useful levers of action to lower NCII risks while preserving full functionality of the systems, they also suffer from known technical limitations: face detection and face recognition have historically been much less reliable on darker skins and women; webcam-based identity verification has been shown to be highly fallible when applied to e.g. age assurance; these methods can also struggle to distinguish likeness of real people from Computer Generated Images or even paintings in some cases. Additionally, services that require a user’s picture to be sent to an external service raise significant privacy concerns. This makes technical likeness verification less of a panacea and more of a tool to be considered among others while assessing trade-offs in context.
For cases where the approach is deemed relevant, several light-weight open models are available to identify faces in images: for example, Hugging Face user @arnabdhar published a popular light-weight face detection model based on the YOLOv8 architecture, which at the time of writing can be tested in another user’s online demo. For privacy-preserving implementations, these models should be used either locally on the machine running the system, or even better locally on the device querying the system. Additionally, for the second approach outlined above of checking the input against the user’s likeness, models like Fal.AI’s AuraFace support face matching locally with limited compute, and since the library it uses is compatible with ONNX and WebGPU, likeness verification can be run entirely on the user’s device without uploading their webcam image.
Depending on use cases and requirements, developers can adapt and combine different versions of these mechanisms. For example, the system could allow inputs that include a person’s likeness, but use a model or blurring heuristic to deidentify them prior to executing the prompt. Alternatively, rather than relying on face matching, developers could choose to only allow face inputs that come directly from the device’s webcam - following an approach previously applied as a consent gate for voice cloning.
Approach 2: Image Output Type
Another common approach consists in blocking certain categories of outputs of AI-powered image editing systems, to get at the “Intimate” characteristic of NCII abuse cases. This method typically relies on a nudity or “NSFW” (standing for “Not Safe For Work”) image classification system run on the output of the image editor, and blocks the system from returning any item that is classified as a positive.
Output filtering is typically simpler to implement than consent mechanisms, carries fewer privacy risks, and has a narrower impact on the utility of the system: in particular because it preserves a wide range of image editing capabilities that manipulate images of people. At the same time, this flexibility means that it also doesn’t do as much to mitigate other forms of image-based abuse, particularly when a person’s likeness is manipulated without their consent in ways that are intended to demean but do not fall within the model’s definition of nudity or sexualization.
These classification models also suffer from disparate precision across populations that can contribute to further marginalization: they have historically been shown to disproportionately block depictions of women in a wide range of non-sexual situations, led to systemic exclusions of people with larger bodies from representation, and of LGBTQ identities (see also Chen, 2024); all of which need to be considered in light of the intended uses of an AI system, since the risks associated with propagating these biases depend on its deployment context.
In cases where output filtering is deemed appropriate, developers can leverage several light-weight and open-weight models to implement this technical mitigation at minimal extra cost. Commercial moderation APIs and larger open-weight moderation models may also be leveraged depending on the resources available: for example, NVIDIA and Mistral both released customizable multimodal generative moderation models; although the inference time and computational requirements can make them harder to deploy on demo systems.
Approach 3: Intent and Prompt Classification
Finally, developers can use a text classification model to assess the intent expressed in the image editing input prompt, and block requests that are identified as carrying a high risk of facilitating NCII abuses: for example, when a user is explicitly querying the system to undress a person represented in the input image.
Compared to output classification, this approach presents the advantage of focusing specifically on the action of the AI-powered image editing system; additionally, since the object of classification is the prompt intent rather than the person represented, biases are less likely to affect users based on personal characteristics; and finally, blocking the transformation upstream of the image editing model saves computational resources. However, assessing intent at the level of the prompt remains difficult, especially for borderline cases: e.g., changing to more revealing or just lighter clothing rather than directly requesting nudification.
It also suffers from the same limitations outlined above about the contextual nature of intimacy: which means that the goal of the classification can’t be to catch individual cases of NCII abuse; rather, it will be to block specific categories of image editing requests that tend to be associated with abuse, hopefully while limiting overmoderation of benign uses that disproportionately affect certain (protected) categories of users.
Applicable models for prompt classification come in three categories:
- First, keyword-based blocking, preventing prompts that contain certain words (e.g. “nudify”). These are basically free to run, but are also extremely brittle, particularly since the image editing systems tend to be pretty good at interpreting prompts with typos or alternate spelling that easily fool these guardrails.
- Second, a new generation of moderation language model has recently emerged based on a new paradigm which allows developer to provide a moderation policy on natural language, and have models assess specific inputs in light of that policy.
These models can be either classification models, such as Zentropi’s CoPE (Zentropi also published a sample NCII moderation policy), or generative models such as Mistral’s ShieldStral, Google’s ShieldGemma, OpenAI’s GPT-OSS-Safeguard, and others in that category. However, even the smallest of these models typically require a GPU to run, and the generative versions with reasoning have relatively high latency: additionally, more research is still needed to assess whether the model judgment is shaped more by the input policy or by its training data.
- Third, developers can leverage classification models trained specifically for the NCII risk category, which can be significantly smaller for lower latency and resource needs. This third approach can strike a good starting balance between cost and robustness, but at the time when we started this work no such model was readily available.
NCII Prompt Guard
To help address this gap, we trained and published a new lightweight NCII-focused prompt guard on a mix of synthetic (for positive examples) and collected data. We also provide a testing Space for the model, where users can get a better sense of its behavior, robustness, and speed (on a basic CPU), as well as provide feedback on predictions. The model was designed primarily to have high recall on the most explicit examples and add friction on more borderline examples while minimizing false positives to foster easier adoption; it was also trained primarily on English-language examples (more details on intended use and limitations can be found on its model card). At the time of writing, it is deployed on several of the most Liked image-to-image Spaces and on the latest generation of image-to-video Spaces hosted on Hugging Face.
3. Where to start: recommendations for app developers
If you’re a developer making an AI-powered image or video editing app, particularly using open-weight models whose behavior has been determined by upstream developers, you should consider selecting one – even better, combining several – of the technical mitigations outlined above to limit your app’s utility in supporting NCII abuses. In some cases, you may even be required to do so after December 2nd 2026 if the app meets the criteria for being “put on the EU market”, according to the EU AI Act as amended by the Digital Omnibus.
Of the different methods outlined, prompt input and image output classification are the most straightforward to implement, with moderation models of up to a few hundred million parameters that easily run on a system’s deployment CPU.
The two approaches serve different purposes, with different weaknesses. Output image classification is a coarser intervention, which limits the risk of abuse by preventing users from obtaining AI-edited images that include any form of nudity or sexual expression; but in doing so they also prevent benign use cases, and carry biases whose risk depends on their deployment context. If, after considering these limitations, you decide that this approach is the best fit for your system, you can use open-weight models fine-tuned from ViT or from SigLIP2 to filter system outputs before returning them to their users.
Prompt guard systems are more targeted to the specific mechanisms underlying NCII abuses (meaning they should block fewer benign use cases, particularly in cases where no real person is manipulated), can handle both image and video outputs, and are run before compute resources are spent on media manipulation. They represent a good starting step, especially for demo systems. In compute-constrained systems, you can start with the hfmlsoc/ncii-prompt-guard-3c model, using its implementation on the MiniMax-H3-Turbo-Lora video generation demo as a guide.
Both of these options are recommended for demo systems with limited resources, but leveraging larger models and adding other guardrails can also be beneficial for systems that aim to be served commercially, or to support significant uses beyond demonstration. For those, consider experimenting with using the larger policy-conditioned multimodal models listed above for input and output filtering (Zentropi’s CoPE, Mistral’s ShieldStral, Google’s ShieldGemma, NVIDIA’s Nemotron-3.5-Content-Safety, etc.)
Conditioning the technical mitigations above on the presence of a person’s actual likeness in the input can also help focus their intervention more specifically on NCII risks, since these stem from manipulating a person’s likeness without their consent. This can be implemented for example by running a face-detection model on the input image, although as noted above these carry their own biases and technical limitations: so assessing whether the trade-offs they engender with the limitations of other mitigations should be done on a case by case basis.
Finally, when going beyond the development of a stand-alone demo, and particularly if considering systems that are primarily developed for working with images of people, consider investing in more consent gate-like mechanisms to ensure that any likeness input to the system is either that of the primary user, or is demonstrably synthetically generated - while there are as many possibilities for consent gating as deployment contexts, each with their own privacy trade-offs and performance limitations, you may find our previous work on the case of voice cloning systems to provide some inspiration.
4. Conclusion: Safety is a shared responsibility
Mitigating NCII risks requires an all-of-society approach: particularly so in a world where commercial AI-powered image and video editing systems are being developed to greatly facilitate media manipulation.
There are straightforward solutions to mitigating NCII when abusive intent is clear. But that clarity is often unavailable, buried within the broader context of a system’s use: the very same input and output can be abusive in one context and a consensual edit in another. Moderation that can only operate on inputs and outputs alone cannot reliably tell the two apart, because the critical factor of consent is not present in what the system has access to.
This is why the interventions we have described are best understood as factors that shape how a system is used, not bullet-proof solutions. Making an NCII-proof system may not be achievable for a general-use system, but thoughtful design along the development and deployment chain can reduce the risk of abuse while preserving utility and supporting further advancement of AI research.
Regulations such as the Take it Down Act and the updated EU AI Act are beginning to allocate responsibility across this chain, but law alone cannot pinpoint what “sufficient” mitigation looks like across all use contexts. Adequately addressing the risk of NCII requires collaboration among all stakeholders in AI development and deployment: Model developers who are thoughtful about training techniques, platforms that share methods, researchers who can rigorously measure failure modes, civil society groups and affected communities that can identify harms where others overlook them.
The technical solutions in this article provide a practical starting point, and we have released tooling to lower the barrier to trustworthy deployment; they are pieces within a shared responsibility. Building AI image and video editing that is both useful and resistant to abuse requires ongoing, collective action and collaboration across parties to bring about the best outcomes.
For additional reading on the topic, we recommend the items the following non-exhaustive list:
- Toward Evidence-Based Interventions: Foundation Model Mitigations of AI-Generation of Non-Consensual Intimate Imagery (NCII) and Their Gaps - Center for Democracy and Technology
- Generative AI & Sexual Content Creation — Safer Digital Intimacy
- How to Stop Deepfake Porn Using AI | Teen Vogue
- Collections of tools and guardrails from Hugging Face Society & Ethics
- In UK regulation, Section 138 of the Data (Use and Access) Act 2025 updates the 2003 Sexual Offenses Act to extend penalties for non-consensual sharing of intimate images to cover the creation (or requests for the creation) of “purported intimate images”; helping cover deepfake images by anchoring on whether the image is recognizable as a person, similar to the US approach.
******
Get Involved
ROOST’s mission is to make online safety tools open, shared, and auditable. The RMC is where that happens: safety practitioners, AI researchers, and model creators building detection tooling in the open.
- Join the ROOST Model Community: come to office hours, share policy prompts, ask implementation questions, connect with model creators
- Join our Discord
- Follow us on LinkedIn and Bluesky