Aegis

Trace the agent, not the SDK

Visit Repo
Aegis banner

About

## Challenges we ran into

## Challenges we ran into

**eBPF CO-RE portability.** On kernels older than 5.x with BTF, `CO-RE` relocations silently fail and probes misbehave or return `-ENOENT`. Implemented architecture-specific header backports (`vmlinux/`) for x86, arm64, arm, riscv and falls back to hardcoded booleans in `process.h`. The `make install` step documents this; pre-existing broken kernel installs are not patched automatically.

**Statically-linked SSL binaries (BoringSSL / OpenSSL).** Claude/Bun and NVM Node.js embed their own SSL library so there is no system `libssl.so` to hook by default. Resolved with byte-pattern detection in `sslsniff` and auto-discovery of the launched binary via `record -- <command>` plus per-framework profile `entry_comm`. The fix required careful `--comm`-vs-`--binary-path` logic because `bpf_get_current_comm()` returns the thread name ("HTTP Client"), which would otherwise drop all SSL events.

**Profile drift between `lsm=bpf` and failure-open paths.** Plain `aks stop` keeps map pins but kills enforcement; `kill -9` detaches links entirely — the documented gap. Backed this up with the rollback doc that clearly names the future TODO and provides host recovery (reboot with `lsm=bpf` removed, `rm -rf /sys/fs/bpf/aks`, fixed profile).

**Monorepo lockfile churn after rename.** Routing `agentpprof`, `ext/vis/web`, `collector/vendor` build outputs through `sync-version.mjs`; stale `Cargo.lock` files carry old version metadata and broke `cargo test --locked` until manually regenerated after the rename. Now guarded by CI section that runs `generate-lockfile`.

**npm package name collision.** Original packaging under `@eunomia-bpf/agentsight`; CI copies it to crate/registry names. Renamed to `@aegis-oss/agentsight` consistently across `package/npm/`, `script/npm/prepare-agentsight.mjs`, `Cargo.toml`, and CI publish step.

**Static analysis / evidence gap when vendor dist contains residual source strings.** Pre-built frontend bundles (`collector/vendor/dist/*`) embed text from scripts renamed at runtime; the global `grep` audit flagged `brandwrap-agent-nebula` in a GIF caption and `project:agentsight` in a folded-stack file. Deleted those artifacts and rewrote names. Same class of issue in `bpf/test*.c` noise addresses and experiment `latest_ai_development` package prefixes — handled uniformly at repo level, not ad hoc per component.

## The problem it solves

## The problem it solves

AI agents (Claude Code, Gemini CLI, Ollama, Cursor) can execute arbitrary commands, open files, open network connections, and spawn child processes — often without the user knowing which prompt caused which effect. Existing observability requires SDK integration, proxy routing, or agent-native logging that can be disabled, incomplete, or unavailable for closed-source CLI tools.

Aegis solves this at the kernel boundary instead of inside the agent:

**Invisible child processes.** Agents spawn `node`, `python3`, `git`, `sh`, and other descendants that share process names with unrelated system processes. Without PID lineage tracking (`sched_process_exec`/`fork`/`exit` tracepoints), an enforcer either misses agent children or flags unrelated system daemons. Aegis follows the agent process tree so every child is correctly attributed.

**Opaque TLS traffic.** LLM traffic is encrypted end-to-end. Gateway/proxy tools only see it if you route through them; SDK-based tools only see it if the agent uses them. Aegis hooks `SSL_read`/`SSL_write` via uprobes and captures plaintext at the syscall boundary without proxy or SDK changes, even for statically-linked binaries (BoringSSL / OpenSSL).

**No per-framework policy.** A `claude-code` session, `gemini-cli` run, and `ollama` inference have different allowed paths, network targets, and command patterns. One static profile either over-permits (unsafe) or over-restricts (breaks functionality). Aegis loads YAML profiles per framework (`entry_comm`, allowed networks, denied paths, command allowlists) and evaluates against them inline.

**Audit without correlation.** When a run fails, stalls, or behaves unexpectedly, logs rarely link the failing prompt to the file that changed, the subprocess that spawned, or the network connection that exfiltrated data. Aegis correlates LLM traffic with system events through the process-tree + syscall sequence, producing a trace from prompt → tool call → subprocess → file/network effect.

**Reactive vs. preventive enforcement.** Most tools observe after the fact. Aegis uses eBPF LSM hooks (`file_open`, `socket_connect`, `bprm_check`) to evaluate against the loaded profile before the syscall completes, returning `ALLOW`/`BLOCK` at kernel level. Fail-closed (enforcement continues until daemon exits with pinned links) is documented; unpinned links after `kill -9` remain an open gap tracked in rollback docs.

**Use cases:**

- Secure CI/CD runners that run AI agent commands — enforce allowed paths and deny unexpected network to a CI node - Developer workstation audit — trace which prompt caused a `git clone` or file write to `~/.ssh` - Agent marketplace / sandbox testing — validate that an agent binary only touches allowed directories and connects only to expected endpoints - Incident response — export `aegis-*.db` SQLite session with full syscall audit for forensic review - Safety research — observe how agents behave with untrusted prompts (prompt injection detection) without relying on agent self-reporting

## How it works

```mermaid

flowchart LR A["AI agent process<br/>claude / gemini / node / ollama"] -->|syscalls| B["Linux Kernel<br/>eBPF LSM hooks"] B -->|ringbuf events| C["Aegis daemon<br/>profile → ALLOW / BLOCK"] C -->|JSON + SSE| D["Audit log / Web UI :7395"] ```

  • **Kernel layer** (`bpf/`): C programs observe `file_open`, `socket_connect`, and `bprm_check`; emit JSONL via ring buffer.
  • **Process lineage** (`bpf/probe.c`): tracks agent process trees by PID through `sched_process_exec`, `sched_process_fork`, and `sched_process_exit` to attribute child processes (`node`, `sh`, `git`) correctly.
  • **Profiles** (`profiles/`): YAML files defining allowed paths, networks, and commands per framework.
  • **Detector** (`internal/detector`): evaluates kernel events against loaded profile.
  • **Audit** (`internal/audit`): JSON line per decision (ALLOW/BLOCK) with reason.
  • **Web UI** (`internal/ui`): real-time SSE feed with BLOCK/ALLOW badges.

Screenshots

Aegis screenshot 1Aegis screenshot 2

Team

From the public Devfolio project page. Votes, swipes and the judge score are hackfeed's own.

AI judge

Not judged yet. A free model reads this page, compares it with similar projects and this event's winners, then scores it and says what would make it win.

Still being built?

Not checked yet.

Swipe stats

0upvotes
0skips
0saves

Discussion 0

No comments yet. Ask the team something, or say what you'd use it for.

Posting as a guest. Plain text, 1,000 characters max.

Already built nearby

Closest projects by meaning and shared words. Similar isn't the same as copied: read them.