Architectural Invariant Design: eBPF LSM Tetragon Synchronous Kernel-Space Namespace Escape Containment
eBPF LSM Tetragon Synchronous Kernel-Space Namespace Escape Containment defines an industrial-grade behavioral standard for security engineering. Enforces in-kernel synchronous interception and termination of unauthorized container namespace crossings, capability gains, and privilege escalations using Cilium Tetragon and eBPF LSM hooks. Mandates proactive SIGKILL enforcement at the kernel level to eliminate asynchronous userspace audit bypasses and race conditions during container escapes. 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 | Relying on Asynchronous Userspace Audit Logs and Post-Facto SIEM Alerts for Container Namespace Escapes | 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 enforce synchronous in-kernel Sigkill terminations via Tetragon TracingPolicy CRDs targeting kernel LSM hooks (`security_bprm_creds_for_exec`, `security_file_open`) and syscall probes.
Engineers MUST ALWAYS enforce synchronous in-kernel Sigkill terminations via Tetragon TracingPolicy CRDs targeting kernel LSM hooks (`security_bprm_creds_for_exec`, `security_file_open`) and syscall probes.
Engineers MUST NOT configure namespace transition detection as passive audit-only alerts (`action
Engineers MUST NOT configure namespace transition detection as passive audit-only alerts (`action: Post`) when sensitive syscalls like `setns` or `unshare` are executed outside baseline workloads.
Code SHOULD explicitly isolate untrusted pod binaries by specifying PID, MNT, and USER namespace invariant checks inside Tetragon `matchNamespaces` and `matchArgs` selectors.
Code SHOULD explicitly isolate untrusted pod binaries by specifying PID, MNT, and USER namespace invariant checks inside Tetragon `matchNamespaces` and `matchArgs` selectors.
Services MUST bind Tetragon policies to LSM bpf probe types (`kprobe` fallback only when LSM kernel compile flags `CONFIG_BPF_LSM` are unavailable) to eliminate Time-of-Check to Time-of-Use (TOCTOU) races.
Services MUST bind Tetragon policies to LSM bpf probe types (`kprobe` fallback only when LSM kernel compile flags `CONFIG_BPF_LSM` are unavailable) to eliminate Time-of-Check to Time-of-Use (TOCTOU) races.
Components NEVER permit execution of binaries acquiring effective `CAP_SYS_ADMIN`, `CAP_SYS_PTRACE`, or `CAP_DAC_OVERRIDE` unless declared in a statically pinned, cryptographically verified allowlist.
Components NEVER permit execution of binaries acquiring effective `CAP_SYS_ADMIN`, `CAP_SYS_PTRACE`, or `CAP_DAC_OVERRIDE` unless declared in a statically pinned, cryptographically verified allowlist.
Frequently Asked Technical Questions
Common questions developers face when configuring AI coding assistants for this stack:
Q:Why is eBPF LSM Tetragon Synchronous Kernel-Space Namespace Escape Containment critical for AI coding assistants?
Enforces in-kernel synchronous interception and termination of unauthorized container namespace crossings, capability gains, and privilege escalations using Cilium Tetragon and eBPF LSM hooks. Mandates proactive SIGKILL enforcement at the kernel level to eliminate asynchronous userspace audit bypasses and race conditions during container escapes. 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 Userspace Audit Logs and Post-Facto SIEM Alerts for Container Namespace Escapes) 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.