Skip to content

feat(host): sandbox connector processes on macOS and Linux - #456

Merged
aicayzer merged 35 commits into
mainfrom
feat/host-connector-sandbox
Dec 1, 2026
Merged

aicayzer merged 35 commits into
mainfrom
feat/host-connector-sandbox

Conversation

@aicayzer

@aicayzer aicayzer commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The connector host now starts each connector inside an operating-system sandbox: sandbox-exec on macOS and a small compiled launcher (Landlock and seccomp) on Linux. When the sandbox can't start, the connector still runs under the host's Node permission flags and the owner sees a quiet warning in Marfa. The Linux install no longer uses up the one-time link on a machine it can't set up.

Closes #424
Closes #432
Closes #433

Changes

  • Probe the sandbox at each start, and record which program started each connector. A connector runs without the sandbox only when this machine can't run it: if the host can't tell, it starts nothing and checks again. It rechecks a connector that runs without it. The launcher is linked statically, so it loads on older distributions.
  • Report each start's mode to Marfa (PUT /connector-hosts/self/connectors/{plugin}/sandbox, Marfa 0.0.121) with a launch number the host keeps on disk, so a late report can't override a newer start. Connector state and problems are untouched.
  • On Linux, allow the name resolution the machine's nsswitch.conf asks for, and restart a connector after a file it was given is replaced.
  • Refuse a Linux install with no systemd user manager before the link is redeemed, leave no unit file after a failed service step, pass --no-service through install-host.sh, and name a missing library before installing.
  • Read the code of a refusal Marfa answers, which the host had been missing.
  • Pin @withmarfa/client 0.0.121 in the host, and move it with the kit and scripts when following a release.

Testing

  • On macOS with the pinned Node: build, type check, lint, format, the 635 host and release tests, and the sandbox and connector-host proof groups passed. New behavior had tests seen failing first.
  • On arm64 Linux, the launcher's Rust tests and the host's sandbox tests passed in containers, and the static launcher ran on Debian 12 and Ubuntu 22.04.
  • Real Todoist and Google Calendar test accounts and a public feed ran under an installed archive on macOS, including a LaunchAgent, and on Ubuntu 24.04 arm64: reads, edits back to the service, and the warning where the sandbox can't start. This ran again on the final commit.
  • x86_64 Linux is covered by this pull request's CI. Under emulation on arm64 only the fallback could run.
  • Not tested: real kernels older than the test machine's, and macOS versions other than 27.

Notes for reviewers

Security boundary: reviewed three times. Known limits, which host/README.md states: on macOS no profile rule stops a connector asking the system to send SIGIO (ignored by default) through a pipe or socket, and on Linux a machine that resolves names with myhostname lets a connector read network addresses and routes. A connector that uses up ports or processes can delay other connectors' starts, and replacing a file the sandbox was given restarts connectors, which can interrupt a run.

Checklist

  • The title is a scoped Conventional Commit.
  • New behavior has a test that was seen failing first, or no test was needed and the reason is above.
  • Docs, comments and the contract still say what is true after this change.

@aicayzer
aicayzer marked this pull request as ready for review December 1, 2026 01:56

@aicayzer aicayzer left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: security review done; details held privately

Summary. Ready to merge: three review rounds, every blocking finding fixed, and the last round found nothing.


Reviewed by withmarfa-reviewer on Claude Opus 5.5. This review may contain mistakes.

@aicayzer
aicayzer merged commit fecca0f into main Dec 1, 2026
22 checks passed
@aicayzer
aicayzer deleted the feat/host-connector-sandbox branch December 1, 2026 03:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant