You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-8Lines changed: 9 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,9 +6,9 @@
6
6
7
7
# Alcoholless: lightweight security sandbox for Homebrew, AI agents, etc.
8
8
9
-
Alcoholless is a lightweight security sandbox for macOS programs.
9
+
Alcoholless is a lightweight security sandbox, primarily for macOS programs.
10
10
11
-
While Alcoholless was originally made for the sake of securing Homebrew, basically it can be used for almost any CLI programs on macOS.
11
+
While Alcoholless was originally made for the sake of securing Homebrew, basically it can be used for almost any CLI programs.
12
12
Notably, Alcoholless is useful for allowing an AI agent to run shell commands with less risk of [breaking the host operating system](https://old.reddit.com/r/ClaudeAI/comments/1pgxckk/claude_cli_deleted_my_entire_home_directory_wiped/).
13
13
14
14
See also my blog article: <https://medium.com/nttlabs/alcoholless-lightweight-security-sandbox-for-macos-ccf0d1927301>
@@ -145,7 +145,7 @@ Select `Launch OpenCode`, press `→`, and choose a model such as `gemma4`.
145
145
## Install
146
146
147
147
Requirements:
148
-
- macOS
148
+
- macOS (recommended) or Linux
149
149
-[Go](https://go.dev)
150
150
151
151
To install Alcoholless, run:
@@ -214,7 +214,7 @@ See [FAQs](#faqs) for the reason why `su` is wrapped inside `sudo`.
214
214
215
215
### FAQs
216
216
#### Why wrap `su` inside `sudo`?
217
-
Because `sudo` doesn't isolate "a specific Mach bootstrap subset, audit session and other characteristics not recognized by POSIX" (see `launchd(8)`),
217
+
Because `sudo` doesn't isolate "a specific Mach bootstrap subset, audit session and other characteristics not recognized by POSIX" (see `launchd(8)`) on macOS,
218
218
while `su` isolates them.
219
219
220
220
e.g., `sudo -u alcless_exampleuser_default open -a TextEdit` opens the `TextEdit` application as the current user, not as `alcless_exampleuser_default`.
@@ -224,19 +224,20 @@ however, touching such system configuration files might be scary.
224
224
225
225
So, the current workaround is to just wrap `su` inside `sudo`.
226
226
227
+
#### Why not use containers?
228
+
Because containers are not supported on macOS.
229
+
227
230
#### Why not use VM?
228
231
Because VM has several disadvantages:
229
232
- Non-negligible performance overhead
230
233
- High disk consumption
231
234
- No direct access to the host hardware (GPU, etc.)
232
235
- Localhost address inaccessible from the host
233
236
- Does not work on GitHub Actions etc. due to lack of the support for nested virtualization
234
-
235
-
#### Why not support Linux and FreeBSD?
236
-
Because Linux and FreeBSD already have containers.
237
+
-[Licensing limitations](https://www.apple.com/legal/sla/) apply for macOS guests (e.g., only 2 guests can be runnable at most)
237
238
238
239
#### How does Alcoholless relate to Lima?
239
-
- Alcoholless (**Lightweight**): run commands as a separate macOS user (not a VM, nor a container)
240
+
- Alcoholless (**Lightweight**): run commands as a separate user (not a VM, nor a container)
240
241
-[Lima](https://lima-vm.io/) (**Strong security**): run commands in a VM
sudo.Cmd(ctx, instUser, "", "sh", []string{"-c", `echo 'PATH="$(echo "$PATH" | sed -e s@/opt/homebrew/bin:@@g)"; export PATH' | tee -a "${HOME}/.bash_profile" | tee -a "${HOME}/.bashrc" | tee -a "${HOME}/.zprofile" >> "${HOME}/.zshenv"`}),
65
+
sudo.Cmd(ctx, instUser, "", "sh", []string{"-c", `echo 'PATH="$(echo "$PATH" | sed -e s@`+systemHomebrewPrefix+`/bin:@@g)"; export PATH' | tee -a "${HOME}/.bash_profile" | tee -a "${HOME}/.bashrc" | tee -a "${HOME}/.zprofile" >> "${HOME}/.zshenv"`}),
0 commit comments