This specification is maintained by the AgentRules Working Group. Have enhancements or want to claim maintainership?Submit Specification →
securitycritical PriorityID: oci-cosign-intoto-attestation-admission-standard

OCI 1.1 In-Toto Cosign Attestation Inline Admission Standard

Enforces inline cryptographic validation of In-Toto Software Bill of Materials (SBOM) and SLSA provenance attestations via OCI 1.1 Referrers prior to container execution. Rejects any workload referencing mutable tags, unverified cryptographic signatures, missing transparency log inclusions, or non-compliant predicate schemas.

Prohibited Anti-Pattern: Trusting unpinned container tags or unverified client annotations instead of cryptographically signed OCI 1.1 In-Toto attestation trees

Export Ready-to-Drop Configuration

Select format below to copy code or download file directly.

---
description: OCI 1.1 In-Toto Cosign Attestation Inline Admission Standard - Enforces inline cryptographic validation of In-Toto Software Bill of Materials (SBOM) and SLSA provenance attestations via OCI 1.1 Referrers prior to container execution. Rejects any workload referencing mutable tags, unverified cryptographic signatures, missing transparency log inclusions, or non-compliant predicate schemas.
globs: k8s/**/*.yaml, deploy/**/*.yaml, policies/**/*.yaml, policies/**/*.rego, admission/**/*.go
alwaysApply: true
verified_by: "agentrules.org"
license: "CC-BY-4.0"
source: "https://agentrules.org/rules/oci-cosign-intoto-attestation-admission-standard"
---

# OCI 1.1 In-Toto Cosign Attestation Inline Admission Standard

> **Severity**: CRITICAL | **Category**: security
> **Anti-Pattern Warning**: Trusting unpinned container tags or unverified client annotations instead of cryptographically signed OCI 1.1 In-Toto attestation trees

## System Constraints
You are a Principal Security Architect enforcing the OCI 1.1 In-Toto Cosign Attestation Admission Standard. You must strictly require that container workloads enforce immutable image digest references, discover attestations via standard OCI 1.1 Referrers API (RFC 9315 / OCI Image Spec v1.1), verify cryptographic signatures against Sigstore (Fulcio/Rekor) or hardened PKI KMS roots, and inspect In-Toto SBOM and SLSA predicate payloads before admission.

## Strict Guidelines
- Engineers MUST ALWAYS reference container images strictly by immutable SHA-256 digest (`image@sha256:...`) at the admission boundary, mutating tags to digests automatically if not provided.
- Engineers MUST NOT admit container images whose In-Toto attestations fail Sigstore Rekor inclusion checks or Fulcio SAN identity matching (e.g., issuer and subject repository assertions).
- Admission policies MUST query OCI 1.1 referrers artifacts matching the `application/vnd.in-toto+json` media type attached directly to the image subject manifest digest.
- Code MUST validate that the attested In-Toto predicate payload contains a valid SBOM (SPDX 2.3 or CycloneDX 1.5+) and conformant SLSA Provenance v1.0 matching the expected source repository and build pipeline commit SHA.
- Admission controllers MUST FAIL CLOSED when verifying attestations; network timeouts, missing OCI 1.1 referrers endpoints, or invalid certificate chains must immediately deny workload admission.
- Workload specifications MUST NOT bypass admission enforcement via insecure Pod annotations, unauthenticated registries, or local sidecar bypass patterns.

## Bad vs Good Implementations
### Kyverno ClusterPolicy: Cryptographic OCI 1.1 Cosign In-Toto Attestation Validation

#### Bad Antipattern (AI Common Hallucination)
> **Why it fails**: Fails open with Audit mode, permits mutable tags, checks only a basic signature rather than OCI 1.1 referrers, ignores the Rekor transparency log, and completely omits In-Toto SBOM and SLSA provenance predicate validation.
```yaml
# INSECURE: Relies solely on mutable tag signature without SBOM or SLSA provenance verification
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
  name: check-image-signature
spec:
  validationFailureAction: Audit
  rules:
    - name: verify-signature
      match:
        any:
          - resources:
              kinds:
                - Pod
      verifyImages:
        - imageReferences:
            - "ghcr.io/org/*:*"
          key: |
            -----BEGIN PUBLIC KEY-----
            MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE...
            -----END PUBLIC KEY-----
```

