# Using Secrets

### Managing and Using Secrets

{% hint style="info" %}
View the full CLI/SDK Docs for **Secrets** here [https://paperspace.github.io/gradient-cli/gradient.cli.html#gradient-secrets](https://paperspace.github.io/gradient-cli/gradient.cli.html#gradient-secrets)
{% endhint %}

#### Set a Secret

{% tabs %}
{% tab title="Web UI" %}
Navigate to the project, cluster, or team page and click the **Secrets** tab. Click the **Create Secret** button, enter the secret name and value, and click the **Create Secret** button to save.

![Secrets are located in Settings > Secrets](https://1320806315-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LHZRFUkajubOAmgu6Rd%2F-MROCMJIcyoyXw4eBnwX%2F-MROJWoKiJSqbMR3WGdH%2FScreen%20Shot%202021-01-18%20at%2010.25.39%20PM.png?alt=media\&token=d349dcfe-1e66-49de-bbc1-d700b3517d97)
{% endtab %}

{% tab title="CLI" %}
Set team secret

```
gradient secrets set team --name=<name> --value=<secret>
```

Set project secret

```
gradient secrets set project --id=<project_id> --name=<name> --value=<secret>
```

Set cluster secret

```
gradient secrets set cluster --id=<cluster_id> --name=<name> --value=<secret>
```
{% endtab %}
{% endtabs %}

#### List Secrets

{% tabs %}
{% tab title="Web UI" %}
Navigate to the project or team page and click the **Secrets** tab.

![Secrets are available in settings for projects and teams](https://1320806315-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LHZRFUkajubOAmgu6Rd%2F-MROCMJIcyoyXw4eBnwX%2F-MROKDy4yUy3NGEDMIcC%2FScreen%20Shot%202021-01-18%20at%2010.28.24%20PM.png?alt=media\&token=0d6eb500-9d39-4cd3-9980-4c77a9896461)
{% endtab %}

{% tab title="CLI" %}
List team secrets

```
gradient secrets list team
```

List project secrets

```
gradient secrets list project --id=<project_id>
```

List cluster secrets

```
gradient secrets list cluster --id=<cluster_id>
```
{% endtab %}
{% endtabs %}

#### Delete a Secret

{% tabs %}
{% tab title="Web UI" %}
Navigate to the project, cluster, or team page and click the **Secrets** tab. Click the **Delete** button and confirm the dialog.

![](https://1320806315-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LHZRFUkajubOAmgu6Rd%2F-M7y1w5iRIfQbUicChWR%2F-M7y2KqerZNdE9-iqsOF%2Fsecret-delete.png?alt=media\&token=20017e2d-4f18-4579-a0c6-f81f2632801c)
{% endtab %}

{% tab title="CLI" %}
Delete team secret

```
gradient secrets delete team --name=<name>
```

Delete project secret

```
gradient secrets delete project --id=<project_id> --name=<name>
```

Delete cluster secrets

```
gradient secrets delete cluster --id=<cluster_id> --name=<name>
```
{% endtab %}
{% endtabs %}

#### **Secret scoping**

If the same secret name is created for more than one scope only one will be applied. Secrets have the following precedence: Project > Cluster > Team.

#### Using Secrets

See [Experiment Variables](../../experiments/using-experiments/environment-variables#injecting-secrets) for using Secrets with Experiments.
