Architectural Invariant Design: SLSA Build Level 3/4 Hermetic Provenance and Ephemeral Attestation Guardrail
SLSA Build Level 3/4 Hermetic Provenance and Ephemeral Attestation Guardrail defines an industrial-grade behavioral standard for security engineering. Enforces cryptographically verifiable, ephemeral, and air-gapped CI/CD build environments to eliminate supply chain tampering. Requires network-isolated build phases with pre-fetched pinned dependencies, cryptographic SHA256 immutability for all builders, and automated generation of signed in-toto SLSA provenance predicates outside the build execution context. Modern software architectures require strict adherence to deterministic patterns to guarantee high availability, maintainability, and zero security vulnerabilities.
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 Mode | AI Symptom (The Anti-Pattern) | Severity | Production Impact & Remedy |
|---|---|---|---|
| AI Hallucination & Deprecation Drift | Non-Hermetic Ambient Builds With Dynamic Network Ingress and Untrusted Provenance Generation | 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 Inconsistency | AI 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. |
Step-by-Step Production Directives
Each rule constraint below is injected into the AI agent's system prompt to establish deterministic boundaries:
Engineers MUST ALWAYS isolate the build phase into an explicit two-stage pipeline
Engineers MUST ALWAYS isolate the build phase into an explicit two-stage pipeline: a network-enabled pre-fetch/vendoring stage that verifies cryptographic digests against immutable lockfiles, and a strictly air-gapped build stage with zero external network egress.
Engineers MUST NOT invoke package managers or dynamic remote installers (e.g., `npm install`, `pip install`, `go get`, `curl | sh`) within the artifact compilation or packaging phase.
Engineers MUST NOT invoke package managers or dynamic remote installers (e.g., `npm install`, `pip install`, `go get`, `curl | sh`) within the artifact compilation or packaging phase.
Engineers MUST ALWAYS pin all build tooling, actions, base images, and dependencies using immutable cryptographic digests (SHA-256) rather than mutable semver tags or branch names.
Engineers MUST ALWAYS pin all build tooling, actions, base images, and dependencies using immutable cryptographic digests (SHA-256) rather than mutable semver tags or branch names.
Services MUST generate SLSA provenance attestations using a trusted, isolated control plane (e.g., dedicated GitHub SLSA generator reusable workflows or separate hardened signing workers) rather than generating attestations inside the artifact-producing execution container.
Services MUST generate SLSA provenance attestations using a trusted, isolated control plane (e.g., dedicated GitHub SLSA generator reusable workflows or separate hardened signing workers) rather than generating attestations inside the artifact-producing execution container.
Components NEVER grant ambient cloud credentials or write-level deployment tokens to the compilation execution context
Components NEVER grant ambient cloud credentials or write-level deployment tokens to the compilation execution context; build workers must execute with least-privilege, short-lived OIDC tokens scoped strictly to their phase.
Code SHOULD validate artifact digest matches and in-toto provenance predicate structure programmatically before publishing to registry mirrors or release stages.
Code SHOULD validate artifact digest matches and in-toto provenance predicate structure programmatically before publishing to registry mirrors or release stages.
Frequently Asked Technical Questions
Common questions developers face when configuring AI coding assistants for this stack:
Q:Why is SLSA Build Level 3/4 Hermetic Provenance and Ephemeral Attestation Guardrail critical for AI coding assistants?
Enforces cryptographically verifiable, ephemeral, and air-gapped CI/CD build environments to eliminate supply chain tampering. Requires network-isolated build phases with pre-fetched pinned dependencies, cryptographic SHA256 immutability for all builders, and automated generation of signed in-toto SLSA provenance predicates outside the build execution context. 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 (Non-Hermetic Ambient Builds With Dynamic Network Ingress and Untrusted Provenance Generation) 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.