agentleFS
salmandevsalmandev/everything-gemini/skills/ebpf-sandbox-enforcer/SKILL.md

ebpf-sandbox-enforcer

Skill2 starsChanged 29 days agoApache-2.0View on GitHub

Enforces zero-trust rootless micro-VM and eBPF kernel security boundaries for speculative agent tool executions and container sandboxes.

  • Reads credentials
  • Deletes or force-pushes

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Rootless Execution: Never execute autonomous agent commands as root (UID 0).

    line 99

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

eBPF Sandbox Enforcer & Zero-Trust Tool Isolation

Implements kernel-level zero-trust security isolation, rootless micro-VM sandboxing, Landlock filesystem restriction, and Cilium eBPF network filtering for speculative agent tool executions within Google Antigravity and Everything Gemini workflows.


1. Architecture: Kernel-Level Agent Sandboxing

┌─────────────────────────────────────────────────────────────────────────────┐
│                   KERNEL-LEVEL AGENT SECURITY BOUNDARY                      │
│                                                                             │
│   ┌─────────────────────────────────────────────────────────────────────┐   │
│   │ Speculative Agent Tool Execution (`run_command`, `write_to_file`)   │   │
│   └──────────────────────────────────┬──────────────────────────────────┘   │
│                                      │                                      │
│                                      ▼                                      │
│   ┌─────────────────────────────────────────────────────────────────────┐   │
│   │ 1. User-Space Policy Interceptor (`gemini-shield` & OPA Rego)       │   │
│   │    • Validates command AST, blocks `rm -rf`, detects token leakages │   │
│   └──────────────────────────────────┬──────────────────────────────────┘   │
│                                      │                                      │
│                                      ▼                                      │
│   ┌─────────────────────────────────────────────────────────────────────┐   │
│   │ 2. Linux Landlock & Seccomp-BPF Syscall Filter                      │   │
│   │    • Traps unauthorized `execve`, `ptrace`, `setuid`, and `chroot`  │   │
│   │    • Restricts filesystem I/O strictly to isolated `./scratch/` dir │   │
│   └──────────────────────────────────┬──────────────────────────────────┘   │
│                                      │                                      │
│                                      ▼                                      │
│   ┌─────────────────────────────────────────────────────────────────────┐   │
│   │ 3. Cilium eBPF Socket Filter (L3/L4/L7 Network Egress)             │   │
│   │    • Blocks outbound internet access to non-whitelisted IPs         │   │
│   │    • Allows Google Cloud APIs (`*.googleapis.com`) on TLS 443      │   │
│   │    • Drops all lateral movement probes to internal Kubernetes pods  │   │
│   └─────────────────────────────────────────────────────────────────────┘   │
└─────────────────────────────────────────────────────────────────────────────┘

2. Kernel Enforcement Mechanisms

A. Landlock Filesystem Sandboxing

Speculative agent mutations are restricted to the local workspace directory or an ephemeral scratch area. System directories (/etc, /usr, /root, ~/.ssh) are marked strictly LANDLOCK_ACCESS_FS_READ or completely denied:

// Example Landlock ruleset structure for agent tool sandbox
#include <linux/landlock.h>
#include <sys/prctl.h>

int enforce_agent_landlock(const char *allowed_dir) {
    int ruleset_fd = landlock_create_ruleset(&ruleset_attr, sizeof(ruleset_attr), 0);
    // Add rule: allowed_dir gets read/write/truncate/execute
    // System directories remain read-only or inaccessible
    prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0);
    landlock_restrict_self(ruleset_fd, 0);
    return 0;
}

B. Cilium eBPF Network Security Policy (CNP)

Prevents data exfiltration or reverse shells when the agent runs third-party build scripts or untrusted dependencies:

apiVersion: "cilium.io/v2"
kind: CiliumNetworkPolicy
metadata:
  name: "agent-tool-sandbox-egress"
spec:
  endpointSelector:
    matchLabels:
      role: "autonomous-agent-worker"
  egress:
    - toFQDNs:
        - matchPattern: "*.googleapis.com"
        - matchName: "github.com"
      toPorts:
        - ports:
            - port: "443"
              protocol: TCP
    - toEntities:
        - cluster
      toPorts:
        - ports:
            - port: "53"
              protocol: UDP

3. Best Practices & Isolation Checklist

  1. Rootless Execution: Never execute autonomous agent commands as root (UID 0). Always run inside an unprivileged user namespace (UID 10001).
  2. Ephemeral Disks: Speculative test runs must target tmpfs or overlayfs volumes that can be unmounted and discarded in $<100\text{ms}$.
  3. Audit Telemetry: Feed eBPF syscall audit logs (bpftool prog tracelog) into the Mission Control UI to detect anomalous fork storms or socket scans.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.