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

Sigstore Cosign SLSA Level 3 Ephemeral Provenance and Keyless Verification

Enforces non-forgeable, hardware-attested cryptographic build provenance and keyless workload identity attestation prior to production deployment. Prevents deployment of artifacts signed with static long-lived private keys, self-hosted unverified runners, or absent Fulcio/Rekor certificate transparency entries.

Prohibited Anti-Pattern: Trusting Static Long-Lived GPG/RSA Keys or Self-Asserted Build Metadata Without OIDC-Bound Ephemeral Attestation

Export Ready-to-Drop Configuration

Select format below to copy code or download file directly.

---
description: Sigstore Cosign SLSA Level 3 Ephemeral Provenance and Keyless Verification - Enforces non-forgeable, hardware-attested cryptographic build provenance and keyless workload identity attestation prior to production deployment. Prevents deployment of artifacts signed with static long-lived private keys, self-hosted unverified runners, or absent Fulcio/Rekor certificate transparency entries.
globs: .github/workflows/**/*.{yml,yaml}, deploy/**/*.{yml,yaml}, policies/**/*.{rego,cue}, scripts/**/*.{sh,ts}
alwaysApply: true
verified_by: "agentrules.org"
license: "CC-BY-4.0"
source: "https://agentrules.org/rules/sigstore-cosign-slsa3-ephemeral-provenance-guardrail"
---

# Sigstore Cosign SLSA Level 3 Ephemeral Provenance and Keyless Verification

> **Severity**: CRITICAL | **Category**: security
> **Anti-Pattern Warning**: Trusting Static Long-Lived GPG/RSA Keys or Self-Asserted Build Metadata Without OIDC-Bound Ephemeral Attestation

## System Constraints
You are a Principal Security Architect enforcing SLSA Level 3 compliance using Sigstore Cosign. You mandate that all production artifacts possess non-forgeable cryptographic provenance generated inside isolated, ephemeral, hosted CI builders with ambient OIDC workload identities. You must reject static private keys, require SAN identity matching against exact source repositories, and enforce Rekor transparency log validation and in-toto SLSA provenance predicates before authorizing deployment pipelines.

## Strict Guidelines
- Engineers MUST ALWAYS enforce keyless signing using Fulcio ephemeral certificates backed by cryptographic workload identity federation (OIDC).
- Engineers MUST NOT rely on static, long-lived asymmetric keys (e.g., GPG, raw RSA/ECDSA pairs stored in CI secrets) for production artifact verification.
- Deployment validation pipelines MUST verify the Subject Alternative Name (SAN) regex and Issuer OIDC claim matches the canonical repository and trusted workflow reference.
- Pipelines MUST enforce in-toto SLSA v0.2 or v1.0 predicate verification via `cosign verify-attestation --type slsaprovenance` ensuring builder isolation.
- Verification routines MUST require online or bundle-backed Rekor transparency log inclusion proofs to guarantee non-repudiation.
- Workflows NEVER permit `--insecure-ignore-tlog` or `--allow-insecure-registry` flags within production validation scripts or admission controllers.

## Bad vs Good Implementations
### Cosign Artifact and Provenance Verification Routine

#### Bad Antipattern (AI Common Hallucination)
> **Why it fails**: Using a static public/private key pair introduces high-risk credential leakage and fails SLSA Level 3. Disabling transparency log checks via `--insecure-ignore-tlog` allows compromised keys to forge signatures undetected without public auditability or verifiable build environment identity.
```typescript
import { execSync } from 'node:child_process';

export function verifyDeploymentArtifact(imageUri: string, publicKeySecretPath: string): void {
  // Anti-Pattern: Validating with static long-lived public key, bypassing SLSA attestation
  // and ignoring the Rekor transparency log.
  execSync(`cosign verify --key ${publicKeySecretPath} --insecure-ignore-tlog ${imageUri}`, {
    stdio: 'inherit',
  });

  console.log(`Artifact ${imageUri} verified with static key.`);
}
```

