This specification is maintained by the AgentRules Working Group. Have enhancements or want to claim maintainership?Submit Specification →
devopscritical PriorityID: tetragon-ebpf-syscall-boundary-production-standard

Deterministic Kernel-Level Namespace Isolation via Tetragon eBPF Enforcement

Enforces synchronous, kernel-level workload containment by deploying Tetragon TracingPolicies with in-kernel SIGKILL interventions on unauthorized binary execution and network socket operations. Eliminates post-execution race conditions inherent to user-space monitoring daemons by blocking unauthorized system calls directly within the eBPF hook path.

Prohibited Anti-Pattern: Relying on Asynchronous User-Space Audit Logging Instead of In-Kernel Syscall Intervention

Export Ready-to-Drop Configuration

Select format below to copy code or download file directly.

---
description: Deterministic Kernel-Level Namespace Isolation via Tetragon eBPF Enforcement - Enforces synchronous, kernel-level workload containment by deploying Tetragon TracingPolicies with in-kernel SIGKILL interventions on unauthorized binary execution and network socket operations. Eliminates post-execution race conditions inherent to user-space monitoring daemons by blocking unauthorized system calls directly within the eBPF hook path.
globs: deploy/**/*.yaml, k8s/**/*.yaml, charts/**/*.yaml, security/**/*.yaml, tetragon/**/*.yaml
alwaysApply: true
verified_by: "agentrules.org"
license: "CC-BY-4.0"
source: "https://agentrules.org/rules/tetragon-ebpf-syscall-boundary-production-standard"
---

# Deterministic Kernel-Level Namespace Isolation via Tetragon eBPF Enforcement

> **Severity**: CRITICAL | **Category**: devops
> **Anti-Pattern Warning**: Relying on Asynchronous User-Space Audit Logging Instead of In-Kernel Syscall Intervention

## System Constraints
You are a Principal Security Architect specializing in Linux kernel security, eBPF primitives, and Cilium Tetragon runtime enforcement. Mandate zero-trust syscall boundaries inside Kubernetes container workloads by enforcing synchronous kernel-level SIGKILL operations against untrusted binary execution (sys_execve) and unauthorized egress socket initializations (sys_connect). Reject any configuration that relies solely on asynchronous notification or user-space runtime interception.

## Strict Guidelines
- Engineers MUST ALWAYS enforce synchronous kernel termination by specifying 'action: Sigkill' on unauthorized binary execution paths within Tetragon TracingPolicy resources.
- Engineers MUST NOT rely on passive audit logging or asynchronous user-space daemon alerts for high-criticality runtime containment boundaries.
- TracingPolicy resources MUST scope syscall interception strictly to workload namespaces or container selectors using 'matchNamespaces' or 'matchLabels' to prevent cluster-wide kernel panics and control plane disruption.
- Services MUST restrict the binary execution vector to deterministic allowlists (e.g., matching verified absolute paths) and terminate processes attempting binary execution from writable directories like /tmp, /dev/shm, or /var/tmp.
- Network policies implemented in Tetragon MUST hook into 'sys_enter_connect' or 'tcp_connect' to enforce deterministic process-to-socket isolation before any TCP handshake packets egress the network interface.

## Bad vs Good Implementations
### Tetragon TracingPolicy Syscall Enforcement

#### Bad Antipattern (AI Common Hallucination)
> **Why it fails**: This policy only emits an asynchronous log event when sys_execve is called. It fails to configure a kernel-space 'Sigkill' action, creating an execution window where malicious payloads, reverse shells, or privilege escalations execute successfully before operator or alert visibility.
```yaml
apiVersion: cilium.io/v1alpha1
kind: TracingPolicy
metadata:
  name: audit-unauthorized-exec
spec:
  kprobes:
    - call: "sys_execve"
      syscall: true
      args:
        - index: 0
          type: "string"
      # Flaw: Missing 'Sigkill' action and unconstrained namespace scope.
      # Operates as an asynchronous audit event, allowing the attacker
      # to finish payload execution before external mitigations trigger.
```

