This specification is maintained by the AgentRules Working Group. Have enhancements or want to claim maintainership?Submit Specification →
devopscritical PriorityID: slsa-level-3-cosign-oidc-provenance-guardrail

SLSA Level 3 Keyless Ephemeral OIDC Provenance Verification Guardrail

Enforces cryptographic verification of SLSA Level 3 provenance for all container images using ephemeral OIDC identities backed by Sigstore Fulcio and Rekor. Prohibits deployment of images referenced by mutable tags or signed with long-lived private keys, ensuring unforgeable build traceability and supply chain integrity.

Prohibited Anti-Pattern: Deploying container images via mutable tags or trusting self-signed, unverified supply chain artifacts lacking OIDC Rekor transparency logging.

Export Ready-to-Drop Configuration

Select format below to copy code or download file directly.

---
description: SLSA Level 3 Keyless Ephemeral OIDC Provenance Verification Guardrail - Enforces cryptographic verification of SLSA Level 3 provenance for all container images using ephemeral OIDC identities backed by Sigstore Fulcio and Rekor. Prohibits deployment of images referenced by mutable tags or signed with long-lived private keys, ensuring unforgeable build traceability and supply chain integrity.
globs: .github/workflows/**/*.{yml,yaml}, k8s/**/*.{yml,yaml}, deploy/**/*.{ts,js,sh}, helm/**/*.{yml,yaml}, policy/**/*.{rego,yaml}
alwaysApply: true
verified_by: "agentrules.org"
license: "CC-BY-4.0"
source: "https://agentrules.org/rules/slsa-level-3-cosign-oidc-provenance-guardrail"
---

# SLSA Level 3 Keyless Ephemeral OIDC Provenance Verification Guardrail

> **Severity**: CRITICAL | **Category**: devops
> **Anti-Pattern Warning**: Deploying container images via mutable tags or trusting self-signed, unverified supply chain artifacts lacking OIDC Rekor transparency logging.

## System Constraints
You are a Principal Software Architect enforcing SLSA Level 3 provenance verification. Mandate keyless Sigstore verification via ephemeral OIDC tokens, digest pinning, and Rekor transparency log validation.

## Strict Guidelines
- Engineers MUST ALWAYS reference and deploy container images by their cryptographic SHA-256 digest (`image@sha256:...`), never by mutable tags (`:latest`, `:v1.0.0`).
- Engineers MUST verify SLSA provenance attestations using keyless Cosign with explicit `--certificate-oidc-issuer` and `--certificate-identity-regexp` matching the authoritative builder identity.
- Engineers MUST NOT use long-lived private keys or CI secrets to sign or verify supply chain artifacts; all signatures must terminate on Fulcio ephemeral certificates.
- Pipelines MUST verify inclusion in the Rekor transparency log to safeguard against compromised or replayed ephemeral certificates.
- Admission controllers and deployment scripts MUST reject any artifact whose attestation predicate fails to conform to SLSA Level 3 isolated, unforgeable builder specifications.

## Bad vs Good Implementations
### Container Image Verification in Deployment Script

#### Bad Antipattern (AI Common Hallucination)
> **Why it fails**: Relies on a mutable tag vulnerable to race conditions and substitution attacks, uses a long-lived static key instead of ephemeral OIDC identities, and completely skips SLSA Level 3 provenance attestation validation.
```typescript
import { execSync } from 'node:child_process';

export function verifyAndDeploy(imageTag: string): void {
  // Anti-pattern: Mutating tag, static key verification, no SLSA predicate verification
  const image = `ghcr.io/org/service:${imageTag}`;
  const publicKey = process.env.COSIGN_PUBLIC_KEY!;
  
  execSync(`cosign verify --key ${publicKey} ${image}`);
  execSync(`kubectl set image deployment/service service=${image}`);
}
```

