create-secret
Skill2 starsChanged 7 months agoApache-2.0Archived repositoryView on GitHub
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.
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 8 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 209
Never include actual secret values in generated YAML.
- Distinctive: line 210
Verify the correct scope (account, org, project) before creating — secrets at the wrong scope will not be accessible.
- Very specific: line 217
Check scope -- project secrets need no prefix, org secrets need org.
- Distinctive: line 218
Verify the pipeline's project has access to the secret's scope
- Very specific: line 223
Verify the secret manager connector is healthy (harness_get on the connector)
- Distinctive: line 230
Verify the private key is in PEM format
- Distinctive: line 231
Check that the target server accepts key-based authentication
- Distinctive: line 232
If using KeyPath, confirm the key file exists on the delegate host
- Very specific: line 233
Test with credentialType: Password first to isolate key-specific issues
- Distinctive: line 237
Use external secret managers (Vault, AWS SM) for production secrets
- Distinctive: line 239
Never output secret values in pipeline logs
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Create Secret Skill
Generate Harness Secret definitions and manage secrets via MCP v2 tools.
MCP v2 Tools Used
| Tool | Resource Type | Purpose |
harness_list | secret | List existing secrets |
harness_get | secret | Get secret metadata (not the value) |
harness_create | secret | Create a new secret |
harness_update | secret | Update secret metadata or value |
harness_delete | secret | Delete a secret |
harness_describe | secret | Discover secret resource schema |
Secret Types
SecretText
Stores text-based secrets: passwords, API tokens, connection strings.
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>For other secret types (SecretFile, SSHKey with KeyReference/KeyPath/Password, WinRmCredentials with NTLM/Kerberos) and secret manager configuration, consult references/secret-types.md.
Secret Scopes
| Scope | Visibility | MCP Parameters |
| Project | Only within the project | org_id + project_id |
| Organization | All projects in the org | org_id only |
| Account | All orgs and projects | Neither org_id nor project_id |
Instructions
Step 1: Determine Requirements
- Secret type: SecretText, SecretFile, SSHKey, or WinRmCredentials
- Secret manager: Harness built-in or external
- Scope: project, org, or account
- Tags and description for organization
Step 2: Check for Existing Secrets
harness_list(
resource_type="secret",
org_id="<org>",
project_id="<project>",
search_term="<keyword>"
)Step 3: Create the Secret
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>"
}
}
}
)Step 4: Verify Creation
harness_get(
resource_type="secret",
resource_id="my_api_key",
org_id="<org>",
project_id="<project>"
)Referencing Secrets in Pipelines
# 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")>In connector configuration:
connector:
spec:
authentication:
spec:
tokenRef: github_pat # secret identifierIn service variables:
variables:
- name: DB_PASSWORD
type: Secret
value: <+secrets.getValue("db_password")>Naming Conventions
| Secret Type | Pattern | Example |
| API Keys | {service}_api_key | github_api_key |
| Passwords | {system}_password | prod_db_password |
| Tokens | {provider}_token | slack_token |
| SSH Keys | ssh_{purpose} | ssh_deploy_key |
| Certificates | {service}_cert | ssl_prod_cert |
Identifier must match: ^[a-zA-Z_][0-9a-zA-Z_]{0,127}$
Examples
Create a GitHub PAT secret
/create-secret
Create a SecretText for a GitHub personal access token at the project level
using the Harness built-in secret managerCreate SSH credentials
/create-secret
Create an SSH key secret for deploying to production servers as the "deploy" userCreate a Vault-referenced secret
/create-secret
Create a secret that references the database password stored in HashiCorp Vault
at secret/data/production/database#passwordList secrets
/create-secret
Show me all secrets in the payments projectCreate WinRM credentials
/create-secret
Create WinRM NTLM credentials for the Windows deployment serversError Handling
| Error | Cause | Solution |
| Duplicate identifier | Secret with same ID exists | Use unique identifier or update existing |
| Secret manager not found | Invalid secretManagerIdentifier | 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 SecretText, SecretFile, SSHKey, or WinRmCredentials |
| Invalid valueType | Case mismatch | Use Inline or Reference (case-sensitive) |
Performance Notes
- Never include actual secret values in generated YAML. Use placeholder references only.
- Verify the correct scope (account, org, project) before creating — secrets at the wrong scope will not be accessible.
- Confirm the secret manager exists and is accessible before creating secrets.
Troubleshooting
Secret Not Accessible in Pipeline
- Check scope -- project secrets need no prefix, org secrets need
org.prefix, account secrets needaccount.prefix - Verify the pipeline's project has access to the secret's scope
- Confirm the user/service account running the pipeline has
core_secret_viewpermission
External Secret Manager Errors
- Verify the secret manager connector is healthy (
harness_geton the connector) - For Vault: check the path format includes
#keysuffix for specific keys - For AWS SM: ensure IAM permissions allow
secretsmanager:GetSecretValue - Delegate must have network access to the external secret manager
SSH Key Connection Failures
- Verify the private key is in PEM format
- Check that the target server accepts key-based authentication
- If using KeyPath, confirm the key file exists on the delegate host
- Test with
credentialType: Passwordfirst to isolate key-specific issues
Security Best Practices
- Use external secret managers (Vault, AWS SM) for production secrets
- Scope secrets as narrowly as possible -- prefer project over account
- Never output secret values in pipeline logs
- Rotate secrets regularly and update references
- Audit secret access via the
/audit-reportskill
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- harness/harness-skills★ 12799% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository30 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/harness.mdcCursor rule
- analyze-costsSkill
- audit-reportSkill
- chaos-experimentSkill
- create-agentSkill
- create-agent-templateSkill
- create-connectorSkill
- create-environmentSkill
- create-infrastructureSkill
- create-pipelineSkill
- create-pipeline-v1Skill
- create-policySkill
- create-serviceSkill
- create-templateSkill
- create-triggerSkill
- debug-pipelineSkill
- dora-metricsSkill
- gitops-statusSkill
- manage-delegatesSkill
- manage-feature-flagsSkill
- manage-rolesSkill
- manage-usersSkill
- migrate-pipelineSkill
- run-pipelineSkill
- scorecard-reviewSkill
- security-reportSkill
- template-usageSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

