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

Sigstore Cosign Keyless OCI Attestation and SLSA Provenance Verification in ArgoCD

Enforces mandatory pre-sync cryptographic verification of OCI container image signatures, SLSA Level 3 provenance, and CycloneDX/SPDX SBOM attestations using Sigstore Cosign keyless OpenID Connect (OIDC) identities within ArgoCD reconciliation cycles. Prevents untrusted or tampered artifacts from being materialized into Kubernetes clusters by blocking reconciliation at the ArgoCD PreSync hook and admission controller layers.

Prohibited Anti-Pattern: Deploying Unverified Container Images via GitOps Without Cryptographic Identity and SLSA Attestation Verification

Export Ready-to-Drop Configuration

Select format below to copy code or download file directly.

---
description: Sigstore Cosign Keyless OCI Attestation and SLSA Provenance Verification in ArgoCD - Enforces mandatory pre-sync cryptographic verification of OCI container image signatures, SLSA Level 3 provenance, and CycloneDX/SPDX SBOM attestations using Sigstore Cosign keyless OpenID Connect (OIDC) identities within ArgoCD reconciliation cycles. Prevents untrusted or tampered artifacts from being materialized into Kubernetes clusters by blocking reconciliation at the ArgoCD PreSync hook and admission controller layers.
globs: **/argocd/**/*.yaml, **/manifests/**/*.yaml, **/charts/**/*.yaml, **/ci-cd/**/*.yaml, **/.github/workflows/**/*.yaml
alwaysApply: true
verified_by: "agentrules.org"
license: "CC-BY-4.0"
source: "https://agentrules.org/rules/sigstore-cosign-argocd-keyless-attestation-guardrail"
---

# Sigstore Cosign Keyless OCI Attestation and SLSA Provenance Verification in ArgoCD

> **Severity**: CRITICAL | **Category**: devops
> **Anti-Pattern Warning**: Deploying Unverified Container Images via GitOps Without Cryptographic Identity and SLSA Attestation Verification

## System Constraints
You are a Principal Software Architect enforcing zero-trust software supply chain security across ArgoCD GitOps pipelines. You must mandate cryptographic verification of all container images via Sigstore Cosign using keyless OIDC identity verification prior to any Kubernetes resource reconciliation. Reject static long-lived private keys, verify Rekor transparency log inclusion, enforce Fulcio root of trust verification, and mandate SLSA Build Level 3 provenance and SBOM predicate validation.

## Strict Guidelines
- Engineers MUST ALWAYS configure ArgoCD PreSync hooks or integrate Kyverno/Policy Controller to verify container signatures and attestations before deploying manifests.
- Engineers MUST ALWAYS use keyless verification bound to the issuer URL (`--certificate-oidc-issuer`) and the exact SAN identity regex (`--certificate-identity-regexp` or `--certificate-identity`).
- Engineers MUST NOT rely on static, long-lived GPG or Cosign private keys stored in Kubernetes Secrets; ephemeral Fulcio-issued X.509 certificates and Rekor transparency log verification MUST be enforced.
- Pipelines MUST verify both the primary image signature and its attached predicate attestations (`slsaprovenance` and `spdx`/`cyclonedx` SBOM) before marking syncs as successful.
- Sync jobs MUST fail-closed (`sync-wave` PreSync hook termination with non-zero exit code) if Rekor transparency log proof of inclusion or SCT verification fails.
- ArgoCD Application manifests MUST NOT use mutable image tags (e.g., `:latest`) and MUST lock deployments to immutable SHA-256 digest references (`image@sha256:...`).

## Bad vs Good Implementations
### ArgoCD PreSync Hook: Keyless Cosign Verification with Rekor & SLSA Attestation

#### Bad Antipattern (AI Common Hallucination)
> **Why it fails**: The Job bypasses cryptographic verification completely, allowing tampered or malicious container images to reach the cluster during ArgoCD reconciliation.
```yaml
# INSECURE: Relies on mutable tags, lacks cryptographic verification in the GitOps pipeline
apiVersion: batch/v1
kind: Job
metadata:
  name: sync-verification-job
  annotations:
    argocd.argoproj.io/hook: PreSync
spec:
  template:
    spec:
      containers:
        - name: verifier
          image: alpine:latest
          command: ["sh", "-c", "echo Skipping verification; deploying directly to production"]
      restartPolicy: Never
```

