Loading...
Loading...
Generate Harness Secret definitions and manage secrets via MCP v2 tools. Supports SecretText, SecretFile, SSHKey, and WinRmCredentials types with configurable secret managers (Harness built-in, HashiCorp Vault, AWS Secrets Manager, Azure Key Vault, GCP Secret Manager). Use when asked to create a secret, store credentials, manage API keys, set up SSH keys, configure WinRM credentials, rotate secrets, or reference secrets in pipelines. Trigger phrases: create secret, secret text, secret file, SSH key, API key, password, credentials, secret manager, store secret.
npx skill4agent add thisrohangupta/harness-skills create-secret| Tool | Resource Type | Purpose |
|---|---|---|
| | List existing secrets |
| | Get secret metadata (not the value) |
| | Create a new secret |
| | Update secret metadata or value |
| | Delete a secret |
| | Discover secret resource schema |
secret:
identifier: my_api_key
name: My API Key
description: API key for external service
type: SecretText
spec:
secretManagerIdentifier: harnessSecretManager
valueType: Inline
value: <secret_value>| Scope | Visibility | MCP Parameters |
|---|---|---|
| Project | Only within the project | |
| Organization | All projects in the org | |
| Account | All orgs and projects | Neither org_id nor project_id |
harness_list(
resource_type="secret",
org_id="<org>",
project_id="<project>",
search_term="<keyword>"
)harness_create(
resource_type="secret",
org_id="<org>",
project_id="<project>",
body={
"secret": {
"identifier": "my_api_key",
"name": "My API Key",
"type": "SecretText",
"spec": {
"secret_manager_identifier": "harnessSecretManager",
"value_type": "Inline",
"value": "<value>"
}
}
}
)harness_get(
resource_type="secret",
resource_id="my_api_key",
org_id="<org>",
project_id="<project>"
)# Project-level secret
<+secrets.getValue("my_api_key")>
# Org-level secret
<+secrets.getValue("org.my_api_key")>
# Account-level secret
<+secrets.getValue("account.my_api_key")>connector:
spec:
authentication:
spec:
tokenRef: github_pat # secret identifiervariables:
- name: DB_PASSWORD
type: Secret
value: <+secrets.getValue("db_password")>| Secret Type | Pattern | Example |
|---|---|---|
| API Keys | | |
| Passwords | | |
| Tokens | | |
| SSH Keys | | |
| Certificates | | |
^[a-zA-Z_][0-9a-zA-Z_]{0,127}$/create-secret
Create a SecretText for a GitHub personal access token at the project level
using the Harness built-in secret manager/create-secret
Create an SSH key secret for deploying to production servers as the "deploy" user/create-secret
Create a secret that references the database password stored in HashiCorp Vault
at secret/data/production/database#password/create-secret
Show me all secrets in the payments project/create-secret
Create WinRM NTLM credentials for the Windows deployment servers| Error | Cause | Solution |
|---|---|---|
| Duplicate identifier | Secret with same ID exists | Use unique identifier or update existing |
| Secret manager not found | Invalid | Verify the secret manager connector exists |
| Encryption failed | Secret manager connectivity issue | Check delegate connectivity to secret manager |
| Invalid secret type | Unsupported type string | Use |
| Invalid valueType | Case mismatch | Use |
org.account.core_secret_viewharness_get#keysecretsmanager:GetSecretValuecredentialType: Password/audit-report