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

SLSA Level 3 Ephemeral OIDC Provenance & Cryptographic Attestation Fence

Enforces non-forgeable SLSA Level 3 build provenance by binding artifact signatures to short-lived OIDC/SPIFFE identity tokens generated in isolated runners. Precludes static deployment credentials and requires admission controllers to reject container images lacking verifiable transparency log entries and cryptographic attestations.

Prohibited Anti-Pattern: Ambient Static Credentials and Tag-Based Admission Without Rekor-Logged Cryptographic Provenance

Export Ready-to-Drop Configuration

Select format below to copy code or download file directly.

---
description: SLSA Level 3 Ephemeral OIDC Provenance & Cryptographic Attestation Fence - Enforces non-forgeable SLSA Level 3 build provenance by binding artifact signatures to short-lived OIDC/SPIFFE identity tokens generated in isolated runners. Precludes static deployment credentials and requires admission controllers to reject container images lacking verifiable transparency log entries and cryptographic attestations.
globs: .github/workflows/**/*.{yml,yaml}, policies/**/*.{rego,cue,yaml}, k8s/admission/**/*.{yaml,yml}, src/security/**/*.{ts,tsx}
alwaysApply: true
verified_by: "agentrules.org"
license: "CC-BY-4.0"
source: "https://agentrules.org/rules/slsa-l3-ephemeral-oidc-attestation-fence"
---

# SLSA Level 3 Ephemeral OIDC Provenance & Cryptographic Attestation Fence

> **Severity**: CRITICAL | **Category**: devops
> **Anti-Pattern Warning**: Ambient Static Credentials and Tag-Based Admission Without Rekor-Logged Cryptographic Provenance

## System Constraints
You are a Principal Software Architect and Rules Author enforcing SLSA Level 3 build provenance and zero-trust supply chain governance. You must strictly forbid persistent build credentials, floating action tags, and unverified mutable container references. You must enforce keyless cryptographic signing via ephemeral OIDC identities (Fulcio/Rekor) and immutable admission fencing.

## Strict Guidelines
- Pipelines MUST NEVER use static, long-lived registry or cloud credentials (e.g., DOCKER_PASSWORD, static AWS_SECRET_ACCESS_KEY); ephemeral OIDC workload federation MUST be used exclusively.
- Workflows MUST generate cryptographically signed in-toto SLSA Provenance predicates pinned to immutable sha256 artifact digests.
- CI/CD build actions and containers MUST be pinned to immutable commit SHAs rather than mutable semver or floating branch tags.
- Admission controllers and deployment policies MUST reject any artifact whose attestation cannot be verified against the public Rekor transparency log and Fulcio root CA.
- The Subject Alternative Name (SAN) and OIDC Issuer claim MUST be strictly validated at admission time to match the authorized build repository, workflow path, and ref.
- Build execution environments MUST maintain hermeticity and tenant isolation to prevent environment tampering between build and attestation phases.

## Bad vs Good Implementations
### Admission Webhook Cryptographic Verification

#### Bad Antipattern (AI Common Hallucination)
> **Why it fails**: Accepts containers based solely on mutable image name strings and prefixes. Fails to verify image digest immutability, Sigstore signature bundles, transparency log inclusion, or SLSA provenance attestations.
```typescript
import { Request, Response } from 'express';

// ANTI-PATTERN: Superficial registry check accepting mutable tags without
// verifying ephemeral OIDC provenance, Rekor inclusion, or Fulcio SAN identities.
export async function validateImageAdmission(req: Request, res: Response) {
  const { image } = req.body;

  // Flaw 1: Mutable tag matching susceptible to TOCTOU and man-in-the-middle attacks
  if (!image.startsWith('ghcr.io/enterprise-org/')) {
    return res.status(403).json({ allowed: false, message: 'Untrusted registry' });
  }

  // Flaw 2: Zero cryptographic validation of in-toto attestation or Sigstore bundle
  return res.status(200).json({ allowed: true });
}
```

