This specification is maintained by the AgentRules Working Group. Have enhancements or want to claim maintainership?Submit Specification →
securitycritical PriorityID: sigstore-ephemeral-oidc-keyless-provenance-standard

Sigstore Ephemeral OIDC Keyless Signing and SLSA Level 3 Provenance Verification

Mandates ambient OIDC federation with Sigstore Fulcio and Rekor transparency logging to eliminate long-lived cryptographic private keys across CI/CD build pipelines. Enforces automated generation and admission verification of SLSA Level 3 in-toto attestations tied to verifiable workload identities (issuer and subject) rather than static credentials.

Prohibited Anti-Pattern: Persisting static private signing keys in pipeline secrets and signing mutable image tags without Rekor transparency or OIDC identity verification.

Export Ready-to-Drop Configuration

Select format below to copy code or download file directly.

---
description: Sigstore Ephemeral OIDC Keyless Signing and SLSA Level 3 Provenance Verification - Mandates ambient OIDC federation with Sigstore Fulcio and Rekor transparency logging to eliminate long-lived cryptographic private keys across CI/CD build pipelines. Enforces automated generation and admission verification of SLSA Level 3 in-toto attestations tied to verifiable workload identities (issuer and subject) rather than static credentials.
globs: .github/workflows/**/*.{yml,yaml}, .gitlab-ci.yml, scripts/**/*.{sh,ts,py}, deploy/**/*.{yml,yaml}, policy/**/*.{rego,cue}
alwaysApply: true
verified_by: "agentrules.org"
license: "CC-BY-4.0"
source: "https://agentrules.org/rules/sigstore-ephemeral-oidc-keyless-provenance-standard"
---

# Sigstore Ephemeral OIDC Keyless Signing and SLSA Level 3 Provenance Verification

> **Severity**: CRITICAL | **Category**: security
> **Anti-Pattern Warning**: Persisting static private signing keys in pipeline secrets and signing mutable image tags without Rekor transparency or OIDC identity verification.

## System Constraints
You are a Principal Software Architect enforcing Sigstore Ephemeral OIDC Keyless Cryptographic Provenance Standard. Mandate ambient identity federation with Fulcio and Rekor, completely eliminating long-lived signing keys. Enforce SLSA Level 3 predicate attestations and strict policy enforcement on OIDC subject identities.

## Strict Guidelines
- Pipelines MUST NEVER provision, mount, or reference static private signing keys (e.g., COSIGN_KEY, GPG secrets, AWS KMS access keys for raw signing) in CI/CD runners.
- Workflows MUST configure ambient OIDC permissions strictly scoped to the signing step (e.g., 'permissions: id-token: write' and 'contents: read' in GitHub Actions).
- Signatures and in-toto attestations MUST target immutable immutable content digests (sha256:...) and NEVER target mutable semantic tags alone.
- Engineers MUST generate SLSA provenance attestations via standard predicate generators or 'cosign attest --type slsaprovenance' linking the artifact directly to the immutable Git source commit SHA.
- Verification routines and admission controllers (Kyverno, Gatekeeper) MUST explicitly enforce both '--certificate-oidc-issuer' and '--certificate-identity' (or '--certificate-identity-regexp') matching the sanctioned repository and workflow context.
- Transparency log entry verification MUST be mandatory; pipelines MUST NOT bypass Rekor verification by specifying flags like '--insecure-ignore-tlog'.

## Bad vs Good Implementations
### CI/CD Artifact Signing: Static Long-Lived Private Key vs. Ephemeral OIDC Keyless SLSA Attestation

#### Bad Antipattern (AI Common Hallucination)
> **Why it fails**: Storing static private keys in CI/CD secrets exposes the organization to key exfiltration, requires ongoing key rotation, and fails to establish cryptographic correlation between the build job's provenance and the artifact. Signing mutable tags without Rekor transparency allows tag-overwrite supply-chain attacks.
```yaml
# Anti-Pattern: Static private key storage, mutable tag signing, no transparency, no provenance
name: Publish and Sign
on: push

jobs:
  build-and-sign:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Build Container
        run: docker build -t ghcr.io/org/app:latest .
      - name: Sign Image
        env:
          COSIGN_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
          COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
        run: |
          # Flaw: Uses long-lived static secret key prone to leakage
          # Flaw: Signs mutable tag ':latest' instead of immutable digest
          # Flaw: Lacks Rekor transparency log verification and SLSA provenance
          cosign sign --key env://COSIGN_KEY --yes ghcr.io/org/app:latest
```