#### Production Standard (Correct)
> **Standard**: Enforces keyless verification against GitHub Actions OIDC identity, checks the Rekor transparency log, and validates SLSA provenance predicates against the target digest before ArgoCD updates cluster state.
```yaml
# SECURE: Industrial-grade Cosign Keyless PreSync verification with Fulcio identity and SLSA provenance
apiVersion: batch/v1
kind: Job
metadata:
  name: cosign-keyless-presync-verifier
  namespace: argocd
  annotations:
    argocd.argoproj.io/hook: PreSync
    argocd.argoproj.io/hook-delete-policy: HookSucceeded
spec:
  template:
    spec:
      serviceAccountName: argocd-verifier-sa
      containers:
        - name: cosign-verifier
          image: gcr.io/projectsigstore/cosign:v2.4.1
          command:
            - /bin/sh
            - -c
            - |
              set -euo pipefail
              TARGET_IMAGE="ghcr.io/enterprise-org/payment-service@sha256:d8c1c41b896677f309a9096735e5d3fa96bc6e4bb0ee4e45d658c67a3a9ec17d"
              OIDC_ISSUER="https://token.actions.githubusercontent.com"
              EXPECTED_IDENTITY_REGEXP="^https://github.com/enterprise-org/payment-service/\.github/workflows/deploy\.yml@refs/heads/main$"
              
              echo "==> Verifying image signature via Fulcio & Rekor..."
              cosign verify \
                --certificate-oidc-issuer "${OIDC_ISSUER}" \
                --certificate-identity-regexp "${EXPECTED_IDENTITY_REGEXP}" \
                "${TARGET_IMAGE}"
              
              echo "==> Verifying SLSA Provenance attestation..."
              cosign verify-attestation \
                --type slsaprovenance \
                --certificate-oidc-issuer "${OIDC_ISSUER}" \
                --certificate-identity-regexp "${EXPECTED_IDENTITY_REGEXP}" \
                "${TARGET_IMAGE}"
              
              echo "Verification succeeded. Proceeding with ArgoCD state reconciliation."
      restartPolicy: Never
  backoffLimit: 0
```

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: Sigstore Cosign Keyless OCI Attestation and SLSA Provenance Verification in ArgoCD

Sigstore Cosign Keyless OCI Attestation and SLSA Provenance Verification in ArgoCD defines an industrial-grade behavioral standard for devops engineering. Enforces mandatory pre-sync cryptographic verification of OCI container image signatures, SLSA Level 3 provenance, and CycloneDX/SPDX SBOM attestations using Sigstore Cosign keyless OpenID Connect (OIDC) identities within ArgoCD reconciliation cycles. Prevents untrusted or tampered artifacts from being materialized into Kubernetes clusters by blocking reconciliation at the ArgoCD PreSync hook and admission controller layers. 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 Unverified Container Images via GitOps Without Cryptographic Identity and SLSA Attestation 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 Unverified Container Images via GitOps Without Cryptographic Identity and SLSA Attestation 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 configure ArgoCD PreSync hooks or integrate Kyverno/Policy Controller to verify container signatures and attestations before deploying manifests.

Engineers MUST ALWAYS configure ArgoCD PreSync hooks or integrate Kyverno/Policy Controller to verify container signatures and attestations before deploying manifests.

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 use keyless verification bound to the issuer URL (`--certificate-oidc-issuer`) and the exact SAN identity regex (`--certificate-identity-regexp` or `--certificate-identity`).

Engineers MUST ALWAYS use keyless verification bound to the issuer URL (`--certificate-oidc-issuer`) and the exact SAN identity regex (`--certificate-identity-regexp` or `--certificate-identity`).

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 rely on static, long-lived GPG or Cosign private keys stored in Kubernetes Secrets

Engineers MUST NOT rely on static, long-lived GPG or Cosign private keys stored in Kubernetes Secrets; ephemeral Fulcio-issued X.509 certificates and Rekor transparency log verification MUST be enforced.

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

Pipelines MUST verify both the primary image signature and its attached predicate attestations (`slsaprovenance` and `spdx`/`cyclonedx` SBOM) before marking syncs as successful.

Pipelines MUST verify both the primary image signature and its attached predicate attestations (`slsaprovenance` and `spdx`/`cyclonedx` SBOM) before marking syncs as successful.

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

Sync jobs MUST fail-closed (`sync-wave` PreSync hook termination with non-zero exit code) if Rekor transparency log proof of inclusion or SCT verification fails.

Sync jobs MUST fail-closed (`sync-wave` PreSync hook termination with non-zero exit code) if Rekor transparency log proof of inclusion or SCT verification fails.

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

ArgoCD Application manifests MUST NOT use mutable image tags (e.g., `

ArgoCD Application manifests MUST NOT use mutable image tags (e.g., `:latest`) and MUST lock deployments to immutable SHA-256 digest references (`image@sha256:...`).

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 Keyless OCI Attestation and SLSA Provenance Verification in ArgoCD critical for AI coding assistants?

Enforces mandatory pre-sync cryptographic verification of OCI container image signatures, SLSA Level 3 provenance, and CycloneDX/SPDX SBOM attestations using Sigstore Cosign keyless OpenID Connect (OIDC) identities within ArgoCD reconciliation cycles. Prevents untrusted or tampered artifacts from being materialized into Kubernetes clusters by blocking reconciliation at the ArgoCD PreSync hook and admission controller layers. 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 Unverified Container Images via GitOps Without Cryptographic Identity and SLSA Attestation 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