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

Sigstore Cosign Ephemeral Keyless Provenance and SLSA-3 Admission Pinning

Enforces cryptographically verifiable, keyless container signing and SLSA-3 provenance validation via OIDC workload identity (Fulcio/Rekor) at admission control. Prohibits static private key-based Cosign workflows and unverified mutable image tags in production deployments to eliminate CI/CD secret exfiltration and image tampering vectors.

Prohibited Anti-Pattern: Trusting unverified container tags or using static Cosign private keys stored in CI secrets instead of workload identity OIDC and Rekor transparency checks.

Export Ready-to-Drop Configuration

Select format below to copy code or download file directly.

---
description: Sigstore Cosign Ephemeral Keyless Provenance and SLSA-3 Admission Pinning - Enforces cryptographically verifiable, keyless container signing and SLSA-3 provenance validation via OIDC workload identity (Fulcio/Rekor) at admission control. Prohibits static private key-based Cosign workflows and unverified mutable image tags in production deployments to eliminate CI/CD secret exfiltration and image tampering vectors.
globs: .github/workflows/**/*.{yaml,yml}, deploy/**/*.{yaml,yml}, k8s/**/*.{yaml,yml}, policies/**/*.{yaml,yml}, infra/**/*.{tf,yaml,yml}
alwaysApply: true
verified_by: "agentrules.org"
license: "CC-BY-4.0"
source: "https://agentrules.org/rules/sigstore-cosign-keyless-slsa3-provenance-guardrail"
---

# Sigstore Cosign Ephemeral Keyless Provenance and SLSA-3 Admission Pinning

> **Severity**: CRITICAL | **Category**: security
> **Anti-Pattern Warning**: Trusting unverified container tags or using static Cosign private keys stored in CI secrets instead of workload identity OIDC and Rekor transparency checks.

## System Constraints
You are a Principal Security Architect and Supply Chain Security specialist enforcing Sigstore Cosign Ephemeral Keyless Provenance and SLSA-3 pinning standards. Mandate keyless signing backed by Fulcio and Rekor transparency logs over static Cosign private keys. Ensure all Kubernetes deployments enforce cryptographic attestation verification at admission control via Kyverno or Sigstore Policy Controller, binding container images to verified immutable OIDC build identities and exact digest hashes.

