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

Mandatory Sigstore Cosign Keyless Provenance & Rekor Transparency Admission

Enforces cryptographic verification of container images at admission time using Sigstore Cosign with ephemeral OIDC keyless signing, Rekor transparency log validation, and Fulcio root CA attestation. Guarantees that Kubernetes clusters immediately reject any workload lacking valid SLSA Level 3 build provenance generated by approved CI/CD identities.

Prohibited Anti-Pattern: Trusting Unverified Image Digests or Using Long-Lived Static Private Keys Bypassing Transparency Logs

Export Ready-to-Drop Configuration

Select format below to copy code or download file directly.

---
description: Mandatory Sigstore Cosign Keyless Provenance & Rekor Transparency Admission - Enforces cryptographic verification of container images at admission time using Sigstore Cosign with ephemeral OIDC keyless signing, Rekor transparency log validation, and Fulcio root CA attestation. Guarantees that Kubernetes clusters immediately reject any workload lacking valid SLSA Level 3 build provenance generated by approved CI/CD identities.
globs: policies/**/*.yaml, k8s/**/*.yaml, .github/workflows/**/*.yaml, deploy/**/*.yaml
alwaysApply: true
verified_by: "agentrules.org"
license: "CC-BY-4.0"
source: "https://agentrules.org/rules/sigstore-cosign-slsa3-keyless-admission-guardrail"
---

# Mandatory Sigstore Cosign Keyless Provenance & Rekor Transparency Admission

> **Severity**: CRITICAL | **Category**: security
> **Anti-Pattern Warning**: Trusting Unverified Image Digests or Using Long-Lived Static Private Keys Bypassing Transparency Logs

## System Constraints
You are a Principal Security Architect specializing in Supply-chain Levels for Software Artifacts (SLSA v1.0) and Sigstore infrastructure. Your mandate is to enforce non-bypassable admission policies (Policy Controller/Kyverno/Cosign webhook) rejecting any Kubernetes pod whose container images lack OIDC-attested, Rekor-logged, Fulcio-issued keyless signatures and SLSA Level 3 provenance predicates.

