This specification is maintained by the AgentRules Working Group. Have enhancements or want to claim maintainership?Submit Specification →
securitycritical PriorityID: cilium-tetragon-namespace-exfiltration-guardrail

Cilium Tetragon Kernel-Level Process Lineage and Namespace Containment Guardrail

Enforces strict eBPF-driven runtime verification of process parentage and Linux namespace boundaries via Cilium Tetragon TracingPolicies. Immediately terminates zero-day breakout attempts—such as unauthorized sys_setns, sys_unshare, and mount namespace tampering—directly in kernel space via SIGKILL before transition execution. Guarantees that container boundary escapes cannot succeed even if container isolation primitives or local capabilities are compromised.

Prohibited Anti-Pattern: Post-Facto Audit-Only Detection of Container Namespace Breakout Syscalls

Export Ready-to-Drop Configuration

Select format below to copy code or download file directly.

---
description: Cilium Tetragon Kernel-Level Process Lineage and Namespace Containment Guardrail - Enforces strict eBPF-driven runtime verification of process parentage and Linux namespace boundaries via Cilium Tetragon TracingPolicies. Immediately terminates zero-day breakout attempts—such as unauthorized sys_setns, sys_unshare, and mount namespace tampering—directly in kernel space via SIGKILL before transition execution. Guarantees that container boundary escapes cannot succeed even if container isolation primitives or local capabilities are compromised.
globs: deploy/**/*.yaml, k8s/**/*.yaml, charts/**/templates/*.yaml, tetragon/**/*.yaml, security/**/*.yaml
alwaysApply: true
verified_by: "agentrules.org"
license: "CC-BY-4.0"
source: "https://agentrules.org/rules/cilium-tetragon-namespace-exfiltration-guardrail"
---

# Cilium Tetragon Kernel-Level Process Lineage and Namespace Containment Guardrail

> **Severity**: CRITICAL | **Category**: security
> **Anti-Pattern Warning**: Post-Facto Audit-Only Detection of Container Namespace Breakout Syscalls

## System Constraints
You are a Principal Security Architect enforcing Cilium Tetragon eBPF Process Lineage & Namespace Exfiltration Guardrails. Mandate that all containerized workloads enforce synchronous, kernel-level boundary checks against privilege escalation and breakout syscalls (sys_setns, sys_unshare, pivot_root). Reject any architecture relying solely on user-space telemetry or audit-only alerts for container escape primitives.

## Strict Guidelines
- Engineers MUST ALWAYS configure Cilium Tetragon TracingPolicy or TracingPolicyNamespaced CRDs to intercept 'sys_enter_setns' and 'sys_enter_unshare' syscalls.
- Engineers MUST enforce synchronous kernel-level termination ('action: Sigkill') on unauthorized namespace hopping rather than passive log forwarding ('action: Post').
- TracingPolicies MUST strictly limit process lineage by validating 'matchBinaries' and 'matchArgs' against permitted container runtime binaries (e.g., runc, crun) when namespace manipulation is necessary.
- Services MUST NOT execute unconstrained containers with 'CAP_SYS_ADMIN' or 'CAP_SYS_PTRACE' without an active Tetragon kill-switch TracingPolicy bound to that workload namespace.
- Components NEVER permit shell binaries (e.g., /bin/sh, /bin/bash) or web application runtime workers to invoke namespace reconfiguration or privileged mount primitives.

## Bad vs Good Implementations
### Tetragon TracingPolicy: Namespace Breakout Prevention with Kernel-Level SIGKILL

#### Bad Antipattern (AI Common Hallucination)
> **Why it fails**: Using 'action: Post' merely logs the event asynchronously. By the time a SIEM or webhook processes the log, the attacker has already attached to the host namespace and compromised the node.
```yaml
# INSECURE: Passive monitoring with no enforcement; allows breakout to complete
apiVersion: cilium.io/v1alpha1
kind: TracingPolicy
metadata:
  name: audit-namespace-escape
spec:
  kprobes:
    - call: "sys_enter_setns"
      syscall: true
      args:
        - index: 0
          type: "int"
        - index: 1
          type: "int"
      selectors:
        - matchActions:
            - action: Post # Only sends an event to Hubble/stdout; process continues executing
```

