This specification is maintained by the AgentRules Working Group. Have enhancements or want to claim maintainership?Submit Specification →
securitycritical PriorityID: sigstore-ambient-oidc-workload-attestation-guardrail

Sigstore Ambient OIDC Ephemeral Workload Attestation Guardrail

Enforces keyless in-toto supply chain provenance attestations via ambient CI/CD OIDC workload identity federation. Eliminates all static, long-lived signing keys and passphrases in favor of short-lived Fulcio X.509 leaf certificates logged to Rekor transparency logs.

Prohibited Anti-Pattern: Injecting long-lived private signing keys or credentials into CI/CD runners instead of exchanging ambient OIDC tokens for ephemeral Fulcio certificates.

Export Ready-to-Drop Configuration

Select format below to copy code or download file directly.

---
description: Sigstore Ambient OIDC Ephemeral Workload Attestation Guardrail - Enforces keyless in-toto supply chain provenance attestations via ambient CI/CD OIDC workload identity federation. Eliminates all static, long-lived signing keys and passphrases in favor of short-lived Fulcio X.509 leaf certificates logged to Rekor transparency logs.
globs: .github/workflows/**/*.{yml,yaml}, .gitlab-ci.yml, scripts/**/*.{ts,js,sh,py}, infra/**/*.{ts,js,tf}
alwaysApply: true
verified_by: "agentrules.org"
license: "CC-BY-4.0"
source: "https://agentrules.org/rules/sigstore-ambient-oidc-workload-attestation-guardrail"
---

# Sigstore Ambient OIDC Ephemeral Workload Attestation Guardrail

> **Severity**: CRITICAL | **Category**: security
> **Anti-Pattern Warning**: Injecting long-lived private signing keys or credentials into CI/CD runners instead of exchanging ambient OIDC tokens for ephemeral Fulcio certificates.

## System Constraints
You are a Principal Security Architect enforcing the Sigstore Ambient OIDC Ephemeral Workload Attestation Guardrail. You must systematically prevent the introduction or usage of static cryptographic signing secrets (such as GPG keys, static Cosign private keys, or long-lived signing certificates) in CI/CD pipelines and deployment automation scripts. Mandate keyless signing and in-toto provenance attestation using ambient OIDC workload identity federation through Sigstore (Fulcio and Rekor), verifying identity constraints strictly against repository identity, issuer URL, and runner context.

## Strict Guidelines
- Pipelines MUST ALWAYS configure ambient OIDC permissions (e.g., `id-token: write` in GitHub Actions) to obtain workload identity tokens automatically without static credentials.
- Engineers MUST NOT export, inject, or decrypt static private signing keys (e.g., `COSIGN_KEY`, `COSIGN_PASSWORD`, `GPG_PRIVATE_KEY`, or `.pem` secrets) into CI/CD build environments.
- Attestation logic MUST emit standard in-toto predicates (such as SLSA Provenance v0.2/v1.0) bound directly to the artifact digest and registered in the Rekor transparency log.
- Verification routines MUST explicitly enforce both `--certificate-oidc-issuer` and `--certificate-identity` (or `--certificate-identity-regexp`) to prevent identity substitution attacks from untrusted CI workloads.
- Automations MUST NEVER bypass transparency log verification (`--insecure-ignore-tlog` is strictly prohibited in production and staging environments).

## Bad vs Good Implementations
### Artifact Attestation & Signing Automation in Node.js / CI Execution

#### Bad Antipattern (AI Common Hallucination)
> **Why it fails**: Storing and passing long-lived private signing keys introduces credential exposure risk, lacks non-repudiation guarantees, misses automatic Rekor transparency logging, and creates a high-value static target for supply chain attackers.
```typescript
import { execSync } from 'child_process';
import * as fs from 'fs';

// ANTI-PATTERN: Relying on static long-lived private key secrets mounted in the environment
export function signAndAttestArtifact(imageRef: string, provenancePayloadPath: string): void {
  const privateKey = process.env.COSIGN_PRIVATE_KEY;
  const cosignPassword = process.env.COSIGN_PASSWORD;

  if (!privateKey || !cosignPassword) {
    throw new Error('Missing long-lived COSIGN_PRIVATE_KEY or COSIGN_PASSWORD');
  }

  // Ephemeral runner leaks private key file to disk
  fs.writeFileSync('/tmp/cosign.key', privateKey, { mode: 0o600 });

  // Signs using static keypair, bypassing Fulcio CA and Rekor transparency logs
  execSync(
    `cosign attest --key /tmp/cosign.key --predicate ${provenancePayloadPath} --type slsaprovenance ${imageRef}`,
    {
      env: { ...process.env, COSIGN_PASSWORD: cosignPassword },
      stdio: 'inherit'
    }
  );

  fs.unlinkSync('/tmp/cosign.key');
}
```

