This specification is maintained by the AgentRules Working Group. Have enhancements or want to claim maintainership?Submit Specification →
securitycritical PriorityID: tetragon-ebpf-lsm-inode-attestation-standard

Cilium Tetragon eBPF LSM Process Inode Attestation Standard

Enforces cryptographically signed binary provenance and strict inode attestation at the Linux Security Module (LSM) hook layer using Cilium Tetragon. Intercepts process initialization during bprm_check_security before memory mapping or execution occurs, deterministically killing unverified binaries to eliminate TOCTOU race conditions.

Prohibited Anti-Pattern: Post-Execve Asynchronous Telemetry and Brittle Path-Based Filtering Without Inode Attestation

Export Ready-to-Drop Configuration

Select format below to copy code or download file directly.

---
description: Cilium Tetragon eBPF LSM Process Inode Attestation Standard - Enforces cryptographically signed binary provenance and strict inode attestation at the Linux Security Module (LSM) hook layer using Cilium Tetragon. Intercepts process initialization during bprm_check_security before memory mapping or execution occurs, deterministically killing unverified binaries to eliminate TOCTOU race conditions.
globs: deploy/tetragon/**/*.yaml, k8s/**/*.yaml, policies/**/*.yaml, security/**/*.yaml
alwaysApply: true
verified_by: "agentrules.org"
license: "CC-BY-4.0"
source: "https://agentrules.org/rules/tetragon-ebpf-lsm-inode-attestation-standard"
---

# Cilium Tetragon eBPF LSM Process Inode Attestation Standard

> **Severity**: CRITICAL | **Category**: security
> **Anti-Pattern Warning**: Post-Execve Asynchronous Telemetry and Brittle Path-Based Filtering Without Inode Attestation

## System Constraints
You are a Principal Security Architect specializing in Linux kernel security and Cilium Tetragon eBPF enforcement. Mandate immutable binary provenance validation at the Linux LSM hook boundary. Enforce TracingPolicies that intercept bprm_check_security or bprm_creds_for_exec with kernel-level Sigkill or override actions, rejecting reliance on fragile userspace path matching or post-exec kprobe monitoring.

## Strict Guidelines
- Engineers MUST ALWAYS attach execution prevention policies to LSM hooks (e.g., `security_bprm_check` or `bprm_creds_for_exec`) rather than generic entry kprobes (`sys_execve`) to prevent Time-of-Check to Time-of-Use (TOCTOU) file substitution.
- Engineers MUST NOT rely on mutable filesystem paths (such as `/tmp` or `/bin/bash`) alone for process whitelisting; identification MUST be bound to immutable binary metadata, cryptographic digest validation, or verified filesystem mount namespaces.
- Policies MUST configure deterministic kernel-enforced actions (`Sigkill` or LSM return code overrides like `-EACCES`) directly within the in-kernel eBPF program when attestation invariants fail.
- Services MUST restrict read/write access to binary storage volumes, using immutable container images and read-only root filesystems alongside Tetragon policies to guarantee executable file immutability.
- Components NEVER execute untrusted dynamically generated scripts or anonymous memory payloads without verifiable kernel-level inode provenance validation.

## Bad vs Good Implementations
### LSM Inode Provenance and Exec Enforcement via Tetragon TracingPolicy

#### Bad Antipattern (AI Common Hallucination)
> **Why it fails**: Attaching to sys_execve via kprobes without an LSM hook executes purely in audit mode or after initial file parsing has begun. Path prefix matches are easily bypassed by copying binaries, symlinks, or executing via loaders (ld-linux.so), allowing unauthorized binaries to map into memory.
```yaml
apiVersion: cilium.io/v1alpha1
kind: TracingPolicy
metadata:
  name: audit-shell-executions
spec:
  kprobes:
    - call: "sys_execve"
      syscall: true
      args:
        - index: 0
          type: "string"
      selectors:
        - matchArgs:      
            - index: 0
              operator: "Prefix"
              values:
                - "/bin/sh"
                - "/bin/bash"
          # Flaw: Purely informational audit via kprobe.
          # Cannot block execution before memory mapping, and paths are vulnerable to symlinks/bind-mounts.
```