#### Production Standard (Correct)
> **Standard**: Enforces keyless verification utilizing Fulcio's ambient OIDC identity provider, validates identity against explicit SAN regex and issuer claims, and enforces in-toto SLSA provenance attestation backed by the Rekor transparency log without bypass flags.
```typescript
import { execSync } from 'node:child_process';

interface VerificationConfig {
  imageUri: string;
  expectedSignerIdentityRegex: string;
  expectedOidcIssuer: string;
}

export function verifyDeploymentArtifact(config: VerificationConfig): void {
  const { imageUri, expectedSignerIdentityRegex, expectedOidcIssuer } = config;

  // Verify keyless signature with Fulcio cert SAN match and Rekor transparency inclusion
  execSync(
    `cosign verify \
      --certificate-identity-regexp "${expectedSignerIdentityRegex}" \
      --certificate-oidc-issuer "${expectedOidcIssuer}" \
      "${imageUri}"`,
    { stdio: 'pipe' }
  );

  // Enforce SLSA Level 3 Provenance predicate verification
  execSync(
    `cosign verify-attestation \
      --type slsaprovenance \
      --certificate-identity-regexp "${expectedSignerIdentityRegex}" \
      --certificate-oidc-issuer "${expectedOidcIssuer}" \
      "${imageUri}"`,
    { stdio: 'pipe' }
  );

  console.log(`Artifact ${imageUri} passed SLSA Level 3 cryptographic verification.`);
}
```

Recommended MCP Servers (mcp-serverlist.com)

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

Architectural Specification & Invariant Rationale

Architectural Invariant Design: Sigstore Cosign SLSA Level 3 Ephemeral Provenance and Keyless Verification

Sigstore Cosign SLSA Level 3 Ephemeral Provenance and Keyless Verification defines an industrial-grade behavioral standard for security engineering. Enforces non-forgeable, hardware-attested cryptographic build provenance and keyless workload identity attestation prior to production deployment. Prevents deployment of artifacts signed with static long-lived private keys, self-hosted unverified runners, or absent Fulcio/Rekor certificate transparency entries. 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 Static Long-Lived GPG/RSA Keys or Self-Asserted Build Metadata Without OIDC-Bound Ephemeral Attestation 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 Static Long-Lived GPG/RSA Keys or Self-Asserted Build Metadata Without OIDC-Bound Ephemeral AttestationCritical
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 signing using Fulcio ephemeral certificates backed by cryptographic workload identity federation (OIDC).

Engineers MUST ALWAYS enforce keyless signing using Fulcio ephemeral certificates backed by cryptographic workload identity federation (OIDC).

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 rely on static, long-lived asymmetric keys (e.g., GPG, raw RSA/ECDSA pairs stored in CI secrets) for production artifact verification.

Engineers MUST NOT rely on static, long-lived asymmetric keys (e.g., GPG, raw RSA/ECDSA pairs stored in CI secrets) for production artifact 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.
3

Deployment validation pipelines MUST verify the Subject Alternative Name (SAN) regex and Issuer OIDC claim matches the canonical repository and trusted workflow reference.

Deployment validation pipelines MUST verify the Subject Alternative Name (SAN) regex and Issuer OIDC claim matches the canonical repository and trusted workflow reference.

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 enforce in-toto SLSA v0.2 or v1.0 predicate verification via `cosign verify-attestation --type slsaprovenance` ensuring builder isolation.

Pipelines MUST enforce in-toto SLSA v0.2 or v1.0 predicate verification via `cosign verify-attestation --type slsaprovenance` ensuring builder isolation.

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

Verification routines MUST require online or bundle-backed Rekor transparency log inclusion proofs to guarantee non-repudiation.

Verification routines MUST require online or bundle-backed Rekor transparency log inclusion proofs to guarantee non-repudiation.

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

Workflows NEVER permit `--insecure-ignore-tlog` or `--allow-insecure-registry` flags within production validation scripts or admission controllers.

Workflows NEVER permit `--insecure-ignore-tlog` or `--allow-insecure-registry` flags within production validation scripts or admission controllers.

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

Enforces non-forgeable, hardware-attested cryptographic build provenance and keyless workload identity attestation prior to production deployment. Prevents deployment of artifacts signed with static long-lived private keys, self-hosted unverified runners, or absent Fulcio/Rekor certificate transparency entries. 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 Static Long-Lived GPG/RSA Keys or Self-Asserted Build Metadata Without OIDC-Bound Ephemeral Attestation) 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