Product / Security & compliance / Secrets

Secrets management for CI/CD pipelines

Updated November 2026 · Secrets docs →

Store API keys, certificates and config files as encrypted secrets, scope them to an organization, project or environment, and use them in jobs.

TL;DR

  • Secrets are encrypted and injected into jobs as environment variables or files.
  • Organization, project and deployment-target scopes.
  • Attach secrets to the blocks that need them.
  • Create and rotate secrets from the CLI.

Watch: Secrets

What it does

  • Secure sensitive data outside your repository.
  • Tiered secrets: organization-wide, per project, or per deployment target.
  • Use in workflows by listing secrets on a block.
  • Rotate through the CLI with sem. See the CLI reference.
  • Overview of all secrets and where they are used.
  • No long-lived cloud keys with OpenID Connect.

How it works

Create a secret from the CLI, then list it on the blocks that need it:

terminal

sem create secret aws-production \
  -e AWS_ACCESS_KEY_ID=... \
  -e AWS_SECRET_ACCESS_KEY=... \
  -f ~/.kube/config:/home/semaphore/.kube/config

.semaphore/deploy.yml

blocks:
  - name: Deploy
    task:
      secrets:
        - name: aws-production
      jobs:
        - name: Deploy
          commands:
            - checkout
            - ./deploy.sh

Docs for this feature

FAQ

How are secrets stored?

Encrypted at rest and injected into jobs only when a block lists them.

Can I limit a secret to production?

Yes. Attach it to a deployment target so only pipelines promoted to that environment can read it.

Can I avoid storing cloud keys at all?

Yes. Use OpenID Connect so each job gets short-lived credentials from your cloud provider.

Next steps

Read the Secrets docs → · All Security & compliance features → · Plans and pricing →

Star us on GitHub