## Strict Guidelines
- Engineers MUST ALWAYS sign container artifacts keylessly using ambient OIDC workload identities (e.g., GitHub Actions id-token) bound to Fulcio ephemeral certificates and Rekor transparency logs.
- Engineers MUST NOT inject or store static Cosign private keys (COSIGN_KEY) or passwords into CI/CD pipeline secrets.
- Admission control policies MUST verify container attestations against the exact OIDC issuer URL and subject SAN regex matching the source repository and release branch.
- Engineers MUST verify SLSA-3 provenance predicates (https://slsa.dev/provenance/v0.2 or v1.0) confirming build provenance from approved automated builders before admitting workloads.
- Container deployment specifications MUST pin images by cryptographically signed immutable digest (sha256:...) rather than mutable semantic version tags.

## Bad vs Good Implementations
### Kyverno ClusterPolicy for Keyless Verification and Rekor Checking

#### Bad Antipattern (AI Common Hallucination)
> **Why it fails**: Relies on static asymmetric keys stored across teams, validation failure is set to Audit instead of Enforce, and lacks transparency log checks (Rekor) or OIDC identity pinning, leaving the cluster vulnerable to compromised CI keys.
```yaml
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
  name: verify-image
spec:
  validationFailureAction: Audit
  rules:
    - name: verify-signature
      match:
        resources:
          kinds:
            - Pod
      verifyImages:
        - imageReferences:
            - "ghcr.io/org/*"
          # ANTI-PATTERN: Uses static public key; does not enforce transparency log or workload identity
          key: |-
            -----BEGIN PUBLIC KEY-----
            MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE...
```

#### Production Standard (Correct)
> **Standard**: Enforces non-repudiable supply-chain security by requiring Rekor inclusion, ephemeral Fulcio OIDC verification matching the precise repository workflow, and SLSA-3 build provenance attestation.
```yaml
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
  name: enforce-keyless-slsa-provenance
spec:
  validationFailureAction: Enforce
  webhookTimeoutSeconds: 30
  rules:
    - name: verify-fulcio-rekor-provenance
      match:
        resources:
          kinds:
            - Pod
      verifyImages:
        - imageReferences:
            - "ghcr.io/org/services/*"
          required: true
          mutateDigest: true
          verifyDigest: true
          issuer: "https://token.actions.githubusercontent.com"
          subject: "https://github.com/org/services/.github/workflows/release.yml@refs/heads/main"
          rekor:
            url: "https://rekor.sigstore.dev"
          attestations:
            - predicateType: "https://slsa.dev/provenance/v0.2"
              conditions:
                - all:
                    - key: "{{ builder.id }}"
                      operator: Equals
                      value: "https://github.com/slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@refs/tags/v2.0.0"
```

Architectural Specification & Invariant Rationale

Architectural Invariant Design: Sigstore Cosign Ephemeral Keyless Provenance and SLSA-3 Admission Pinning

Sigstore Cosign Ephemeral Keyless Provenance and SLSA-3 Admission Pinning defines an industrial-grade behavioral standard for security engineering. Enforces cryptographically verifiable, keyless container signing and SLSA-3 provenance validation via OIDC workload identity (Fulcio/Rekor) at admission control. Prohibits static private key-based Cosign workflows and unverified mutable image tags in production deployments to eliminate CI/CD secret exfiltration and image tampering vectors. 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: Trusting unverified container tags or using static Cosign private keys stored in CI secrets instead of workload identity OIDC and Rekor transparency checks. 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 DriftTrusting unverified container tags or using static Cosign private keys stored in CI secrets instead of workload identity OIDC and Rekor transparency checks.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

Engineers MUST ALWAYS sign container artifacts keylessly using ambient OIDC workload identities (e.g., GitHub Actions id-token) bound to Fulcio ephemeral certificates and Rekor transparency logs.

Engineers MUST ALWAYS sign container artifacts keylessly using ambient OIDC workload identities (e.g., GitHub Actions id-token) bound to Fulcio ephemeral certificates and Rekor transparency logs.

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

Engineers MUST NOT inject or store static Cosign private keys (COSIGN_KEY) or passwords into CI/CD pipeline secrets.

Engineers MUST NOT inject or store static Cosign private keys (COSIGN_KEY) or passwords into CI/CD pipeline secrets.

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

Admission control policies MUST verify container attestations against the exact OIDC issuer URL and subject SAN regex matching the source repository and release branch.

Admission control policies MUST verify container attestations against the exact OIDC issuer URL and subject SAN regex matching the source repository and release branch.

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 verify SLSA-3 provenance predicates (https

Engineers MUST verify SLSA-3 provenance predicates (https://slsa.dev/provenance/v0.2 or v1.0) confirming build provenance from approved automated builders before admitting workloads.

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

Container deployment specifications MUST pin images by cryptographically signed immutable digest (sha256

Container deployment specifications MUST pin images by cryptographically signed immutable digest (sha256:...) rather than mutable semantic version tags.

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 Cosign Ephemeral Keyless Provenance and SLSA-3 Admission Pinning critical for AI coding assistants?

Enforces cryptographically verifiable, keyless container signing and SLSA-3 provenance validation via OIDC workload identity (Fulcio/Rekor) at admission control. Prohibits static private key-based Cosign workflows and unverified mutable image tags in production deployments to eliminate CI/CD secret exfiltration and image tampering vectors. 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 (Trusting unverified container tags or using static Cosign private keys stored in CI secrets instead of workload identity OIDC and Rekor transparency checks.) 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