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

Sigstore Cosign Ephemeral Keyless Attestation Admission Guardrail

Enforces admission controller verification of keyless Sigstore signatures and SLSA build provenance attestations for container images entering the cluster. Mandates validation of Fulcio ephemeral X.509 certificate identities (OIDC issuer and SAN claims) and Rekor transparency log proofs, preventing execution of unsigned, untrusted, or tampered container workloads.

Prohibited Anti-Pattern: Deploying Untrusted Container Images Without Cryptographic Identity and Transparency Verification

Export Ready-to-Drop Configuration

Select format below to copy code or download file directly.

---
description: Sigstore Cosign Ephemeral Keyless Attestation Admission Guardrail - Enforces admission controller verification of keyless Sigstore signatures and SLSA build provenance attestations for container images entering the cluster. Mandates validation of Fulcio ephemeral X.509 certificate identities (OIDC issuer and SAN claims) and Rekor transparency log proofs, preventing execution of unsigned, untrusted, or tampered container workloads.
globs: policies/**/*.yaml, policies/**/*.yml, deploy/**/*.yaml, .github/workflows/**/*.yaml, .github/workflows/**/*.yml
alwaysApply: true
verified_by: "agentrules.org"
license: "CC-BY-4.0"
source: "https://agentrules.org/rules/cosign-keyless-admission-guardrail"
---

# Sigstore Cosign Ephemeral Keyless Attestation Admission Guardrail

> **Severity**: CRITICAL | **Category**: devops
> **Anti-Pattern Warning**: Deploying Untrusted Container Images Without Cryptographic Identity and Transparency Verification

## System Constraints
You are a Principal Security and DevOps Architect enforcing supply chain integrity through Sigstore Cosign ephemeral keyless attestation. You must reject any Kubernetes manifest, Kyverno/Gatekeeper policy, or CI/CD workflow that relies on static long-lived cryptographic keys, omits OIDC identity claim validation (Fulcio SAN and issuer), or skips transparency log (Rekor) verification. Require explicit image verification policies with exact provenance attestation predicate enforcement.