#### Production Standard (Correct)
> **Standard**: Leverages ambient CI/CD OIDC workload identity federation without any long-lived secrets. The artifact is signed using an ephemeral X.509 certificate bound to the pipeline's immutable identity claims and published to the public Rekor transparency log.
```typescript
import { attest } from '@sigstore/sign';
import * as fs from 'fs';

// PRODUCTION FIX: Keyless ambient OIDC exchange; binds provenance to ephemeral Fulcio cert
export async function signAndAttestArtifact(imageDigest: string, provenancePayloadPath: string): Promise<void> {
  // Verifies ambient OIDC availability without requiring static keys
  const oidcToken = process.env.ACTIONS_ID_TOKEN_REQUEST_URL || process.env.OIDC_TOKEN;
  if (!oidcToken) {
    throw new Error('Ambient OIDC token endpoint unavailable. Ensure `id-token: write` permission is granted.');
  }

  const payload = fs.readFileSync(provenancePayloadPath);
  const artifactBuffer = Buffer.from(imageDigest, 'hex');

  // Issues short-lived Fulcio X.509 leaf certificate and publishes entry to Rekor
  const bundle = await attest(artifactBuffer, 'application/vnd.in-toto+json', {
    fulcioURL: 'https://fulcio.sigstore.dev',
    rekorURL: 'https://rekor.sigstore.dev',
    payload: payload
  });

  // Persist the Sigstore verification bundle alongside the artifact
  fs.writeFileSync(`${provenancePayloadPath}.sigstore.json`, JSON.stringify(bundle, null, 2), {
    mode: 0o644
  });
}
```

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 Ambient OIDC Ephemeral Workload Attestation Guardrail

Sigstore Ambient OIDC Ephemeral Workload Attestation Guardrail defines an industrial-grade behavioral standard for security engineering. Enforces keyless in-toto supply chain provenance attestations via ambient CI/CD OIDC workload identity federation. Eliminates all static, long-lived signing keys and passphrases in favor of short-lived Fulcio X.509 leaf certificates logged to Rekor transparency logs. 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: Injecting long-lived private signing keys or credentials into CI/CD runners instead of exchanging ambient OIDC tokens for ephemeral Fulcio certificates. 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 DriftInjecting long-lived private signing keys or credentials into CI/CD runners instead of exchanging ambient OIDC tokens for ephemeral Fulcio certificates.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

Pipelines MUST ALWAYS configure ambient OIDC permissions (e.g., `id-token

Pipelines MUST ALWAYS configure ambient OIDC permissions (e.g., `id-token: write` in GitHub Actions) to obtain workload identity tokens automatically without static credentials.

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 export, inject, or decrypt static private signing keys (e.g., `COSIGN_KEY`, `COSIGN_PASSWORD`, `GPG_PRIVATE_KEY`, or `.pem` secrets) into CI/CD build environments.

Engineers MUST NOT export, inject, or decrypt static private signing keys (e.g., `COSIGN_KEY`, `COSIGN_PASSWORD`, `GPG_PRIVATE_KEY`, or `.pem` secrets) into CI/CD build environments.

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

Attestation logic MUST emit standard in-toto predicates (such as SLSA Provenance v0.2/v1.0) bound directly to the artifact digest and registered in the Rekor transparency log.

Attestation logic MUST emit standard in-toto predicates (such as SLSA Provenance v0.2/v1.0) bound directly to the artifact digest and registered in the Rekor transparency log.

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 explicitly enforce both `--certificate-oidc-issuer` and `--certificate-identity` (or `--certificate-identity-regexp`) to prevent identity substitution attacks from untrusted CI workloads.

Verification routines MUST explicitly enforce both `--certificate-oidc-issuer` and `--certificate-identity` (or `--certificate-identity-regexp`) to prevent identity substitution attacks from untrusted CI workloads.

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

Automations MUST NEVER bypass transparency log verification (`--insecure-ignore-tlog` is strictly prohibited in production and staging environments).

Automations MUST NEVER bypass transparency log verification (`--insecure-ignore-tlog` is strictly prohibited in production and staging environments).

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 Ambient OIDC Ephemeral Workload Attestation Guardrail critical for AI coding assistants?

Enforces keyless in-toto supply chain provenance attestations via ambient CI/CD OIDC workload identity federation. Eliminates all static, long-lived signing keys and passphrases in favor of short-lived Fulcio X.509 leaf certificates logged to Rekor transparency logs. 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 (Injecting long-lived private signing keys or credentials into CI/CD runners instead of exchanging ambient OIDC tokens for ephemeral Fulcio certificates.) 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