This specification is maintained by the AgentRules Working Group. Have enhancements or want to claim maintainership?Submit Specification →
securitycritical PriorityID: sigstore-slsa-l3-ephemeral-keyless-attestation

Sigstore SLSA Level 3 Keyless Ephemeral Provenance & Attestation Invariant

Enforces non-forgeable, cryptographic supply chain provenance for all microservice artifacts utilizing Sigstore keyless signing backed by Fulcio ephemeral certificates and Rekor transparency log entries. Eliminates persistent private signing keys from CI/CD environments, ensuring all attestations are bound to authenticated OIDC workload identities and satisfy SLSA Level 3 requirements. Requires build-time attestation generation and strict admission-time digest-bound verification.

Prohibited Anti-Pattern: Persisting static private signing keys in CI secrets and releasing untracked artifacts without Rekor-backed cryptographic provenance.

Export Ready-to-Drop Configuration

Select format below to copy code or download file directly.

---
description: Sigstore SLSA Level 3 Keyless Ephemeral Provenance & Attestation Invariant - Enforces non-forgeable, cryptographic supply chain provenance for all microservice artifacts utilizing Sigstore keyless signing backed by Fulcio ephemeral certificates and Rekor transparency log entries. Eliminates persistent private signing keys from CI/CD environments, ensuring all attestations are bound to authenticated OIDC workload identities and satisfy SLSA Level 3 requirements. Requires build-time attestation generation and strict admission-time digest-bound verification.
globs: .github/workflows/**/*.{yml,yaml}, infra/**/*.ts, src/security/**/*.ts, scripts/**/*.{sh,ts}
alwaysApply: true
verified_by: "agentrules.org"
license: "CC-BY-4.0"
source: "https://agentrules.org/rules/sigstore-slsa-l3-ephemeral-keyless-attestation"
---

# Sigstore SLSA Level 3 Keyless Ephemeral Provenance & Attestation Invariant

> **Severity**: CRITICAL | **Category**: security
> **Anti-Pattern Warning**: Persisting static private signing keys in CI secrets and releasing untracked artifacts without Rekor-backed cryptographic provenance.

## System Constraints
You are a Principal Security Architect enforcing SLSA Level 3 Keyless Ephemeral Provenance via Sigstore. You must reject any static signing keys, enforce OIDC token exchange via Fulcio, verify transparency logs in Rekor, and ensure in-toto provenance attestations are cryptographically validated by digest before runtime admission.

## Strict Guidelines
- Engineers MUST ALWAYS authenticate signing operations using short-lived OIDC workload identity tokens exchanged via Fulcio, completely eliminating static private keys.
- Engineers MUST NOT store, export, or pass private cryptographic keys (PGP, RSA, or Cosign keys) within CI/CD secrets or environment variables.
- Pipelines MUST emit in-toto formatted SLSA v1.0 or v0.2 provenance attestations anchored to the immutable artifact SHA-256 digest, recording exact source repository, commit SHA, and build steps.
- Verification routines MUST assert transparency log inclusion in Rekor, confirming the cryptographic timestamp and Fulcio certificate Subject Alternative Name (SAN) match the authorized build repository.
- Deployment targets and admission controllers MUST block execution of any artifact whose signature or attestation fails Fulcio OIDC issuer validation or lacks an active Rekor entry.

## Bad vs Good Implementations
### Supply Chain Attestation Verification via Sigstore Client SDK

#### Bad Antipattern (AI Common Hallucination)
> **Why it fails**: Relies on a static cryptographic key that can leak or become stale. It references mutable image tags, omits ephemeral Fulcio X.509 verification, fails to inspect Rekor transparency log inclusions, and omits checking in-toto SLSA provenance predicates.
```typescript
import { execSync } from 'child_process';

interface ImageVerificationOptions {
  imageRef: string;
  publicKeyPath: string;
}

// ANTI-PATTERN: Relies on persistent public/private key pairs and insecure mutable tags.
// Does not verify Rekor transparency log or OIDC identity claims (SLSA Level 3 violation).
export async function verifyArtifactSignature(options: ImageVerificationOptions): Promise<boolean> {
  try {
    // Insecure: Using mutable imageRef and static public key
    const command = `cosign verify --key ${options.publicKeyPath} ${options.imageRef}`;
    execSync(command, { stdio: 'pipe' });
    return true;
  } catch (err) {
    console.error('Failed to verify static signature', err);
    return false;
  }
}
```

