Repository navigation
fix(trial): confine the escape surface — environment, host sockets, /proc, IPC, session, and the shell's authority - #807
Merged
Conversation
rodrigoteamx
force-pushed
the
fix/confine-escape-surface
branch
from
October 14, 2026 01:38
f303de1 to
53a7021
Compare
… conditional /proc, IPC, session, and the shell's authority /proc is masked in a normal container, where bwrap cannot mount a fresh procfs and forcing it fails the whole confinement — no trial booted in the :dev image. TrialRunner now probes once whether a procfs mounts under the confining shape and adds --proc /proc only when it can; in a container the container's own pid namespace already hides the host's processes, so the end holds without the flag.
rodrigoteamx
force-pushed
the
fix/confine-escape-surface
branch
from
October 14, 2026 03:13
53a7021 to
0c186e1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Confines the trial/leg escape surface so agent-authored code running under bubblewrap can no longer read authority or credentials it was never granted. Each leg only ADDS refusals; the published confinement's denials all still hold, and no legitimate leg breaks (a trial still runs, non-authority files stay readable, off-list sockets stay reachable,
/proc/selfstays readable, terminal/MCP keep confining).TrialRunner::environmentFloor):--clearenv+ an exact allowlist (PATH HOME TMPDIR LANG LC_ALL MILPA_TRIAL). Confined code no longer reads the launcher'sMILPA_AGENT_BASIC_AUTHor any third-party*_KEY/*_TOKENviagetenv.maskArgs/hostSocketPaths): the path AF_UNIX sockets whose connect is authority on the host are overlaid with/dev/null— Docker, the ssh-agent (launcherSSH_AUTH_SOCKread before--clearenv, plus the gnome-keyringgcr/sshandkeyring/sshdefaults), dbus (system + session), systemd/private, wayland/X11 (by glob), pipewire, pulse. Masked only when the user could open it (is_writable), so a root-only socket is left alone and a connect to the masked path is refused (ECONNREFUSED)./proc(--proc /proc): a private procfs so other processes' command lines are no longer readable.NAMESPACES):--unshare-ipc(own SysV/POSIX-shm namespace) and--new-session(no controlling TTY).SecretFiles::NON_BEARER_STATE): the enrollment ledger, token-hash store, capabilities declaration and the agent session log are masked from confined code (the bearer stores already were).Console/Application::pantallaDelShell): thecoa shellform now runs an operation with the session token'sToolContext, as the terminal does, so a finite principal's authoring op is confined instead of running in the house as the local wildcard.Reviewed independently with execution of the escape surface (0/0/0). The socket and env allowlists are hand-maintained; a non-standard
DOCKER_HOSTor an ssh-agent outside the default must be added to the list at deployment.