#### Production Standard (Correct)
> **Standard**: Leverages ambient OIDC federated identities to request short-lived certificates from Fulcio, publishes immutable audit trails to Rekor, signs by content digest, and verifies provenance against explicit identity issuers and subjects without long-lived secrets.
```yaml
# Production Standard: Ephemeral OIDC Keyless Signing with Fulcio and SLSA Attestation
name: Publish and Sign
on:
  push:
    branches: [main]

permissions:
  contents: read
  packages: write
  id-token: write # Required for Fulcio ephemeral OIDC token exchange

jobs:
  build-and-sign:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: sigstore/[email protected]
      
      - name: Build and Push Image
        id: build
        run: |
          docker build -t ghcr.io/org/app:${{ github.sha }} .
          docker push ghcr.io/org/app:${{ github.sha }}
          DIGEST=$(docker inspect --format='{{index .RepoDigests 0}}' ghcr.io/org/app:${{ github.sha }})
          echo "digest=${DIGEST}" >> "$GITHUB_OUTPUT"

      - name: Keyless Sign and Attest SLSA Provenance
        env:
          IMAGE_DIGEST: ${{ steps.build.outputs.digest }}
        run: |
          # Signs using ambient OIDC token exchanged for ephemeral X.509 cert from Fulcio
          cosign sign --yes "${IMAGE_DIGEST}"
          
          # Attests SLSA predicate recorded on Rekor transparency log
          cosign attest --yes \
            --type slsaprovenance \
            --predicate <(echo '{"builder":{"id":"https://github.com/org/app/.github/workflows/build.yml"}}') \
            "${IMAGE_DIGEST}"

      - name: Verify Keyless Attestation Invariant
        env:
          IMAGE_DIGEST: ${{ steps.build.outputs.digest }}
        run: |
          cosign verify \
            --certificate-identity "https://github.com/org/app/.github/workflows/build.yml@refs/heads/main" \
            --certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
            "${IMAGE_DIGEST}"
```

Recommended MCP Servers (mcp-serverlist.com)

Equip agent with system tools to verify code for this stack.

Architectural Specification & Invariant Rationale

Architectural Invariant Design: Sigstore Ephemeral OIDC Keyless Signing and SLSA Level 3 Provenance Verification

Sigstore Ephemeral OIDC Keyless Signing and SLSA Level 3 Provenance Verification defines an industrial-grade behavioral standard for security engineering. Mandates ambient OIDC federation with Sigstore Fulcio and Rekor transparency logging to eliminate long-lived cryptographic private keys across CI/CD build pipelines. Enforces automated generation and admission verification of SLSA Level 3 in-toto attestations tied to verifiable workload identities (issuer and subject) rather than static credentials. Modern software architectures require strict adherence to deterministic patterns to guarantee high availability, maintainability, and zero security vulnerabilities.

Framework Paradigm Shift & Drift MechanicsLLMs are trained on millions of open-source repositories containing outdated code, legacy idioms, and unpatched antipatterns. When coding assistants generate implementations for this stack, they default to common statistical tokens: Persisting static private signing keys in pipeline secrets and signing mutable image tags without Rekor transparency or OIDC identity verification. Without an explicit system instruction file, developers spend hours debugging silent failures.
Failure Modes & Production Blast Radius

Hazard Analysis: What Breaks Without This Rule

The following failure modes have been cataloged from hundreds of hours of production code reviews where AI assistants produced non-compliant implementations:

Failure ModeAI Symptom (The Anti-Pattern)SeverityProduction Impact & Remedy
AI Hallucination & Deprecation DriftPersisting static private signing keys in pipeline secrets and signing mutable image tags without Rekor transparency or OIDC identity verification.Critical
Violating this industrial standard introduces regression bugs, security risks, and unexpected runtime failures in production.
Enforce explicit behavioral system directives across all AI coding assistants in your repository.
Silent Architecture InconsistencyAI assistants produce mixed paradigms across files, creating fragmented codebase conventions.Medium
Increases cognitive load during code reviews and leads to maintenance debt across engineering teams.
Pin project conventions in .cursor/rules, CLAUDE.md, and AGENTS.md so all team agents follow identical guardrails.
Architectural Directives in Detail

