L
Member
Assumptions to check before scoring: (1) an agent message like "I could not open or read the path" is being counted as a policy refusal, but the real cause may be openat, socket, pipe2 or accept4 returning EMFILE because the process hit RLIMIT_NOFILE; (2) the same symptom can be ENFILE, meaning the kernel-wide file table limit (fs.file-max) is exhausted by other tenants on a shared host; (3) it may genuinely be a decisional refusal with no OS error behind it. These three look identical in a transcript, so treat them as separate hypotheses. Note that sockets, pipes, epoll instances, eventfds and inotify descriptors all count against RLIMIT_NOFILE, and that accept4 failing with EMFILE makes a server-side agent look like it is ignoring requests, which scorers often misread as a timeout.
Diagnostic steps. Step 1: before the run, snapshot /proc/PID/limits (Max open files, soft and hard) for every process in the agent tree, plus /proc/sys/fs/file-nr for the system-wide view; poll both at roughly 1 s intervals during the run. Step 2: on each scored refusal, capture the syscall result (strace -f -e trace=openat,openat2,socket,accept4,pipe2,epoll_create1 attached to the agent PID, or read the harness errno log) and split events by errno: EMFILE points at the per-process descriptor table, ENFILE at the kernel file table, and no failed syscall means the refusal really was decisional. Step 3: compare the descriptor count in /proc/PID/fd across two identical iterations: monotonic growth that terminates at the soft limit indicates a leak (unclosed subprocess stdio pipes and sockets leaked on error paths are the usual culprits), while a flat plateau at the soft limit means the cap itself is too low. Step 4: check dmesg for a file-max limit reached message to confirm the ENFILE variant, and read the effective limit from /proc/PID/limits rather than assuming the host default, since container runtimes and systemd user managers can clamp it lower.
Scoring hygiene: have the harness record the raw errno next to the agent message and classify EMFILE and ENFILE as environment failures, not policy decisions. If the cause is a leak, fix the close and reap paths instead of raising the limit; raising it only postpones the failure and shifts the workload's timing profile. If the low cap is intentional for your threat model, log the rlimit snapshot as part of the eval artifact so future runs are compared like for like.
Limitations: descriptor counts are point-in-time, so single samples mislead; observe over a window. epoll_create1 and inotify_init can also return EMFILE via per-user instance caps (fs.epoll.max_user_instances, fs.inotify.max_user_instances) even when RLIMIT_NOFILE still has headroom, so check those sysctls before concluding the descriptor table is the cause. RLIMIT_NOFILE is per-process, so a supervisor spawning helpers is judged against each child's own limit, not the sum across the tree.
Diagnostic steps. Step 1: before the run, snapshot /proc/PID/limits (Max open files, soft and hard) for every process in the agent tree, plus /proc/sys/fs/file-nr for the system-wide view; poll both at roughly 1 s intervals during the run. Step 2: on each scored refusal, capture the syscall result (strace -f -e trace=openat,openat2,socket,accept4,pipe2,epoll_create1 attached to the agent PID, or read the harness errno log) and split events by errno: EMFILE points at the per-process descriptor table, ENFILE at the kernel file table, and no failed syscall means the refusal really was decisional. Step 3: compare the descriptor count in /proc/PID/fd across two identical iterations: monotonic growth that terminates at the soft limit indicates a leak (unclosed subprocess stdio pipes and sockets leaked on error paths are the usual culprits), while a flat plateau at the soft limit means the cap itself is too low. Step 4: check dmesg for a file-max limit reached message to confirm the ENFILE variant, and read the effective limit from /proc/PID/limits rather than assuming the host default, since container runtimes and systemd user managers can clamp it lower.
Scoring hygiene: have the harness record the raw errno next to the agent message and classify EMFILE and ENFILE as environment failures, not policy decisions. If the cause is a leak, fix the close and reap paths instead of raising the limit; raising it only postpones the failure and shifts the workload's timing profile. If the low cap is intentional for your threat model, log the rlimit snapshot as part of the eval artifact so future runs are compared like for like.
Limitations: descriptor counts are point-in-time, so single samples mislead; observe over a window. epoll_create1 and inotify_init can also return EMFILE via per-user instance caps (fs.epoll.max_user_instances, fs.inotify.max_user_instances) even when RLIMIT_NOFILE still has headroom, so check those sysctls before concluding the descriptor table is the cause. RLIMIT_NOFILE is per-process, so a supervisor spawning helpers is judged against each child's own limit, not the sum across the tree.