Skip to content

Restrict default Seatbelt PTY access to workload terminals - #1530

Open
Elliot (theelliotm) wants to merge 1 commit into
mainfrom
user/emichlin/seatbelt-tty-fix
Open

Elliot (theelliotm) wants to merge 1 commit into
mainfrom
user/emichlin/seatbelt-tty-fix

Conversation

@theelliotm

@theelliotm Elliot (theelliotm) commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

📖 Description

  • Require macOS PTY authorization for dynamically allocated terminals; grant exact paths for assigned and inherited terminals.
  • Remove GUI mode's blanket terminal-device grant.
  • Add disposable same-user PTY regressions to the Seatbelt CI suite and update backend documentation.

Explicit filesystem grants and profileOverride can still widen access. Coverage verifies device opens and terminal controls, not host command execution or cross-terminal byte transfer.

🔗 References

🔍 Validation

Local macOS 27.0.1 validation. Commands below run from src/:

Command Result
cargo fmt --all -- --check Passed
cargo clippy --locked -p mxc-sdk --lib --tests -- -D warnings Passed
cargo test --locked -p mxc-sdk --lib backend_modules::seatbelt::common --quiet 133 passed
cargo test --locked -p mxc-sdk --lib mxc_pty --quiet 46 passed
cargo test --locked -p mxc-sdk --test streaming --quiet 22 passed
cargo build --locked -p mxc_darwin --quiet Passed

From the repository root:

  • MXC_EXEC_MAC="$PWD/src/target/debug/mxc-exec-mac" bash tests/scripts/run_seatbelt_tty_test.sh — all 8 cases passed.
  • bash -n tests/scripts/run_seatbelt_tty_test.sh tests/scripts/run_seatbelt_all_tests.sh — passed.

✅ Checklist

📋 Issue Type

  • Bug fix
  • Feature
  • Task

Microsoft Reviewers: Open in CodeFlow

Copilot AI balanced review requested due to automatic review settings October 19, 2026 21:45
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The kernel-enforced security boundary warrants human review across supported macOS versions, with reported runtime validation limited to macOS 27.0.1.

No open issues 🎉

What changed in this PR

Tightens Seatbelt terminal access to workload-assigned, inherited, and sandbox-authorized PTYs rather than unrelated host terminals.

Changes:

  • Replaces blanket terminal grants with scoped authorization, including GUI mode.
  • Adds terminal-isolation regressions and integrates them into the Seatbelt suite.
  • Documents terminal access behavior and explicit overrides.
File Description
tests/​scripts/​run_seatbelt_tty_test.sh Adds disposable same-user PTY isolation checks.
tests/​scripts/​run_seatbelt_all_tests.sh Runs the terminal-isolation suite.
src/​mxc-sdk/​src/​core/​mxc_pty/​mod.rs Records the assigned macOS terminal path.
src/​mxc-sdk/​src/​backends/​seatbelt/​common/​seatbelt_runner.rs Binds terminal paths into profiles and adds regression tests.
src/​mxc-sdk/​src/​backends/​seatbelt/​common/​profile_builder.rs Restricts PTY grants to authorized terminals.
docs/​backends/​seatbelt/​seatbelt-backend.md Explains scoped access and override behavior.

Review effort: Balanced

@theelliotm Elliot (theelliotm) changed the title Restrict Seatbelt PTY access to workload terminals Restrict default Seatbelt PTY access to workload terminals Oct 19, 2026
@theelliotm
Elliot (theelliotm) marked this pull request as ready for review October 19, 2026 21:52
@theelliotm
Elliot (theelliotm) requested a review from a team as a code owner October 19, 2026 21:52

This branch has not been deployed

No deployments
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