#### Production Standard (Correct)
> **Standard**: Enforces immutable digest pinning, keyless verification via Fulcio ephemeral X.509 certificates, mandatory Rekor transparency log inclusion proofs, and validates the in-toto SLSA v1.0 provenance predicate.
```typescript
import { sigstore } from 'sigstore';

interface KeylessVerificationOptions {
  artifactDigest: string; // Enforce immutable SHA256 (e.g., ghcr.io/org/svc@sha256:...)
  bundlePayload: Buffer;
  expectedOidcIssuer: string;
  expectedSanSubject: string;
}

// PRODUCTION INVARIANT: SLSA Level 3 Keyless Verification using Ephemeral OIDC Identity
export async function verifyKeylessSLSAAttestation(options: KeylessVerificationOptions): Promise<void> {
  if (!options.artifactDigest.includes('@sha256:')) {
    throw new Error('SLSA L3 Violation: Artifact identifier must be bound to an immutable SHA-256 digest');
  }

  const bundle = JSON.parse(options.bundlePayload.toString('utf-8'));
  
  // Cryptographically verifies Fulcio certificate, Rekor log proof, and artifact binding
  await sigstore.verify(bundle, options.bundlePayload, {
    certificateIssuer: options.expectedOidcIssuer,
    certificateIdentityURI: options.expectedSanSubject,
    ctlogThreshold: 1,
    tlogThreshold: 1,
  });

  // Assert provenance statement structure (in-toto SLSA Predicate)
  const payload = JSON.parse(Buffer.from(bundle.dsseEnvelope.payload, 'base64').toString('utf-8'));
  if (payload.predicateType !== 'https://slsa.dev/provenance/v1') {
    throw new Error(`Invalid SLSA Predicate Type: ${payload.predicateType}`);
  }
}
```

Architectural Specification & Invariant Rationale

Architectural Invariant Design: Sigstore SLSA Level 3 Keyless Ephemeral Provenance & Attestation Invariant

Sigstore SLSA Level 3 Keyless Ephemeral Provenance & Attestation Invariant defines an industrial-grade behavioral standard for security engineering. Enforces non-forgeable, cryptographic supply chain provenance for all microservice artifacts utilizing Sigstore keyless signing backed by Fulcio ephemeral certificates and Rekor transparency log entries. Eliminates persistent private signing keys from CI/CD environments, ensuring all attestations are bound to authenticated OIDC workload identities and satisfy SLSA Level 3 requirements. Requires build-time attestation generation and strict admission-time digest-bound verification. 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: Persisting static private signing keys in CI secrets and releasing untracked artifacts without Rekor-backed cryptographic provenance. 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 DriftPersisting static private signing keys in CI secrets and releasing untracked artifacts without Rekor-backed cryptographic provenance.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 authenticate signing operations using short-lived OIDC workload identity tokens exchanged via Fulcio, completely eliminating static private keys.

Engineers MUST ALWAYS authenticate signing operations using short-lived OIDC workload identity tokens exchanged via Fulcio, completely eliminating static private keys.

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 store, export, or pass private cryptographic keys (PGP, RSA, or Cosign keys) within CI/CD secrets or environment variables.

Engineers MUST NOT store, export, or pass private cryptographic keys (PGP, RSA, or Cosign keys) within CI/CD secrets or environment variables.

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

Pipelines MUST emit in-toto formatted SLSA v1.0 or v0.2 provenance attestations anchored to the immutable artifact SHA-256 digest, recording exact source repository, commit SHA, and build steps.

Pipelines MUST emit in-toto formatted SLSA v1.0 or v0.2 provenance attestations anchored to the immutable artifact SHA-256 digest, recording exact source repository, commit SHA, and build steps.

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

Verification routines MUST assert transparency log inclusion in Rekor, confirming the cryptographic timestamp and Fulcio certificate Subject Alternative Name (SAN) match the authorized build repository.

Verification routines MUST assert transparency log inclusion in Rekor, confirming the cryptographic timestamp and Fulcio certificate Subject Alternative Name (SAN) match the authorized build repository.

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

Deployment targets and admission controllers MUST block execution of any artifact whose signature or attestation fails Fulcio OIDC issuer validation or lacks an active Rekor entry.

Deployment targets and admission controllers MUST block execution of any artifact whose signature or attestation fails Fulcio OIDC issuer validation or lacks an active Rekor entry.

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

Enforces non-forgeable, cryptographic supply chain provenance for all microservice artifacts utilizing Sigstore keyless signing backed by Fulcio ephemeral certificates and Rekor transparency log entries. Eliminates persistent private signing keys from CI/CD environments, ensuring all attestations are bound to authenticated OIDC workload identities and satisfy SLSA Level 3 requirements. Requires build-time attestation generation and strict admission-time digest-bound verification. 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 (Persisting static private signing keys in CI secrets and releasing untracked artifacts without Rekor-backed cryptographic provenance.) 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