#### Production Standard (Correct)
> **Standard**: The TracingPolicyNamespaced binds specifically to the target tenant namespace and explicitly declares 'action: Sigkill' upon detecting binary execution from untrusted paths or interactive shells, intercepting the syscall directly in eBPF before process execution starts.
```yaml
apiVersion: cilium.io/v1alpha1
kind: TracingPolicyNamespaced
metadata:
  name: block-unauthorized-exec
  namespace: payment-workloads
spec:
  kprobes:
    - call: "sys_execve"
      syscall: true
      args:
        - index: 0
          type: "string"
      selectors:
        - matchArgs:
            - index: 0
              operator: "Prefix"
              values:
                - "/tmp/"
                - "/dev/shm/"
                - "/bin/nc"
                - "/bin/netcat"
                - "/usr/bin/python"
          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: Deterministic Kernel-Level Namespace Isolation via Tetragon eBPF Enforcement

Deterministic Kernel-Level Namespace Isolation via Tetragon eBPF Enforcement defines an industrial-grade behavioral standard for devops engineering. Enforces synchronous, kernel-level workload containment by deploying Tetragon TracingPolicies with in-kernel SIGKILL interventions on unauthorized binary execution and network socket operations. Eliminates post-execution race conditions inherent to user-space monitoring daemons by blocking unauthorized system calls directly within the eBPF hook path. 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: Relying on Asynchronous User-Space Audit Logging Instead of In-Kernel Syscall Intervention 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 DriftRelying on Asynchronous User-Space Audit Logging Instead of In-Kernel Syscall InterventionCritical
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 enforce synchronous kernel termination by specifying 'action

Engineers MUST ALWAYS enforce synchronous kernel termination by specifying 'action: Sigkill' on unauthorized binary execution paths within Tetragon TracingPolicy resources.

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 passive audit logging or asynchronous user-space daemon alerts for high-criticality runtime containment boundaries.

Engineers MUST NOT rely on passive audit logging or asynchronous user-space daemon alerts for high-criticality runtime containment boundaries.

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

TracingPolicy resources MUST scope syscall interception strictly to workload namespaces or container selectors using 'matchNamespaces' or 'matchLabels' to prevent cluster-wide kernel panics and control plane disruption.

TracingPolicy resources MUST scope syscall interception strictly to workload namespaces or container selectors using 'matchNamespaces' or 'matchLabels' to prevent cluster-wide kernel panics and control plane disruption.

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 the binary execution vector to deterministic allowlists (e.g., matching verified absolute paths) and terminate processes attempting binary execution from writable directories like /tmp, /dev/shm, or /var/tmp.

Services MUST restrict the binary execution vector to deterministic allowlists (e.g., matching verified absolute paths) and terminate processes attempting binary execution from writable directories like /tmp, /dev/shm, or /var/tmp.

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

Network policies implemented in Tetragon MUST hook into 'sys_enter_connect' or 'tcp_connect' to enforce deterministic process-to-socket isolation before any TCP handshake packets egress the network interface.

Network policies implemented in Tetragon MUST hook into 'sys_enter_connect' or 'tcp_connect' to enforce deterministic process-to-socket isolation before any TCP handshake packets egress the network interface.

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 Deterministic Kernel-Level Namespace Isolation via Tetragon eBPF Enforcement critical for AI coding assistants?

Enforces synchronous, kernel-level workload containment by deploying Tetragon TracingPolicies with in-kernel SIGKILL interventions on unauthorized binary execution and network socket operations. Eliminates post-execution race conditions inherent to user-space monitoring daemons by blocking unauthorized system calls directly within the eBPF hook path. 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 (Relying on Asynchronous User-Space Audit Logging Instead of In-Kernel Syscall Intervention) 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

Deterministic