Details

ai / prototype

Secure Env Manager

Secure Env Manager creates Distrobox-based development homes backed by LUKS storage, masked host-home access, reduced capabilities, isolated credentials, browser/editor separation, controlled audio/video/X11 bridges, and encrypted export/import across machines.

Problem

AI coding tools read project files, execute scripts, reuse browser sessions, and inherit credentials from the environment they run in. When work, personal, and academic projects share a host home, the risk is accidental context and credential crossover.

Contribution

Built the scripts and environment model for isolated Distrobox developer homes over LUKS-backed sparse images, with masked host-home access, generated per-environment SSH keys, separate browser/editor state, minimal capabilities, private IPC/PID namespaces, desktop integration, and verification commands.

Isolation Boundary

Each environment has its own encrypted storage mounted under an isolated container home. The host home is replaced by an empty mask, the container user has a separate UID/home, the Docker group is absent, Chromium sandboxing remains enabled, and capabilities are reduced instead of running privileged. The protection is strongest for at-rest storage and accidental host-home access; allowed desktop bridges remain explicit boundaries rather than erased risk.

Technical decisions

LUKS encrypted sparse images for environment data
Distrobox containers with host-home masking
Per-environment SSH keys
Capability restrictions instead of privileged containers
Browser sandbox support and desktop launchers

Desktop Bridges

The project keeps a usable development desktop without pretending those bridges are free.

Private IPC and process namespaces for container separation
socat PulseAudio bridge to handle host UID 1000 versus container developer UID 1001
Allowed audio, microphone and Bluetooth speaker use
udev video access for webcam support
X11 access for screen sharing under the current user

Encrypted Portability

Export creates an encrypted portable bundle containing OCI rootfs, developer home, container metadata and checksums, protected by password or GPG recipient. Send transfers it over SSH. Import preserves container-relative ownership across different Podman subordinate UID/GID ranges and refuses to overwrite an existing container or home. Migration snapshots an existing rootless Distrobox without deleting the origin.

Tradeoffs

Practical isolation over enterprise policy complexity
Linux-first security model over cross-platform convenience
Developer usability without giving tools ambient host access

Outcome

A concrete AI-security tooling project: each agent context gets its own encrypted storage, browser profile, editor state, SSH identity, and filesystem boundary.

Stack and domains

  • Linux
  • Distrobox
  • Podman
  • LUKS
  • cryptsetup
  • Bash
  • ACL
  • socat
  • PulseAudio/PipeWire
  • X11
  • udev
  • GPG