## Strict Guidelines
- Engineers MUST ALWAYS enforce keyless OIDC identity binding matching the exact GitHub Actions/GitLab CI workflow identity and repository OIDC subject.
- Engineers MUST ALWAYS require immutable Rekor transparency log verification (Tlog verification) with an active bundle containing inclusion proofs.
- Engineers MUST NOT use long-lived cryptographic keys (e.g., cosign.key) stored in secret managers or CI variables for container signing.
- Admission policies MUST inspect container images resolved strictly by cryptographic SHA-256 digest, NEVER mutable tags alone.
- Attestation policies MUST require and validate SLSA Level 3 predicates (https://slsa.dev/provenance/v1) confirming artifacts were built on non-developer, isolated CI runners.
- Security configurations NEVER allow break-glass exemptions that bypass Rekor log verification unless signed off via multi-party cryptographic attestation.

## Bad vs Good Implementations
### Kyverno ClusterPolicy: Rejecting Unsigned Images and Enforcing Keyless SLSA Provenance

#### Bad Antipattern (AI Common Hallucination)
> **Why it fails**: Relies on a static, long-lived public key susceptible to key compromise, does not check the Rekor transparency log, omits OIDC identity verification, and allows mutable tags without verifying SLSA Level 3 provenance attestations.
```yaml
# INSECURE: Relies on mutable static public key and does not verify SLSA provenance or Rekor logs
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
  name: verify-image-insecure
spec:
  validationFailureAction: Enforce
  rules:
    - name: verify-signature-legacy
      match:
        any:
          - resources:
              kinds:
                - Pod
      verifyImages:
        - imageReferences:
            - "ghcr.io/enterprise/app:*"
          key: |-
            -----BEGIN PUBLIC KEY-----
            MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE9WpQy...
            -----END PUBLIC KEY-----
```

#### Production Standard (Correct)
> **Standard**: Validates cryptographic SHA-256 digests, matches exact OIDC subject identity from GitHub Actions, enforces the SLSA v1.0 provenance predicate built by an immutable SLSA generator, and verifies entries against Rekor.
```yaml
# SECURE: Sigstore Keyless verification enforcing Fulcio CA, Rekor Tlog, and SLSA v1.0 Provenance predicate
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
  name: enforce-slsa3-keyless-admission
spec:
  validationFailureAction: Enforce
  webhookTimeoutSeconds: 30
  rules:
    - name: verify-keyless-slsa-attestation
      match:
        any:
          - resources:
              kinds:
                - Pod
      verifyImages:
        - imageReferences:
            - "ghcr.io/enterprise/app@sha256:*"
          required: true
          mutateDigest: true
          verifyDigest: true
          attestations:
            - type: https://slsa.dev/provenance/v1
              issuer: "https://token.actions.githubusercontent.com"
              subject: "https://github.com/enterprise/app/.github/workflows/release.yaml@refs/heads/main"
              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"
          rekor:
            url: "https://rekor.sigstore.dev"
```

Recommended MCP Servers (mcp-serverlist.com)

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

Recommended Agent Skills (askills.dev)

Ready-to-use executable skill functions tailored to this stack.

Architectural Specification & Invariant Rationale

Architectural Invariant Design: Mandatory Sigstore Cosign Keyless Provenance & Rekor Transparency Admission

Mandatory Sigstore Cosign Keyless Provenance & Rekor Transparency Admission defines an industrial-grade behavioral standard for security engineering. Enforces cryptographic verification of container images at admission time using Sigstore Cosign with ephemeral OIDC keyless signing, Rekor transparency log validation, and Fulcio root CA attestation. Guarantees that Kubernetes clusters immediately reject any workload lacking valid SLSA Level 3 build provenance generated by approved CI/CD identities. 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 Image Digests or Using Long-Lived Static Private Keys Bypassing Transparency Logs 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 Image Digests or Using Long-Lived Static Private Keys Bypassing Transparency LogsCritical
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 enforce keyless OIDC identity binding matching the exact GitHub Actions/GitLab CI workflow identity and repository OIDC subject.

Engineers MUST ALWAYS enforce keyless OIDC identity binding matching the exact GitHub Actions/GitLab CI workflow identity and repository OIDC subject.

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 ALWAYS require immutable Rekor transparency log verification (Tlog verification) with an active bundle containing inclusion proofs.

Engineers MUST ALWAYS require immutable Rekor transparency log verification (Tlog verification) with an active bundle containing inclusion proofs.

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

Engineers MUST NOT use long-lived cryptographic keys (e.g., cosign.key) stored in secret managers or CI variables for container signing.

Engineers MUST NOT use long-lived cryptographic keys (e.g., cosign.key) stored in secret managers or CI variables for container signing.

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

Admission policies MUST inspect container images resolved strictly by cryptographic SHA-256 digest, NEVER mutable tags alone.

Admission policies MUST inspect container images resolved strictly by cryptographic SHA-256 digest, NEVER mutable 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.
5

Attestation policies MUST require and validate SLSA Level 3 predicates (https

Attestation policies MUST require and validate SLSA Level 3 predicates (https://slsa.dev/provenance/v1) confirming artifacts were built on non-developer, isolated CI 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.
6

Security configurations NEVER allow break-glass exemptions that bypass Rekor log verification unless signed off via multi-party cryptographic attestation.

Security configurations NEVER allow break-glass exemptions that bypass Rekor log verification unless signed off via multi-party cryptographic attestation.

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 Mandatory Sigstore Cosign Keyless Provenance & Rekor Transparency Admission critical for AI coding assistants?

Enforces cryptographic verification of container images at admission time using Sigstore Cosign with ephemeral OIDC keyless signing, Rekor transparency log validation, and Fulcio root CA attestation. Guarantees that Kubernetes clusters immediately reject any workload lacking valid SLSA Level 3 build provenance generated by approved CI/CD identities. 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 Image Digests or Using Long-Lived Static Private Keys Bypassing Transparency Logs) 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

Mandatory