> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/harness-platform/3.0/in-harness-3.0/secrets/types.md).

# Secret Types

Harness supports two types of secrets: Text Secrets for inline string values and File Secrets for uploaded file content. Both types are encrypted and can be stored in the built-in or any external secret manager.

### Text secrets <a href="#text-secrets" id="text-secrets"></a>

Text secrets store inline string values such as passwords, tokens, and API keys. The value is provided directly as a string when creating the secret.

**Common uses:** API keys and access tokens, database passwords and connection strings, OAuth client secrets and refresh tokens, private keys stored as PEM-encoded strings, configuration values that must remain confidential.

| Property           | Value                                      |
| ------------------ | ------------------------------------------ |
| Maximum size       | 50 MB                                      |
| Encoding           | UTF-8                                      |
| Multi-line support | Yes, newlines and whitespace are preserved |
| Type identifier    | `SecretText`                               |

#### Examples <a href="#examples" id="examples"></a>

```yaml
# API Token <a href="#api-token" id="api-token"></a>
# Type: SecretText <a href="#type-secrettext" id="type-secrettext"></a>
# Name: GitHub API Token <a href="#name-github-api-token" id="name-github-api-token"></a>
# ID: github_api_token <a href="#id-githubapitoken" id="id-githubapitoken"></a>
# Value: ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx <a href="#value-ghpxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" id="value-ghpxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"></a>
```

```yaml
# Database Password <a href="#database-password" id="database-password"></a>
# Type: SecretText <a href="#type-secrettext" id="type-secrettext"></a>
# Name: Production DB Password <a href="#name-production-db-password" id="name-production-db-password"></a>
# ID: prod_db_password <a href="#id-proddbpassword" id="id-proddbpassword"></a>
# Value: S3cur3P@ssw0rd!2026 <a href="#value-s3cur3pssw0rd2026" id="value-s3cur3pssw0rd2026"></a>
```

```yaml
# Multi-line Configuration Value <a href="#multi-line-configuration-value" id="multi-line-configuration-value"></a>
# Type: SecretText <a href="#type-secrettext" id="type-secrettext"></a>
# Name: TLS Certificate Chain <a href="#name-tls-certificate-chain" id="name-tls-certificate-chain"></a>
# ID: tls_cert_chain <a href="#id-tlscertchain" id="id-tlscertchain"></a>
# Value: <a href="#value" id="value"></a>
# -----BEGIN CERTIFICATE----- <a href="#begin-certificate" id="begin-certificate"></a>
# MIIDXTCCAkWgAwIBAgIJALa... <a href="#miidxtccakwgawibagijala" id="miidxtccakwgawibagijala"></a>
# -----END CERTIFICATE----- <a href="#end-certificate" id="end-certificate"></a>
# -----BEGIN CERTIFICATE----- <a href="#begin-certificate" id="begin-certificate"></a>
# MIIEvTCCA6WgAwIBAgIQBNn... <a href="#miievtcca6wgawibagiqbnn" id="miievtcca6wgawibagiqbnn"></a>
# -----END CERTIFICATE----- <a href="#end-certificate" id="end-certificate"></a>
```

***

### File secrets <a href="#file-secrets" id="file-secrets"></a>

File secrets store the content of uploaded files. The file is read, base64-encoded, and stored as an encrypted value. At runtime, the file content is decoded and made available to the pipeline execution.

**Common uses:** GCP service account JSON key files, Kubernetes kubeconfig files, TLS/SSL certificate and private key PEM files, license files and configuration bundles.

| Property        | Value                                                                  |
| --------------- | ---------------------------------------------------------------------- |
| Maximum size    | 50 MB                                                                  |
| File types      | Any file type (`.json`, `.yaml`, `.pem`, `.p12`, `.key`, `.txt`, etc.) |
| Storage format  | Base64-encoded                                                         |
| Type identifier | `SecretFile`                                                           |

{% hint style="info" %}
**BASE64 ENCODING**

Harness converts file secrets to base64-encoded text when storing them. When you retrieve a file secret in a pipeline, you may need to decode it before use. Go to [Managing Secrets](/harness-platform/3.0/in-harness-3.0/secrets/manage.md) section for decoding examples.
{% endhint %}

#### Examples <a href="#examples" id="examples"></a>