#### Production Standard (Correct)
> **Standard**: Pins the container image to an immutable SHA-256 digest, executes keyless verification against Sigstore Fulcio ephemeral OIDC certificates, and guarantees Rekor-backed SLSA provenance attestation compliance.
```typescript
import { execSync } from 'node:child_process';

interface DeploymentTarget {
  imageName: string;
  digest: `sha256:${string}`;
  expectedBuilderIssuer: string;
  expectedBuilderIdentity: string;
}

export function verifyAndDeploy(target: DeploymentTarget): void {
  const immutableImageRef = `${target.imageName}@${target.digest}`;

  // Invariant: Verify keyless ephemeral OIDC attestation against Fulcio & Rekor
  const verifyCommand = [
    'cosign verify-attestation',
    '--type slsaprovenance',
    `--certificate-oidc-issuer="${target.expectedBuilderIssuer}"`,
    `--certificate-identity="${target.expectedBuilderIdentity}"`,
    immutableImageRef
  ].join(' ');

  execSync(verifyCommand, { stdio: 'pipe' });

  // Invariant: Deploy strictly by immutable SHA-256 digest
  execSync(`kubectl set image deployment/service service=${immutableImageRef}`, {
    stdio: 'inherit'
  });
}
```

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: SLSA Level 3 Keyless Ephemeral OIDC Provenance Verification Guardrail

SLSA Level 3 Keyless Ephemeral OIDC Provenance Verification Guardrail defines an industrial-grade behavioral standard for devops engineering. Enforces cryptographic verification of SLSA Level 3 provenance for all container images using ephemeral OIDC identities backed by Sigstore Fulcio and Rekor. Prohibits deployment of images referenced by mutable tags or signed with long-lived private keys, ensuring unforgeable build traceability and supply chain integrity. 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 container images via mutable tags or trusting self-signed, unverified supply chain artifacts lacking OIDC Rekor transparency logging. 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 container images via mutable tags or trusting self-signed, unverified supply chain artifacts lacking OIDC Rekor transparency logging.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 reference and deploy container images by their cryptographic SHA-256 digest (`image@sha256

Engineers MUST ALWAYS reference and deploy container images by their cryptographic SHA-256 digest (`image@sha256:...`), never by mutable tags (`:latest`, `:v1.0.0`).

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 verify SLSA provenance attestations using keyless Cosign with explicit `--certificate-oidc-issuer` and `--certificate-identity-regexp` matching the authoritative builder identity.

Engineers MUST verify SLSA provenance attestations using keyless Cosign with explicit `--certificate-oidc-issuer` and `--certificate-identity-regexp` matching the authoritative builder 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 use long-lived private keys or CI secrets to sign or verify supply chain artifacts

Engineers MUST NOT use long-lived private keys or CI secrets to sign or verify supply chain artifacts; all signatures must terminate on Fulcio ephemeral certificates.

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 inclusion in the Rekor transparency log to safeguard against compromised or replayed ephemeral certificates.

Pipelines MUST verify inclusion in the Rekor transparency log to safeguard against compromised or replayed ephemeral certificates.

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

Admission controllers and deployment scripts MUST reject any artifact whose attestation predicate fails to conform to SLSA Level 3 isolated, unforgeable builder specifications.

Admission controllers and deployment scripts MUST reject any artifact whose attestation predicate fails to conform to SLSA Level 3 isolated, unforgeable builder specifications.

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 SLSA Level 3 Keyless Ephemeral OIDC Provenance Verification Guardrail critical for AI coding assistants?

Enforces cryptographic verification of SLSA Level 3 provenance for all container images using ephemeral OIDC identities backed by Sigstore Fulcio and Rekor. Prohibits deployment of images referenced by mutable tags or signed with long-lived private keys, ensuring unforgeable build traceability and supply chain integrity. 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 container images via mutable tags or trusting self-signed, unverified supply chain artifacts lacking OIDC Rekor transparency logging.) 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

SLSA