seatbelt-sandboxer

Generates minimal allowlist-based macOS Seatbelt sandbox profiles for applications.

Updated Mar 22, 2026
One-click install
npx skills add https://github.com/TECH-HY/SKILLS --skill seatbelt-sandboxer-tech-hy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: seatbelt-sandboxer
Source: https://github.com/TECH-HY/SKILLS/tree/main/skills/seatbelt-sandboxer
Command: npx skills add https://github.com/TECH-HY/SKILLS --skill seatbelt-sandboxer-tech-hy

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Restricting a macOS application's file, network, and process access requires writing Seatbelt sandbox profiles by hand, which involves obscure Scheme-like syntax, dozens of operation types, and iterative trial-and-error testing. ## Core Features & Use Cases - Minimal Profile Generation: Builds deny-default Seatbelt profiles with allowlist-based file read/write, network, process, and IPC rules scoped to specific paths and ports. - Iterative Testing Workflow: Guides testing the sandboxed application with sandbox-exec, diagnosing failures like exit code 134 or ENOENT, and refining the profile until the app works normally. - Subcommand-Aware Sandboxing: Profiles applications with distinct subcommands (e.g., a bundler's build vs serve) separately and creates a helper script that selects the right profile per subcommand. - Use Case: You want to run a third-party CLI build tool on macOS without giving it access to your SSH keys or the network. Use this Skill to generate a profile that allows reads only from system paths and your project directory, blocks all network access, and verifies the tool still builds correctly. ## Quick Start Generate a minimal Seatbelt sandbox profile for my application at /usr/local/bin/mytool that only needs to read my project directory and write build output there.

Frequently Asked Questions about seatbelt-sandboxer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I sandbox a macOS application with sandbox-exec?

Write a Seatbelt profile starting with (version 1) and (deny default), then add allow rules for only the operations the app needs. Run it with sandbox-exec -f profile.sb -D WORKING_DIR=/path /path/to/app and iterate on failures.

How to restrict file access in a Seatbelt sandbox profile?

Use (allow file-read-data ...) with subpath, literal, or regex filters to permit reading only listed paths, combined with a broad (allow file-read-metadata) for stat and readdir. Restrict writes with (allow file-write* ...) scoped to working and temp directories.

Does sandbox-exec still work on recent macOS versions?

Apple deprecated sandbox-exec, but it remains functional through macOS 14 and later. It is suitable for isolating CLI tools and build processes, though it is not supported for new platform features.

Why does my sandboxed app fail with exit code 134?

Exit code 134 (SIGABRT) indicates a sandbox violation where the app attempted a denied operation. Identify the blocked operation, add the minimal corresponding allow rule, and retest until the application runs normally.

When should I not use Seatbelt sandboxing?

Avoid it for Linux or Windows targets, which need seccomp-bpf, AppArmor, or other platform mechanisms instead. It is also a poor fit for apps needing broad system access or quick one-off scripts where the overhead is unjustified.