#### Production Standard (Correct)
> **Standard**: Validates that the artifact reference is an immutable sha256 digest, checks the bundle against the Sigstore root of trust, and enforces that the ephemeral OIDC SAN and issuer strictly correspond to the authorized repository release workflow.
```typescript
import { Request, Response } from 'express';
import { verifyBinding } from '@sigstore/verify';

interface AdmissionRequest {
  imageDigest: string;
  bundle: Record<string, unknown>;
}

const EXPECTED_SAN_REGEX = /^https:\/\/github\.com\/enterprise-org\/core-service\/\.github\/workflows\/release\.yml@refs\/heads\/main$/;
const EXPECTED_OIDC_ISSUER = 'https://token.actions.githubusercontent.com';

export async function validateImageAdmission(req: Request, res: Response) {
  const { imageDigest, bundle } = req.body as AdmissionRequest;

  // Invariant 1: Ensure explicit sha256 pinning
  if (!/^ghcr\.io\/enterprise-org\/core-service@sha256:[a-f0-9]{64}$/.test(imageDigest)) {
    return res.status(400).json({ allowed: false, message: 'Invalid or mutable image reference' });
  }

  try {
    // Invariant 2: Cryptographically verify SLSA L3 ephemeral OIDC provenance bundle
    const artifactDigest = imageDigest.split('@sha256:')[1];
    const result = await verifyBinding({
      bundle,
      artifact: Buffer.from(artifactDigest, 'hex'),
      keyless: {
        identities: [{
          issuer: EXPECTED_OIDC_ISSUER,
          san: EXPECTED_SAN_REGEX
        }]
      }
    });

    if (!result.verified) {
      return res.status(403).json({ allowed: false, message: 'Cryptographic attestation verification failed' });
    }

    return res.status(200).json({ allowed: true });
  } catch (error) {
    return res.status(403).json({ allowed: false, message: (error as Error).message });
  }
}
```

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 Ephemeral OIDC Provenance & Cryptographic Attestation Fence

SLSA Level 3 Ephemeral OIDC Provenance & Cryptographic Attestation Fence defines an industrial-grade behavioral standard for devops engineering. Enforces non-forgeable SLSA Level 3 build provenance by binding artifact signatures to short-lived OIDC/SPIFFE identity tokens generated in isolated runners. Precludes static deployment credentials and requires admission controllers to reject container images lacking verifiable transparency log entries and cryptographic attestations. 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: Ambient Static Credentials and Tag-Based Admission Without Rekor-Logged 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 DriftAmbient Static Credentials and Tag-Based Admission Without Rekor-Logged Cryptographic ProvenanceCritical
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

Pipelines MUST NEVER use static, long-lived registry or cloud credentials (e.g., DOCKER_PASSWORD, static AWS_SECRET_ACCESS_KEY)

Pipelines MUST NEVER use static, long-lived registry or cloud credentials (e.g., DOCKER_PASSWORD, static AWS_SECRET_ACCESS_KEY); ephemeral OIDC workload federation MUST be used exclusively.

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

Workflows MUST generate cryptographically signed in-toto SLSA Provenance predicates pinned to immutable sha256 artifact digests.

Workflows MUST generate cryptographically signed in-toto SLSA Provenance predicates pinned to immutable sha256 artifact digests.

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

CI/CD build actions and containers MUST be pinned to immutable commit SHAs rather than mutable semver or floating branch tags.

CI/CD build actions and containers MUST be pinned to immutable commit SHAs rather than mutable semver or floating branch tags.

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 controllers and deployment policies MUST reject any artifact whose attestation cannot be verified against the public Rekor transparency log and Fulcio root CA.

Admission controllers and deployment policies MUST reject any artifact whose attestation cannot be verified against the public Rekor transparency log and Fulcio root CA.

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

The Subject Alternative Name (SAN) and OIDC Issuer claim MUST be strictly validated at admission time to match the authorized build repository, workflow path, and ref.

The Subject Alternative Name (SAN) and OIDC Issuer claim MUST be strictly validated at admission time to match the authorized build repository, workflow path, and ref.

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

Build execution environments MUST maintain hermeticity and tenant isolation to prevent environment tampering between build and attestation phases.

Build execution environments MUST maintain hermeticity and tenant isolation to prevent environment tampering between build and attestation phases.

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 Ephemeral OIDC Provenance & Cryptographic Attestation Fence critical for AI coding assistants?

Enforces non-forgeable SLSA Level 3 build provenance by binding artifact signatures to short-lived OIDC/SPIFFE identity tokens generated in isolated runners. Precludes static deployment credentials and requires admission controllers to reject container images lacking verifiable transparency log entries and cryptographic attestations. 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 (Ambient Static Credentials and Tag-Based Admission Without Rekor-Logged 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

SLSA