#### Production Standard (Correct)
> **Standard**: Attaches directly to the Linux Security Module bprm_check_security hook. Before the kernel maps the binary image into the process address space, Tetragon verifies the executable and immediately emits a synchronous Sigkill if provenance criteria are not met, preventing zero-day execution races.
```yaml
apiVersion: cilium.io/v1alpha1
kind: TracingPolicyNamespaced
metadata:
  name: block-unattested-binary-execution
  namespace: production-workloads
spec:
  lsmHooks:
    - hook: "bprm_check_security"
      args:
        - index: 0
          type: "linux_binprm"
      selectors:
        - matchArgs:
            - index: 0
              operator: "NotEqual"
              values:
                - "/usr/local/bin/trusted-app"
          matchNamespaces:
            - namespace: Pid
              operator: "In"
              values: ["host"]
          # Invariant: Block binary mapping immediately at the kernel LSM boundary
          matchActions:
            - action: Sigkill
```

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: Cilium Tetragon eBPF LSM Process Inode Attestation Standard

Cilium Tetragon eBPF LSM Process Inode Attestation Standard defines an industrial-grade behavioral standard for security engineering. Enforces cryptographically signed binary provenance and strict inode attestation at the Linux Security Module (LSM) hook layer using Cilium Tetragon. Intercepts process initialization during bprm_check_security before memory mapping or execution occurs, deterministically killing unverified binaries to eliminate TOCTOU race conditions. 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: Post-Execve Asynchronous Telemetry and Brittle Path-Based Filtering Without Inode Attestation 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 DriftPost-Execve Asynchronous Telemetry and Brittle Path-Based Filtering Without Inode AttestationCritical
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 attach execution prevention policies to LSM hooks (e.g., `security_bprm_check` or `bprm_creds_for_exec`) rather than generic entry kprobes (`sys_execve`) to prevent Time-of-Check to Time-of-Use (TOCTOU) file substitution.

Engineers MUST ALWAYS attach execution prevention policies to LSM hooks (e.g., `security_bprm_check` or `bprm_creds_for_exec`) rather than generic entry kprobes (`sys_execve`) to prevent Time-of-Check to Time-of-Use (TOCTOU) file substitution.

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 rely on mutable filesystem paths (such as `/tmp` or `/bin/bash`) alone for process whitelisting

Engineers MUST NOT rely on mutable filesystem paths (such as `/tmp` or `/bin/bash`) alone for process whitelisting; identification MUST be bound to immutable binary metadata, cryptographic digest validation, or verified filesystem mount namespaces.

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

Policies MUST configure deterministic kernel-enforced actions (`Sigkill` or LSM return code overrides like `-EACCES`) directly within the in-kernel eBPF program when attestation invariants fail.

Policies MUST configure deterministic kernel-enforced actions (`Sigkill` or LSM return code overrides like `-EACCES`) directly within the in-kernel eBPF program when attestation invariants fail.

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

Services MUST restrict read/write access to binary storage volumes, using immutable container images and read-only root filesystems alongside Tetragon policies to guarantee executable file immutability.

Services MUST restrict read/write access to binary storage volumes, using immutable container images and read-only root filesystems alongside Tetragon policies to guarantee executable file immutability.

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

Components NEVER execute untrusted dynamically generated scripts or anonymous memory payloads without verifiable kernel-level inode provenance validation.

Components NEVER execute untrusted dynamically generated scripts or anonymous memory payloads without verifiable kernel-level inode provenance validation.

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 Cilium Tetragon eBPF LSM Process Inode Attestation Standard critical for AI coding assistants?

Enforces cryptographically signed binary provenance and strict inode attestation at the Linux Security Module (LSM) hook layer using Cilium Tetragon. Intercepts process initialization during bprm_check_security before memory mapping or execution occurs, deterministically killing unverified binaries to eliminate TOCTOU race conditions. 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 (Post-Execve Asynchronous Telemetry and Brittle Path-Based Filtering Without Inode Attestation) 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

Cilium