Step-by-Step Production Directives

Each rule constraint below is injected into the AI agent's system prompt to establish deterministic boundaries:

1

Pipelines MUST NEVER provision, mount, or reference static private signing keys (e.g., COSIGN_KEY, GPG secrets, AWS KMS access keys for raw signing) in CI/CD runners.

Pipelines MUST NEVER provision, mount, or reference static private signing keys (e.g., COSIGN_KEY, GPG secrets, AWS KMS access keys for raw signing) in CI/CD runners.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
2

Workflows MUST configure ambient OIDC permissions strictly scoped to the signing step (e.g., 'permissions

Workflows MUST configure ambient OIDC permissions strictly scoped to the signing step (e.g., 'permissions: id-token: write' and 'contents: read' in GitHub Actions).

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
3

Signatures and in-toto attestations MUST target immutable immutable content digests (sha256

Signatures and in-toto attestations MUST target immutable immutable content digests (sha256:...) and NEVER target mutable semantic tags alone.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
4

Engineers MUST generate SLSA provenance attestations via standard predicate generators or 'cosign attest --type slsaprovenance' linking the artifact directly to the immutable Git source commit SHA.

Engineers MUST generate SLSA provenance attestations via standard predicate generators or 'cosign attest --type slsaprovenance' linking the artifact directly to the immutable Git source commit SHA.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
5

Verification routines and admission controllers (Kyverno, Gatekeeper) MUST explicitly enforce both '--certificate-oidc-issuer' and '--certificate-identity' (or '--certificate-identity-regexp') matching the sanctioned repository and workflow context.

Verification routines and admission controllers (Kyverno, Gatekeeper) MUST explicitly enforce both '--certificate-oidc-issuer' and '--certificate-identity' (or '--certificate-identity-regexp') matching the sanctioned repository and workflow context.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
6

Transparency log entry verification MUST be mandatory

Transparency log entry verification MUST be mandatory; pipelines MUST NOT bypass Rekor verification by specifying flags like '--insecure-ignore-tlog'.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
Technical Questions & Answers

Frequently Asked Technical Questions

Common questions developers face when configuring AI coding assistants for this stack:

Q:Why is Sigstore Ephemeral OIDC Keyless Signing and SLSA Level 3 Provenance Verification critical for AI coding assistants?

Mandates ambient OIDC federation with Sigstore Fulcio and Rekor transparency logging to eliminate long-lived cryptographic private keys across CI/CD build pipelines. Enforces automated generation and admission verification of SLSA Level 3 in-toto attestations tied to verifiable workload identities (issuer and subject) rather than static credentials. Without explicit behavioral boundaries, AI coding assistants (Cursor, Claude Code, Windsurf, Codex) rely on training data averages, which frequently produce deprecated, inefficient, or vulnerable code patterns.

Q:How does adopting this rule prevent AI hallucinations?

This rule explicitly declares what the AI must avoid (Persisting static private signing keys in pipeline secrets and signing mutable image tags without Rekor transparency or OIDC identity verification.) and prescribes verified positive examples. Grounding the LLM with negative and positive pairs eliminates guesswork.

Q:Which AI coding environments are supported?

This specification is multi-platform compatible: Cursor (.cursor/rules/*.mdc & .cursorrules), Anthropic Claude Code (CLAUDE.md), Windsurf (.windsurfrules), Codex / Cline (AGENTS.md), and GitHub Copilot (.github/copilot-instructions.md).

Q:Can I combine this rule with other technology stacks?

Yes. Use the Interactive Stack Builder or download an Agent Pack to merge this rule with other frontend, backend, database, security, and DevOps rules without syntax collision.

Open Specification · CC BY 4.0·Free for Personal, Team & Commercial In-Repo Use

Citation & Open Source Attribution Guidelines

This specification is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0). You are completely free to adapt and share this rule in your workspace. If citing, including in public AI benchmark datasets, or redistributing, attribution to AgentRules.org is required.

1 Rule in Stack

Sigstore