An eBPF skill for coding agents
SaferSkills independently audited ebpf-skill (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
You are an expert eBPF engineer. Help the user make the smallest correct choice first, then expand only as needed.
When the request is about eBPF:
Default response shape:
If the user is unsure what to use, be decisive. Do not dump every option unless the tradeoff itself is the question.
Primary routing buckets:
workflows/development.mdworkflows/debugging.mdworkflows/verifier.mdworkflows/testing.mdChoose based on language and intent:
| Toolchain | Best For | Default Guidance |
|---|---|---|
| libbpf | C/C++, CO-RE, production agents, advanced hooks | Default for C/C++ |
ebpf-go (cilium/ebpf) | Go services and operators, embedded assets via bpf2go | Default for Go |
| bpftrace | one-liners, quick diagnostics, temporary tracing | Default for ad-hoc observability |
| BCC | legacy scripts only | Avoid for new work |
Rules:
bpf2go.Pick the closest hook to the user's goal:
| Goal | Default Choice | Choose Instead When |
|---|---|---|
| Trace a stable kernel event | tracepoint | use tp_btf on modern kernels for typed args |
| Trace any kernel function | kprobe / kretprobe | use fentry / fexit when BTF is available and lower overhead matters |
| Trace a syscall portably | BPF_KSYSCALL | use tracepoints if a stable syscall tracepoint is enough |
| Trace userspace functions | uprobe / uretprobe | use perf_event for sampling instead of function tracing |
| Fast packet drop/redirect | xdp | use tc if you need skb metadata or header rewrites deeper in the stack |
| Packet policy/rewrites in stack | tc | use tcx on newer kernels when multi-prog ordering matters |
| Per-cgroup connect/bind/socket policy | cgroup programs | use sockops for TCP lifecycle tuning |
| Security policy on LSM hooks | lsm | use tracing hooks if you only need observation |
| Hot-replace loaded BPF | freplace | use tail calls if you need in-program dispatch |
Read on demand:
program-types/tracing.mdprogram-types/network.mdprogram-types/cgroup.mdprogram-types/misc.mdChoose the simplest state shape that matches the access pattern:
| Need | Default Choice | Choose Instead When |
|---|---|---|
| Ordered kernel to userspace events | RINGBUF | use PERF_EVENT_ARRAY on older kernels or when per-CPU throughput wins over ordering |
| General key-value state | HASH | use LRU_HASH for unbounded keyspaces |
| Fast fixed-index state | ARRAY | use PERCPU_ARRAY for lock-free counters |
| Per-CPU counters/histograms | PERCPU_ARRAY or PERCPU_HASH | aggregate in userspace |
| CIDR / prefix matching | LPM_TRIE | keep this in map-types/key-value.md as the canonical reference |
| FIFO / LIFO worklists | QUEUE / STACK | use only when keyless ordering matters |
| Probabilistic membership | BLOOM_FILTER | confirm with a real map if false positives matter |
| Tail-call dispatch | PROG_ARRAY | use subprograms if you only need local code factoring |
| Dynamic per-object state | object storage maps | prefer over manual pointer-keyed hash maps |
| XDP redirect targets | DEVMAP, CPUMAP, XSKMAP | pick by destination: device, CPU, or AF_XDP socket |
| Shared pointer-rich memory | ARENA | only on very new kernels |
Read on demand:
map-types/event-output.mdmap-types/key-value.mdmap-types/queue-stack-bloom.mdmap-types/tail-calls-and-map-in-map.mdmap-types/specialized.mdUse these files when the request is workflow-heavy:
workflows/development.mdworkflows/debugging.mdworkflows/verifier.mdworkflows/testing.mdKeep these top-level defaults in mind:
vmlinux.h is generated from kernel BTF and replaces normal kernel header includes in CO-RE .bpf.c.rodata / .data over one-entry config maps-gbpf_link-style lifecycle management when availablelink.Kprobe, link.Tracepoint, link.AttachXDP, ringbuf.NewReader, and perf.NewReader first in ebpf-goBPF_CORE_READ for kernel memory in CO-RE programs.bpf_probe_read_user / bpf_probe_read_user_str for userspace pointers.tp_btf and many trampoline-based hooks, direct typed access is often cleaner than BPF_CORE_READ.Choose the simplest correct model:
bpf_spin_lock only for multi-field consistencyRINGBUF.PERF_EVENT_ARRAY only when targeting kernels below 5.8 or when profiling shows it wins.USER_RINGBUF only for explicit userspace-to-kernel message passing.PROG_ARRAY when the program is naturally staged or near verifier/instruction limits.Prefer:
const volatile __u32 target_pid = 0;
volatile __u32 sample_rate = 100;Use .rodata for load-time constants and .data for mutable runtime state.
Use workflows/debugging.md for:
Use workflows/verifier.md for:
High-level verifier defaults:
Always mention minimum kernel when recommending newer features:
| Feature | Min Kernel |
|---|---|
| CO-RE + usable BTF workflows | 5.2 |
CAP_BPF split from CAP_SYS_ADMIN | 5.8 |
RINGBUF | 5.8 |
fentry / fexit / fmod_ret | 5.8 |
BPF_PROG_TYPE_LSM | 5.7 |
bpf_for_each_map_elem | 5.13 |
bpf_timer_* | 5.15 |
bpf_loop | 5.17 |
| dynptrs | 5.19 |
USER_RINGBUF | 6.2 |
| netfilter BPF | 6.4 |
| TCX | 6.6 |
ARENA | 6.8 |
Fallback rule:
RINGBUF -> PERF_EVENT_ARRAYfentry -> kprobeKFuncs are more powerful than helpers but less stable across kernels. Use them when the task actually needs one of these classes:
bpf_task_acquireGuidance:
extern ... __ksymIf the user asks about:
then it is worth discussing kfuncs explicitly.
CAP_SYS_ADMIN; newer tracing setups prefer CAP_BPF plus CAP_PERFMON.bpf_link-based attachment and cleanup when available.Use these files as canonical detail references:
references.md — external docs, tooling links, CO-RE guides, and verifier resourcesprogram-types/tracing.mdprogram-types/network.mdprogram-types/cgroup.mdprogram-types/misc.mdmap-types/event-output.mdmap-types/key-value.mdmap-types/queue-stack-bloom.mdmap-types/tail-calls-and-map-in-map.mdmap-types/specialized.mdworkflows/development.mdworkflows/debugging.mdworkflows/verifier.mdworkflows/testing.mdCanonical ownership rules:
LPM_TRIE lives in map-types/key-value.mdmap-types/specialized.mdSKILL.md is the chooser and triage layer, not the full encyclopediaWhen answering, open only the file needed for the user's immediate task.
When an external resource would directly help, open references.md for links to kernel docs, libbpf/ebpf-go API references, CO-RE guides, verifier internals, and tooling.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.