## Strict Guidelines
- Engineers MUST ALWAYS enforce keyless Cosign verification using Sigstore's Fulcio CA and Rekor transparency log in cluster admission controllers (e.g., Kyverno or Policy Controller).
- Engineers MUST ALWAYS pin and assert the exact OIDC issuer (e.g., https://token.actions.githubusercontent.com) and subject/SAN identity regex corresponding to the trusted CI repository and release workflow.
- Engineers MUST NOT use long-lived static private/public key pairs for production container signing to eliminate key compromise, rotation toil, and credential leakage risks.
- Admission policies MUST ALWAYS verify SLSA provenance attestations (https://slsa.dev/provenance/v0.2 or v1.0) and inspect predicate fields rather than accepting bare unvalidated signatures.
- Engineers MUST configure explicit failure modes (`failurePolicy: Fail`) on admission webhooks to prevent fail-open execution when Rekor or Fulcio endpoints experience transient network partitions.
- Components NEVER execute raw mutable tags (e.g., `:latest`) without digest resolution; admission controllers MUST mutate or enforce immutable `@sha256:...` references prior to attestation verification.

## Bad vs Good Implementations
### Kyverno ClusterPolicy for Keyless Cosign Attestation and Provenance Verification

#### Bad Antipattern (AI Common Hallucination)
> **Why it fails**: Uses validationFailureAction: Audit (fails open), validates via a compromised/static long-lived public key instead of ephemeral keyless identity, omits Rekor transparency log verification, and does not validate SLSA provenance attestations.
```yaml
# INSECURE: Relies on static public key, skips Rekor transparency check, and ignores SLSA provenance
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
  name: verify-image-insecure
spec:
  validationFailureAction: Audit
  rules:
    - name: verify-signature-static-key
      match:
        any:
          - resources:
              kinds:
                - Pod
      verifyImages:
        - imageReferences:
            - "ghcr.io/enterprise/app:*"
          key: |-
            -----BEGIN PUBLIC KEY-----
            MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEU2j9...STATIC_KEY...==
            -----END PUBLIC KEY-----
          # Missing OIDC subject verification, Rekor validation, and SLSA attestation predicates
```

#### Production Standard (Correct)
> **Standard**: Enforces strict admission blocking on failure, resolves image digests immutably, verifies ephemeral Fulcio certificates matching exact GitHub OIDC claims, enforces Rekor transparency checks, and inspects SLSA provenance predicate metadata.
```yaml
# SECURE: Keyless Sigstore validation with Fulcio identity matching and Rekor transparency verification
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
  name: verify-image-keyless-slsa
spec:
  validationFailureAction: Enforce
  webhookTimeoutSeconds: 30
  failurePolicy: Fail
  rules:
    - name: verify-keyless-provenance
      match:
        any:
          - resources:
              kinds:
                - Pod
      verifyImages:
        - imageReferences:
            - "ghcr.io/enterprise/app:*"
          mutateDigest: true
          verifyDigest: true
          required: true
          attestors:
            - entries:
                - keyless:
                    issuer: "https://token.actions.githubusercontent.com"
                    subject: "https://github.com/enterprise/app/.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/actions/runner"
                    - key: "{{ invocation.configSource.entryPoint }}"
                      operator: Equals
                      value: ".github/workflows/release.yml"
```

Architectural Specification & Invariant Rationale

Architectural Invariant Design: Sigstore Cosign Ephemeral Keyless Attestation Admission Guardrail

Sigstore Cosign Ephemeral Keyless Attestation Admission Guardrail defines an industrial-grade behavioral standard for devops engineering. Enforces admission controller verification of keyless Sigstore signatures and SLSA build provenance attestations for container images entering the cluster. Mandates validation of Fulcio ephemeral X.509 certificate identities (OIDC issuer and SAN claims) and Rekor transparency log proofs, preventing execution of unsigned, untrusted, or tampered container workloads. 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: Deploying Untrusted Container Images Without Cryptographic Identity and Transparency 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 DriftDeploying Untrusted Container Images Without Cryptographic Identity and Transparency VerificationCritical
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 Cosign verification using Sigstore's Fulcio CA and Rekor transparency log in cluster admission controllers (e.g., Kyverno or Policy Controller).

Engineers MUST ALWAYS enforce keyless Cosign verification using Sigstore's Fulcio CA and Rekor transparency log in cluster admission controllers (e.g., Kyverno or Policy Controller).

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 pin and assert the exact OIDC issuer (e.g., https

Engineers MUST ALWAYS pin and assert the exact OIDC issuer (e.g., https://token.actions.githubusercontent.com) and subject/SAN identity regex corresponding to the trusted CI repository and release workflow.

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 static private/public key pairs for production container signing to eliminate key compromise, rotation toil, and credential leakage risks.

Engineers MUST NOT use long-lived static private/public key pairs for production container signing to eliminate key compromise, rotation toil, and credential leakage risks.

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 ALWAYS verify SLSA provenance attestations (https

Admission policies MUST ALWAYS verify SLSA provenance attestations (https://slsa.dev/provenance/v0.2 or v1.0) and inspect predicate fields rather than accepting bare unvalidated signatures.

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

Engineers MUST configure explicit failure modes (`failurePolicy

Engineers MUST configure explicit failure modes (`failurePolicy: Fail`) on admission webhooks to prevent fail-open execution when Rekor or Fulcio endpoints experience transient network partitions.

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

Components NEVER execute raw mutable tags (e.g., `

Components NEVER execute raw mutable tags (e.g., `:latest`) without digest resolution; admission controllers MUST mutate or enforce immutable `@sha256:...` references prior to attestation verification.

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 Attestation Admission Guardrail critical for AI coding assistants?

Enforces admission controller verification of keyless Sigstore signatures and SLSA build provenance attestations for container images entering the cluster. Mandates validation of Fulcio ephemeral X.509 certificate identities (OIDC issuer and SAN claims) and Rekor transparency log proofs, preventing execution of unsigned, untrusted, or tampered container workloads. 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 (Deploying Untrusted Container Images Without Cryptographic Identity and Transparency 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