Skip to content

Scope vsock exec channel to AI Sandbox VMs only#21

Merged
DaxxSec merged 1 commit into
mainfrom
claude/commit-secvf-changes-iuhaT
May 14, 2026
Merged

Scope vsock exec channel to AI Sandbox VMs only#21
DaxxSec merged 1 commit into
mainfrom
claude/commit-secvf-changes-iuhaT

Conversation

@DaxxSec
Copy link
Copy Markdown
Owner

@DaxxSec DaxxSec commented May 14, 2026

Summary

Scopes the host-guest vsock exec channel to AI Sandbox VMs only, by removing two unconditional attachments from createVirtualMachine() (the generic non-AI-sandbox VM startup path) in AppDelegate.swift:

  1. Removed VZVirtioSocketDeviceConfiguration attach. The if isMacOS { socketDevices = [...] } block predated the AI Sandbox getting its own dedicated config path (AISandboxMacVMConfiguration, which already attaches its own vsock device). Without this change, every regular macOS guest carried a vsock device on port 2222 — fine for an AI Sandbox VM, but a latent control-channel surface on any non-AI-sandbox macOS VM, including hypothetical macOS malware-analysis VMs. The port number is documented in open-source code, so the surface is reachable by an adversary inside such a VM cooperating with a host-side process. With no device, there is no port to bind.
  2. Removed VsockExecBridgeManager.startBridge() call. Already inert after change (1) because the bridge guards on vm.socketDevices.first is VZVirtioSocketDevice, but the explicit call kept the wiring "one config change away" from re-exposing the channel. AI Sandbox VMs still start their bridge from their own session-boot site (bootAISandboxSession path, ~AppDelegate.swift:2714), so nothing legitimate loses access.

VirtioFS shares were already AI-Sandbox-only (directorySharingDevices is set in exactly one place: AISandboxMacVMConfiguration.swift). With this change, the cross-boundary surfaces that the purple-team proposal targets (VirtioFS workspace + vsock exec bridge) are both structurally confined to the AI Sandbox path.

Context: proposals/purple-team-agent-sandbox.md in anthropic-detections-platform (purple-team writeup; "Adjacent hardening" section flags this fix).

Test plan

  • Build: xcodebuild -scheme SecVF -configuration Debug -destination 'platform=macOS,arch=arm64' build
  • AI Sandbox VM: boot via the AISandbox path; confirm /tmp/secvf-exec-<UUID>.sock still appears and secvf-cli vm exec still drives the guest.
  • Regular macOS VM (non-AI-sandbox): boot; confirm no /tmp/secvf-exec-*.sock appears for this VM; confirm VM boots and operates normally.
  • Linux VM (Kali router): boot; confirm unchanged behavior.
  • Stop/restart cycles for each VM type — verify stopBridge calls are still safe no-ops where no bridge exists.

Generated by Claude Code

Two changes in createVirtualMachine() (the generic non-AI-sandbox VM
startup path):

1. Stop attaching a VZVirtioSocketDeviceConfiguration for every macOS
   guest. The original 'if isMacOS' attach predates the AI sandbox
   getting its own dedicated config path (AISandboxMacVMConfiguration),
   which already attaches its own vsock device. Leaving the generic
   attach in place exposed a host-guest exec channel on every regular
   macOS VM — fine for AI sandbox VMs (they go through the dedicated
   path), but a latent control-channel surface on any non-AI-sandbox
   macOS VM, including a hypothetical macOS malware-analysis VM. The
   vsock port (2222) is documented in the open-source code, so an
   adversary inside such a VM with a cooperating host-side process
   could exploit it; remove the device so there is no port to bind.

2. Stop calling VsockExecBridgeManager.startBridge() from the generic
   path. The bridge has its own no-op guard for VMs without a vsock
   device, so this was already inert after change 1, but the explicit
   call kept the wiring 'one config change away' from re-exposing the
   channel. AI Sandbox VMs already call startBridge from their own
   session-boot site (the bootAISandboxSession() path), so nothing
   legitimate loses access.

VirtioFS shares were already AI-sandbox-only (only
AISandboxMacVMConfiguration adds directorySharingDevices), so this
change closes the remaining cross-boundary surface on non-AI-sandbox
VMs. Context: purple team proposal in
anthropic-detections-platform/proposals/purple-team-agent-sandbox.md.
@DaxxSec DaxxSec marked this pull request as ready for review May 14, 2026 18:53
@DaxxSec DaxxSec merged commit daa0415 into main May 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants