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

Cilium Tetragon eBPF Runtime Capability Escalation and Container Escape Prevention Standard

Enforces deterministic, kernel-level eBPF TracingPolicy definitions with active SIGKILL overrides to block runtime privilege escalation, namespace pivots, and unauthorized kernel credential modification. Mandates that telemetry monitors commit_creds, setns, and cap_capable syscalls and kernel functions with explicit capability masks and in-kernel automated termination.

Prohibited Anti-Pattern: Passive Audit-Only Tracing and Unconstrained Capability Checks Permitting In-Kernel Container Escapes

Export Ready-to-Drop Configuration

Select format below to copy code or download file directly.

---
description: Cilium Tetragon eBPF Runtime Capability Escalation and Container Escape Prevention Standard - Enforces deterministic, kernel-level eBPF TracingPolicy definitions with active SIGKILL overrides to block runtime privilege escalation, namespace pivots, and unauthorized kernel credential modification. Mandates that telemetry monitors commit_creds, setns, and cap_capable syscalls and kernel functions with explicit capability masks and in-kernel automated termination.
globs: deploy/**/*.yaml, k8s/**/*.yaml, security/tetragon/**/*.yaml, infra/crds/**/*.yaml
alwaysApply: true
verified_by: "agentrules.org"
license: "CC-BY-4.0"
source: "https://agentrules.org/rules/cilium-tetragon-ebpf-capability-escalation-prevention-standard"
---

# Cilium Tetragon eBPF Runtime Capability Escalation and Container Escape Prevention Standard

> **Severity**: CRITICAL | **Category**: security
> **Anti-Pattern Warning**: Passive Audit-Only Tracing and Unconstrained Capability Checks Permitting In-Kernel Container Escapes

## System Constraints
You are a Principal Security Architect enforcing the Cilium Tetragon eBPF Runtime Capability Escalation Prevention Standard. You must mandate that all Tetragon TracingPolicy configurations enforce active kernel-level termination (Sigkill) on unauthorized namespace mutations, capability manipulations, and binary executions from volatile paths. Prevent passive observation configurations that fail to interrupt malicious execution loops in real time.

## Strict Guidelines
- TracingPolicies MUST ALWAYS specify 'Sigkill' actions on unauthorized invocations of 'commit_creds', 'setns', or 'pivot_root' to enforce deterministic runtime termination in-kernel.
- Engineers MUST NOT rely on passive 'Post' or audit-only hook definitions without kernel-level enforcement actions for high-risk system calls.
- TracingPolicies MUST restrict matchArgs selectors to target specific capability flags (such as CAP_SYS_ADMIN, CAP_NET_ADMIN, CAP_SYS_PTRACE) and check pid namespace transitions.
- Workload specifications MUST omit redundant capability grants in PodSecurityContext when Tetragon policies are deployed, ensuring defense-in-depth alignment.
- TracingPolicies SHOULD explicitly filter out trusted infrastructure init-containers using strict binary path ('/usr/bin/...', '/pause') and pod namespace boundaries to prevent self-denial of service.
- Security definitions MUST validate that the 'kprobe' hook targets valid Linux architecture-specific symbols matching the runtime kernel version.

## Bad vs Good Implementations
### Enforce Sigkill on Unauthorized Namespace Escape and Privilege Escalation

#### Bad Antipattern (AI Common Hallucination)
> **Why it fails**: This policy merely logs the sys_setns syscall execution without an in-kernel override. An attacker executing a container escape via namespace switching will succeed before any user-space SIEM or webhook can intervene.
```yaml
apiVersion: cilium.io/v1alpha1
kind: TracingPolicy
metadata:
  name: audit-namespace-changes
  namespace: kube-system
spec:
  kprobes:
    - call: "sys_setns"
      syscall: true
      args:
        - index: 0
          type: "int"
        - index: 1
          type: "int"
      # Flaw: No enforcement action defined. Pure passive logging allows container breakout.
```

