> For the complete documentation index, see [llms.txt](https://docs.sonarsource.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sonarsource.com/sonarqube-cloud/administering-sonarcloud/managing-organization/security/masking-detected-secrets.md).

# Masking detected secrets in source code

As an organization administrator, you can mask detected secret values in source-code views and Web API responses for your organization.

## Overview

SonarQube Cloud can mask the value of secrets that a scan detects in your code, instead of showing them in plain text.

The **Mask detected secret values in source code** setting (`sonar.security.secretSourceRedaction.enabled`) is disabled by default. While disabled, SonarQube Cloud shows the secret value in the source-code view and in Web API responses that return source code. As an organization administrator, you can enable the setting to hide these values instead.

When you enable masking, SonarQube Cloud replaces detected secret values with a mask in the source-code view and in Web API responses that return source code. If SonarQube Cloud cannot determine a safe location to mask within a file, it masks the entire source of that file instead.

Masking applies only to how source code is displayed. Detected-secret issues, their locations, and their descriptions remain visible as usual.

Masking takes effect immediately for existing and new analyses. You do not need to reanalyze your code after changing the setting.

## Permissions

You need the Administer Organization permission to enable secret masking for an organization. To change the permissions, retrieve your organization and go to **Administration** > **Permissions** to apply the permission to users or groups.

## Enabling secret masking

To enable masking of detected secret values in source code:

1. Retrieve your organization. See [Retrieving your organizations](/sonarqube-cloud/getting-started/viewing-organizations.md) for more information.
2. Go to **Administration** > **Organization settings** > **Security**.
3. Enable **Mask detected secret values in source code**.

## Related pages

* [Secrets](/sonarqube-cloud/analyzing-source-code/languages/secrets.md)
* [Managing organization permissions](/sonarqube-cloud/administering-sonarcloud/managing-organization/users-and-permissions/organization-permissions.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.sonarsource.com/sonarqube-cloud/administering-sonarcloud/managing-organization/security/masking-detected-secrets.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