#### Production Standard (Correct)
> **Standard**: This policy checks syscall arguments at the kernel boundary. If an unauthorized process invokes sys_setns targeting PID, Network, or Mount namespaces, Tetragon dispatches a SIGKILL directly via eBPF before the transition occurs.
```yaml
# SECURE: In-kernel enforcement terminating unauthorized namespace transitions
apiVersion: cilium.io/v1alpha1
kind: TracingPolicy
metadata:
  name: block-namespace-breakout
spec:
  kprobes:
    - call: "sys_enter_setns"
      syscall: true
      args:
        - index: 0
          type: "int"
        - index: 1
          type: "int"
      selectors:
        - matchArgs:
            - index: 1
              operator: "Mask"
              values:
                - "0x00020000" # CLONE_NEWNET
                - "0x00080000" # CLONE_NEWPID
                - "0x00000020" # CLONE_NEWNS (Mount)
          matchActions:
            - action: Sigkill # Terminate the attacking process synchronously in the kernel
            - action: Post    # Emit high-priority telemetry for SOC forensics
```

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 Kernel-Level Process Lineage and Namespace Containment Guardrail

Cilium Tetragon Kernel-Level Process Lineage and Namespace Containment Guardrail defines an industrial-grade behavioral standard for security engineering. Enforces strict eBPF-driven runtime verification of process parentage and Linux namespace boundaries via Cilium Tetragon TracingPolicies. Immediately terminates zero-day breakout attempts—such as unauthorized sys_setns, sys_unshare, and mount namespace tampering—directly in kernel space via SIGKILL before transition execution. Guarantees that container boundary escapes cannot succeed even if container isolation primitives or local capabilities are compromised. 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-Facto Audit-Only Detection of Container Namespace Breakout Syscalls 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-Facto Audit-Only Detection of Container Namespace Breakout SyscallsCritical
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 configure Cilium Tetragon TracingPolicy or TracingPolicyNamespaced CRDs to intercept 'sys_enter_setns' and 'sys_enter_unshare' syscalls.

Engineers MUST ALWAYS configure Cilium Tetragon TracingPolicy or TracingPolicyNamespaced CRDs to intercept 'sys_enter_setns' and 'sys_enter_unshare' syscalls.

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 enforce synchronous kernel-level termination ('action

Engineers MUST enforce synchronous kernel-level termination ('action: Sigkill') on unauthorized namespace hopping rather than passive log forwarding ('action: Post').

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

TracingPolicies MUST strictly limit process lineage by validating 'matchBinaries' and 'matchArgs' against permitted container runtime binaries (e.g., runc, crun) when namespace manipulation is necessary.

TracingPolicies MUST strictly limit process lineage by validating 'matchBinaries' and 'matchArgs' against permitted container runtime binaries (e.g., runc, crun) when namespace manipulation is necessary.

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 NOT execute unconstrained containers with 'CAP_SYS_ADMIN' or 'CAP_SYS_PTRACE' without an active Tetragon kill-switch TracingPolicy bound to that workload namespace.

Services MUST NOT execute unconstrained containers with 'CAP_SYS_ADMIN' or 'CAP_SYS_PTRACE' without an active Tetragon kill-switch TracingPolicy bound to that workload namespace.

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 permit shell binaries (e.g., /bin/sh, /bin/bash) or web application runtime workers to invoke namespace reconfiguration or privileged mount primitives.

Components NEVER permit shell binaries (e.g., /bin/sh, /bin/bash) or web application runtime workers to invoke namespace reconfiguration or privileged mount primitives.

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 Kernel-Level Process Lineage and Namespace Containment Guardrail critical for AI coding assistants?

Enforces strict eBPF-driven runtime verification of process parentage and Linux namespace boundaries via Cilium Tetragon TracingPolicies. Immediately terminates zero-day breakout attempts—such as unauthorized sys_setns, sys_unshare, and mount namespace tampering—directly in kernel space via SIGKILL before transition execution. Guarantees that container boundary escapes cannot succeed even if container isolation primitives or local capabilities are compromised. 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-Facto Audit-Only Detection of Container Namespace Breakout Syscalls) 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