Architectural Invariant Design: eBPF Tetragon In-Kernel Namespace Escape Detection & Synchronous Kill Standard
eBPF Tetragon In-Kernel Namespace Escape Detection & Synchronous Kill Standard defines an industrial-grade behavioral standard for devops engineering. Enforces real-time, in-kernel syscall mediation using Cilium Tetragon TracingPolicies to terminate container namespace breakout vectors before execution completes. Mandates synchronous Sigkill actions directly within the BPF hook for unauthorized pivot attempts (setns, unshare, mount injection, and cap_capable escalation), preventing user-space detection lag and race conditions. 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 Passive Post-Execution Telemetry Without In-Kernel Enforcement for Container Breakouts | 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:
TracingPolicies MUST define synchronous in-kernel enforcement (`action
TracingPolicies MUST define synchronous in-kernel enforcement (`action: Sigkill`) for unauthorized `sys_enter_setns` and `sys_enter_unshare` invocations originating from containerized workloads.
Engineers MUST NOT rely on asynchronous user-space export filters (e.g., Fluent Bit, Tetragon JSON telemetry streams) to reactively revoke breakout processes, as adversary code executes before user space processes events.
Engineers MUST NOT rely on asynchronous user-space export filters (e.g., Fluent Bit, Tetragon JSON telemetry streams) to reactively revoke breakout processes, as adversary code executes before user space processes events.
TracingPolicies MUST strictly scope match conditions using `matchNamespaces` and `matchPIDs` operators to avoid false positives and prevent accidental termination of legitimate host daemons (e.g., kubelet, container runtime).
TracingPolicies MUST strictly scope match conditions using `matchNamespaces` and `matchPIDs` operators to avoid false positives and prevent accidental termination of legitimate host daemons (e.g., kubelet, container runtime).
TracingPolicies targeting privilege escalation via capabilities MUST monitor `security_capable` or `cap_capable` kprobes and terminate processes requesting `CAP_SYS_ADMIN` or `CAP_SYS_PTRACE` within isolated container cgroups.
TracingPolicies targeting privilege escalation via capabilities MUST monitor `security_capable` or `cap_capable` kprobes and terminate processes requesting `CAP_SYS_ADMIN` or `CAP_SYS_PTRACE` within isolated container cgroups.
Every production Tetragon rule MUST pair every `Sigkill` or `Override` action with structured event metadata including process lineage, target namespace file descriptors, and destination mount points.
Every production Tetragon rule MUST pair every `Sigkill` or `Override` action with structured event metadata including process lineage, target namespace file descriptors, and destination mount points.
Engineers MUST ensure TracingPolicies validate the file descriptor target in `setns` using `matchArgs` operators to forbid target transitions into parent or host PID/MNT/NET namespaces.
Engineers MUST ensure TracingPolicies validate the file descriptor target in `setns` using `matchArgs` operators to forbid target transitions into parent or host PID/MNT/NET namespaces.
Frequently Asked Technical Questions
Common questions developers face when configuring AI coding assistants for this stack:
Q:Why is eBPF Tetragon In-Kernel Namespace Escape Detection & Synchronous Kill Standard critical for AI coding assistants?
Enforces real-time, in-kernel syscall mediation using Cilium Tetragon TracingPolicies to terminate container namespace breakout vectors before execution completes. Mandates synchronous Sigkill actions directly within the BPF hook for unauthorized pivot attempts (setns, unshare, mount injection, and cap_capable escalation), preventing user-space detection lag and 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 (Relying on Passive Post-Execution Telemetry Without In-Kernel Enforcement for Container Breakouts) 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.