#### Production Standard (Correct)
> **Standard**: Enforces Fail-Closed admission (`Enforce`), mutates and freezes tags to SHA-256 digests, validates keyless OCI 1.1 Fulcio identity and Rekor transparency logs, and explicitly verifies SLSA Provenance v1.0 and SPDX SBOM In-Toto predicates.
```yaml
# SECURE: Enforces strict immutable digests, Sigstore Keyless verification, Rekor logs, and In-Toto predicate assertions
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
  name: enforce-oci-intoto-attestation
spec:
  validationFailureAction: Enforce
  webhookTimeoutSeconds: 30
  rules:
    - name: verify-image-provenance-and-sbom
      match:
        any:
          - resources:
              kinds:
                - Pod
      verifyImages:
        - imageReferences:
            - "ghcr.io/org/*"
          mutateDigest: true
          verifyDigest: true
          required: true
          issuer: "https://token.actions.githubusercontent.com"
          subject: "https://github.com/org/repo/.github/workflows/release.yaml@refs/heads/main"
          rekor:
            url: "https://rekor.sigstore.dev"
          attestations:
            - predicateType: "https://slsa.dev/provenance/v1"
              conditions:
                - all:
                    - key: "{{ builder.id }}"
                      operator: Equals
                      value: "https://github.com/actions/runner"
            - predicateType: "https://spdx.dev/Document"
              conditions:
                - all:
                    - key: "{{ packages[].name }}"
                      operator: AnyIn
                      value: ["coreutils", "glibc"]
```

Architectural Specification & Invariant Rationale

Architectural Invariant Design: OCI 1.1 In-Toto Cosign Attestation Inline Admission Standard

OCI 1.1 In-Toto Cosign Attestation Inline Admission Standard defines an industrial-grade behavioral standard for security engineering. Enforces inline cryptographic validation of In-Toto Software Bill of Materials (SBOM) and SLSA provenance attestations via OCI 1.1 Referrers prior to container execution. Rejects any workload referencing mutable tags, unverified cryptographic signatures, missing transparency log inclusions, or non-compliant predicate schemas. 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 unpinned container tags or unverified client annotations instead of cryptographically signed OCI 1.1 In-Toto attestation trees 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 unpinned container tags or unverified client annotations instead of cryptographically signed OCI 1.1 In-Toto attestation treesCritical
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 reference container images strictly by immutable SHA-256 digest (`image@sha256

Engineers MUST ALWAYS reference container images strictly by immutable SHA-256 digest (`image@sha256:...`) at the admission boundary, mutating tags to digests automatically if not provided.

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 admit container images whose In-Toto attestations fail Sigstore Rekor inclusion checks or Fulcio SAN identity matching (e.g., issuer and subject repository assertions).

Engineers MUST NOT admit container images whose In-Toto attestations fail Sigstore Rekor inclusion checks or Fulcio SAN identity matching (e.g., issuer and subject repository assertions).

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

Admission policies MUST query OCI 1.1 referrers artifacts matching the `application/vnd.in-toto+json` media type attached directly to the image subject manifest digest.

Admission policies MUST query OCI 1.1 referrers artifacts matching the `application/vnd.in-toto+json` media type attached directly to the image subject manifest digest.

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

Code MUST validate that the attested In-Toto predicate payload contains a valid SBOM (SPDX 2.3 or CycloneDX 1.5+) and conformant SLSA Provenance v1.0 matching the expected source repository and build pipeline commit SHA.

Code MUST validate that the attested In-Toto predicate payload contains a valid SBOM (SPDX 2.3 or CycloneDX 1.5+) and conformant SLSA Provenance v1.0 matching the expected source repository and build pipeline commit SHA.

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

Admission controllers MUST FAIL CLOSED when verifying attestations

Admission controllers MUST FAIL CLOSED when verifying attestations; network timeouts, missing OCI 1.1 referrers endpoints, or invalid certificate chains must immediately deny workload admission.

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

Workload specifications MUST NOT bypass admission enforcement via insecure Pod annotations, unauthenticated registries, or local sidecar bypass patterns.

Workload specifications MUST NOT bypass admission enforcement via insecure Pod annotations, unauthenticated registries, or local sidecar bypass patterns.

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 OCI 1.1 In-Toto Cosign Attestation Inline Admission Standard critical for AI coding assistants?

Enforces inline cryptographic validation of In-Toto Software Bill of Materials (SBOM) and SLSA provenance attestations via OCI 1.1 Referrers prior to container execution. Rejects any workload referencing mutable tags, unverified cryptographic signatures, missing transparency log inclusions, or non-compliant predicate schemas. 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 unpinned container tags or unverified client annotations instead of cryptographically signed OCI 1.1 In-Toto attestation trees) 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

OCI