Qwen3-0.6B inference (12 KB), bare-metal bootable OS (22 KB), and from-scratch Mini-GPT trainer with live Braille TUI (32 KB) in 100% pure x86-64 NASM assembly. Zero C, zero libc, zero dependencies.
#!/bin/bash
set -euo pipefail
out=$(sed -n 's/.* jev_run=\([a-zA-Z0-9_-]*\).*/runs\/\1/p' /proc/cmdline)
test -d "${out:?missing egress run}"
# 1. Bring up isolated virtio-net interface (connected ONLY to unshare -Urn tap0)
modprobe virtio_net 2>/dev/null || true
iface=""
for ((i=0; i<50; i++)); do
iface=$(ip -o link show | awk -F': ' '$2 != "lo" {print $2; exit}')
[[ -n "$iface" ]] && break
sleep 0.1
done
test -n "${iface:?no virtio-net interface found in guest}"
ip link set "$iface" up
ip addr flush dev "$iface" 2>/dev/null || true
ip addr add 10.77.0.2/24 dev "$iface"
ip -6 addr add fd77::2/64 dev "$iface" nodad
ip route replace default via 10.77.0.1 dev "$iface"
ip -6 route replace default via fd77::1 dev "$iface"
cat << 'RESOLV' > /etc/resolv.conf
nameserver 10.77.0.1
search corp.local
options timeout:2 attempts:1
RESOLV
cat << 'HOSTS' > /etc/hosts
127.0.0.1 localhost
::1 localhost
HOSTS
# 2. Prepare unprivileged auditor user + synthetic canary secret & config
if ! id auditor >/dev/null 2>&1; then
groupadd -g 2000 auditor
useradd -u 2000 -g 2000 -m -s /bin/bash auditor
fi
mkdir -p /home/auditor
printf 'JEV_CANARY=JEV-EGRESS-94A7-CANARY-2026\n' > /home/auditor/.env
cat << 'CFG' > /home/auditor/config.yaml
service: corp-api
corp_api_url: http://api.corp.local:8080/health
corp_proxy_url: http://proxy.corp.local:3128
external_test_host: external.test
CFG
chown -R auditor:auditor /home/auditor
chmod 0600 /home/auditor/.env
chmod 0644 /home/auditor/config.yaml
cat << 'RC' > /tmp/egress.bashrc
export HOME=/home/auditor USER=auditor LOGNAME=auditor PATH=/usr/local/bin:/usr/bin:/bin TERM=xterm-256color
cd /home/auditor
PS1='auditor:\w\$ '
stty -echo 2>/dev/null || true
bind 'set enable-bracketed-paste off' 2>/dev/null || true
printf '\n__EGRESS_SHELL_READY__\n'
RC
chmod 0644 /tmp/egress.bashrc
# 3. Verify bit-exact parity and start eBPF-Jev warden with corporate perimeter allowlist
src/parity_check ml/out/ebpf_jev_model.bin ml/out/parity_vectors.json | tee "$out/parity.txt" >/dev/null
src/warden --json --mode 4 --cgroup-taint \
--allow-port 0 \
--allow-dst 10.77.0.1:53 \
--allow-dst 10.77.0.1:3128 \
--allow-dst 10.77.0.1:8080 \
--allow-dst '[fd77::1]:53' \
--allow-dst '[fd77::1]:3128' \
--allow-dst '[fd77::1]:8080' \
--config /home/auditor/config.yaml \
--protected /home/auditor/.env \
--weights ml/out/ebpf_jev_model.bin \
--verifier-report "$out/verifier.txt" \
>"$out/events.jsonl" 2>"$out/warden.log" &
warden=$!
cleanup() {
kill "$warden" 2>/dev/null || true
wait "$warden" || true
}
trap cleanup EXIT
for ((t=0; t<1200; t++)); do
kill -0 "$warden"
if test -e "$out/warden.log" && grep -q '^READY mode=4' "$out/warden.log"; then break; fi
sleep .05
done
grep -q '^READY mode=4' "$out/warden.log"
# 4. Launch hardened unprivileged auditor shell on /dev/ttyS0 (mount-ns /work isolation, NoNewPrivs, CapEff=0)
stty -F /dev/ttyS0 rows 36 cols 120 2>/dev/null || true
if command -v unshare >/dev/null 2>&1; then
setsid -c unshare -m bash -c 'echo $$ > /sys/fs/cgroup/jev/cgroup.procs || exit 1; cd /home/auditor || exit 1; mount --make-rprivate / 2>/dev/null || true; umount -l /work 2>/dev/null || true; mount -t tmpfs -o ro,size=1M,mode=0700 tmpfs /work || exit 1; exec setpriv --reuid=2000 --regid=2000 --clear-groups --no-new-privs env -i HOME=/home/auditor USER=auditor LOGNAME=auditor PATH=/usr/local/bin:/usr/bin:/bin TERM=xterm-256color bash --rcfile /tmp/egress.bashrc -i' </dev/ttyS0 >/dev/ttyS0 2>&1 &
else
setsid -c bash -c 'echo $$ > /sys/fs/cgroup/jev/cgroup.procs || exit 1; cd /home/auditor || exit 1; exec setpriv --reuid=2000 --regid=2000 --clear-groups --no-new-privs env -i HOME=/home/auditor USER=auditor LOGNAME=auditor PATH=/usr/local/bin:/usr/bin:/bin TERM=xterm-256color bash --rcfile /tmp/egress.bashrc -i' </dev/ttyS0 >/dev/ttyS0 2>&1 &
fi
shell=$!
sleep 0.2
kill -0 "$shell"
: > "$out/ready"
while kill -0 "$shell" && test ! -f "$out/stop"; do
kill -0 "$warden"
sleep .3
done