```json
// GCP Service Account Key
// Type: SecretFile
// Name: GCP SA Key - Production
// ID: gcp_sa_key_prod
// File: service-account.json
{
  "type": "service_account",
  "project_id": "my-project-123",
  "private_key_id": "key-id-here",
  "private_key": "-----BEGIN RSA PRIVATE KEY-----\n...",
  "client_email": "sa@my-project-123.iam.gserviceaccount.com",
  "client_id": "123456789",
  "auth_uri": "https://accounts.google.com/o/oauth2/auth",
  "token_uri": "https://oauth2.googleapis.com/token"
}
```

```yaml
# Kubeconfig File <a href="#kubeconfig-file" id="kubeconfig-file"></a>
# Type: SecretFile <a href="#type-secretfile" id="type-secretfile"></a>
# Name: Production Kubeconfig <a href="#name-production-kubeconfig" id="name-production-kubeconfig"></a>
# ID: prod_kubeconfig <a href="#id-prodkubeconfig" id="id-prodkubeconfig"></a>
# File: kubeconfig.yaml <a href="#file-kubeconfigyaml" id="file-kubeconfigyaml"></a>
apiVersion: v1
kind: Config
clusters:
  - cluster:
      server: https://k8s.example.com:6443
      certificate-authority-data: LS0tLS1CRUd...
    name: production
contexts:
  - context:
      cluster: production
      user: deploy-user
    name: production
current-context: production
users:
  - name: deploy-user
    user:
      token: eyJhbGciOiJSUzI1NiIs...
```

```yaml
# Private Key PEM File <a href="#private-key-pem-file" id="private-key-pem-file"></a>
# Type: SecretFile <a href="#type-secretfile" id="type-secretfile"></a>
# Name: TLS Private Key <a href="#name-tls-private-key" id="name-tls-private-key"></a>
# ID: tls_private_key <a href="#id-tlsprivatekey" id="id-tlsprivatekey"></a>
# File: server.key <a href="#file-serverkey" id="file-serverkey"></a>
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEA2a2rwplBQLzHPZe...
-----END RSA PRIVATE KEY-----
```

***

### External secret managers <a href="#external-secret-managers" id="external-secret-managers"></a>

Harness integrates with external secret management platforms, allowing you to leverage your existing secrets infrastructure. When an external secret manager is configured, Harness stores only a reference to the secret path; the actual value remains in your infrastructure.

#### Supported platforms <a href="#supported-platforms" id="supported-platforms"></a>

| Platform            | Authentication Methods                 | Features                                        |
| ------------------- | -------------------------------------- | ----------------------------------------------- |
| HashiCorp Vault     | Token, AppRole, AWS IAM, Kubernetes    | Dynamic secrets, leasing, namespaces            |
| AWS Secrets Manager | Access Key, IAM Role, IRSA             | Automatic rotation, cross-account access        |
| GCP Secret Manager  | Service Account Key, Workload Identity | Versioning, IAM policies, replication           |
| Azure Key Vault     | Client Secret, Managed Identity        | HSM-backed keys, soft-delete, purge protection  |
| Custom              | Shell script on Delegate               | Any secret manager accessible from the Delegate |

#### Configuration steps <a href="#configuration-steps" id="configuration-steps"></a>

1. Navigate to **Account Settings → Connectors → Secret Managers**.
2. Select the external secret manager type you want to configure.
3. Provide the connection details: endpoint URL, authentication credentials, and any platform-specific settings.
4. Test the connection to verify that Harness can reach your secret manager.
5. Save the configuration. The secret manager is now available for use when creating secrets.

#### Benefits <a href="#benefits" id="benefits"></a>

* **Secrets remain in your infrastructure**: Harness never stores the actual secret value. Only a reference to the path in your secret manager is persisted.
* **Existing rotation policies apply**: Continue using your organization's existing rotation schedules and automation. Harness resolves the latest value at execution time.
* **Data residency compliance**: Secret values remain in the region and infrastructure where your secret manager is deployed, satisfying data residency requirements.

{% hint style="warning" %}
**DELEGATE REQUIRED**

External secret managers require a Harness Delegate with network access to the secret manager endpoint. Ensure the Delegate can resolve the secret manager hostname and that the required ports are open in your network configuration.
{% endhint %}