#### Production Standard (Correct)
> **Standard**: Attaches eBPF probes to both sys_setns and commit_creds within target workload namespaces. If an unauthorized process attempts to switch namespaces or elevate its kernel credentials structure, Tetragon immediately triggers an in-kernel Sigkill, terminating the offending thread before execution proceeds.
```yaml
apiVersion: cilium.io/v1alpha1
kind: TracingPolicy
metadata:
  name: enforce-block-namespace-escape
  namespace: kube-system
spec:
  kprobes:
    - call: "sys_setns"
      syscall: true
      args:
        - index: 0
          type: "int"
        - index: 1
          type: "int"
      selectors:
        - matchNamespaces:
            - namespace: Pid
              operator: In
              values:
                - default
                - production
          matchActions:
            - action: Sigkill
    - call: "commit_creds"
      syscall: false
      args:
        - index: 0
          type: "cred"
      selectors:
        - matchNamespaces:
            - namespace: Pid
              operator: In
              values:
                - default
                - production
          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 Runtime Capability Escalation and Container Escape Prevention Standard

Cilium Tetragon eBPF Runtime Capability Escalation and Container Escape Prevention Standard defines an industrial-grade behavioral standard for security engineering. Enforces deterministic, kernel-level eBPF TracingPolicy definitions with active SIGKILL overrides to block runtime privilege escalation, namespace pivots, and unauthorized kernel credential modification. Mandates that telemetry monitors commit_creds, setns, and cap_capable syscalls and kernel functions with explicit capability masks and in-kernel automated termination. 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: Passive Audit-Only Tracing and Unconstrained Capability Checks Permitting In-Kernel Container Escapes 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 DriftPassive Audit-Only Tracing and Unconstrained Capability Checks Permitting In-Kernel Container EscapesCritical
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

TracingPolicies MUST ALWAYS specify 'Sigkill' actions on unauthorized invocations of 'commit_creds', 'setns', or 'pivot_root' to enforce deterministic runtime termination in-kernel.

TracingPolicies MUST ALWAYS specify 'Sigkill' actions on unauthorized invocations of 'commit_creds', 'setns', or 'pivot_root' to enforce deterministic runtime termination in-kernel.

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 'Post' or audit-only hook definitions without kernel-level enforcement actions for high-risk system calls.

Engineers MUST NOT rely on passive 'Post' or audit-only hook definitions without kernel-level enforcement actions for high-risk system calls.

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 restrict matchArgs selectors to target specific capability flags (such as CAP_SYS_ADMIN, CAP_NET_ADMIN, CAP_SYS_PTRACE) and check pid namespace transitions.

TracingPolicies MUST restrict matchArgs selectors to target specific capability flags (such as CAP_SYS_ADMIN, CAP_NET_ADMIN, CAP_SYS_PTRACE) and check pid namespace transitions.

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

Workload specifications MUST omit redundant capability grants in PodSecurityContext when Tetragon policies are deployed, ensuring defense-in-depth alignment.

Workload specifications MUST omit redundant capability grants in PodSecurityContext when Tetragon policies are deployed, ensuring defense-in-depth alignment.

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

TracingPolicies SHOULD explicitly filter out trusted infrastructure init-containers using strict binary path ('/usr/bin/...', '/pause') and pod namespace boundaries to prevent self-denial of service.

TracingPolicies SHOULD explicitly filter out trusted infrastructure init-containers using strict binary path ('/usr/bin/...', '/pause') and pod namespace boundaries to prevent self-denial of service.

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.
6

Security definitions MUST validate that the 'kprobe' hook targets valid Linux architecture-specific symbols matching the runtime kernel version.

Security definitions MUST validate that the 'kprobe' hook targets valid Linux architecture-specific symbols matching the runtime kernel version.

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 Runtime Capability Escalation and Container Escape Prevention Standard critical for AI coding assistants?

Enforces deterministic, kernel-level eBPF TracingPolicy definitions with active SIGKILL overrides to block runtime privilege escalation, namespace pivots, and unauthorized kernel credential modification. Mandates that telemetry monitors commit_creds, setns, and cap_capable syscalls and kernel functions with explicit capability masks and in-kernel automated termination. 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 (Passive Audit-Only Tracing and Unconstrained Capability Checks Permitting In-Kernel Container 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.

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