# Project security

To prevent potential security risks, CLion lets you decide how to open a project if you're not sure about its source. CLion warns you about tasks or configurations that will be executed during the opening process and lets you configure sources that you can trust.

> **Note:**
> You can configure [trusted locations](#trust_sources) to automatically load projects from particular directories.

## Open a project from unknown sources

When you open  a [CMake](quick-cmake-tutorial.html), [Makefile](makefiles-support.html), or [Gradle](gradle-support.html) project , CLion executes its build scripts during the loading process. These build scripts can contain arbitrary (potentially dangerous) code.

Every time you open a project for the first time, the IDE shows the Trust Project dialog. This helps to ensure that the project is safe to perform the following actions:

![Trust Project dialog](https://resources.jetbrains.com/help/img/idea/2026.2/cl_trust_cmake_prj_dialog.png)

You can select one of the following actions:

* Preview in Safe Mode: in this case, CLion opens the project in Safe Mode, meaning you can browse the project's sources, but there are restrictions in executing code, performing build-related activities, and running scripts (for example, executing Gradle tasks, loading and running CMake or Makefile targets). > **Tip:** > If you stay in Safe Mode, CLion will not show extra notifications for other potentially dangerous features in your project. For example, [startup tasks](#startup_tasks) will be skipped silently. For more information, refer to [Safe mode preview limitations](#safe_mode_limitations). CLion notifies you about Safe Mode on top of the editor area. ![cl_trust_cmake_editor_notification.png](https://resources.jetbrains.com/help/img/idea/2026.2/cl_trust_cmake_editor_notification.png) If you try to reload the project or execute targets in case of CMake or Makefile, or run Gradle tasks using menu items, dedicated tool windows, or the Run Anything window, CLion will prompt you to confirm that you trust the project before proceeding: ![cl_trust_cmake_load.png](https://resources.jetbrains.com/help/img/idea/2026.2/cl_trust_cmake_load.png) If at this point you want to trust a project, click the Trust project… link and load your project. Alternatively, in the main menu, go to `Navigate | Search Everywhere` or press `Shift` (Windows), `Shift` (macOS), `Shift` (IntelliJ IDEA Classic (macOS)), `Shift` (macOS System Shortcuts), `Shift` (XWin), `Shift` (GNOME), `Shift` (KDE), `Shift` (Emacs), `Shift` (Sublime Text), `Shift` (Sublime Text (macOS)), `Shift` (Xcode), `Shift` (Visual Studio), `Shift` (Visual Studio (macOS)), `Shift` (ReSharper), `Shift` (ReSharper (macOS)), `Shift` (QtCreator), `Shift` (QtCreator (macOS)), `Shift` (NetBeans), `Shift` (Eclipse), `Shift` (Eclipse (macOS)) twice to open the search window and type Trust project.

* Trust Project: in this case, CLion opens and initializes the project, resolves project plugins, adds dependencies, and enables all CLion features.

* Don't Open: in this case, CLion cancels the action.

> **Note:**
> Select the Trust all projects in <b>'<path>'</b> folder checkbox to trust the directory from which you are trying to open the project. The next time you open a project from that directory, it will be opened and loaded automatically.
>
>
>
> For Windows, the Add IDE 'project...' folders to Microsoft Defender exclusion list option is available. You can use it to exclude certain project directories from scanning,  which may improve the IDE performance.

## Startup tasks

When you open a project created on a different machine, it might contain some scripts or tasks that are executed during the opening process. If such tasks are found, CLion displays a notification suggesting that the code you are about to execute might be harmful.

You can review what tasks will be executed and modify the settings.

Procedure: Review the startup tasks

1. In the Settings dialog (`Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `⌘ Comma` (Xcode), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (ReSharper), `⌘ Comma` (ReSharper (macOS)), `Ctrl+Alt+S` (QtCreator), `⌘ Comma` (QtCreator (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS))) , go to `Tools | Startup Tasks`.

2. On the Startup Tasks settings page, you can review and modify the [startup tasks](settings-tools-startup-tasks.html).

## Safe mode preview limitations

If you open a project in Safe Mode, the following limitations will apply:

* [Startup tasks](#startup_tasks): any scripts or tasks that are executed during the opening process are disabled.

* [VCS support](version-control-integration.html): VCS support is fully disabled.

* [File Watcher](using-file-watchers.html) scripts will not wake up and run corresponding tools.

## Trusted locations

You can configure what sources CLion should consider safe and load such projects automatically during the opening process.

You can add your home directory to the trusted locations to disable CLion's warnings about untrusted projects.

> **Note:**
> Note that when you launch an instance of CLion in the headless mode using a command-line launcher, the project opens in the trusted mode by default.

Procedure: Configure trusted locations

1. In the Settings dialog (`Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `⌘ Comma` (Xcode), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (ReSharper), `⌘ Comma` (ReSharper (macOS)), `Ctrl+Alt+S` (QtCreator), `⌘ Comma` (QtCreator (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS))), go to `Appearance & Behavior | Trusted Locations`.

2. On the Trusted Locations settings page, specify the local directories that the IDE should trust. Click OK to save the changes.

![Trusted Locations](https://resources.jetbrains.com/help/img/idea/2026.2/trusted_locations.png)

The next time you open a project from one of those locations, CLion will implicitly trust it.

