The README makes claims. This file backs them up with file paths, honest caveats, and a precise description of what the safety layer actually enforces.
ShellIntegration.jl bridges Julia with the wider operating system. It provides: (1) PowerShell Bridge — native execution of
pwshscripts for cross-platform admin tasks. (2) Valence Shell — a secure, capability-based shell environment for sensitive operations. (3) Safety Wrappers — middleware to prevent accidental destructive commands.
True and enforced at the regex level. exec_safe(cmd::Cmd) and the internal
_is_dangerous(cmd_str::String) function in src/ShellIntegration.jl check every
command against a nine-pattern blocklist:
-
rm -rf /andrm -f /pathpatterns -
mkfs.*(filesystem formatting) -
dd .*of=/dev/(raw device writes) -
chmod -R 777(world-writable recursion) -
Fork bomb
:(){ :\|:& };: -
Block device overwrite via
> -
curl | (ba)?shandwget | (ba)?sh(pipe-to-shell download attacks)
The test suite confirms exec_safe(\`rm -rf /\)` throws ErrorException with
a message containing "Unsafe command blocked". It also confirms that plain rm
without -rf passes the safety check (though the rm itself may then fail for
other reasons).
Fully implemented. start_valence_shell(; capabilities, prompt, timeout_seconds)
runs an interactive REPL with a six-capability enum (CAP_READ, CAP_WRITE,
CAP_NETWORK_OUT, CAP_NETWORK_IN, CAP_EXEC, CAP_ENV). The _has_capability
function classifies every command by its first token (executable name) against
hardcoded sets — e.g., cat/ls/grep/rg/sha256sum require CAP_READ;
curl/wget/ssh/rsync require CAP_NETWORK_OUT; anything not classified
requires CAP_EXEC. The dangerous-pattern check runs unconditionally before the
capability check, so no capability grants access to rm -rf /.
Honest caveat: The capability classification is static keyword matching. It does
not sandbox the subprocess via kernel namespaces or seccomp; a CAP_EXEC-permitted
process could spawn further shells. The safety guarantee is best-effort for
interactive accidental misuse, not adversarial containment.
Critical path for exec_safe:
-
Caller provides a
Cmd(e.g.,\`echo hello\`). -
exec_safecallsstring(cmd)to get a string representation. -
_is_dangerous(cmd_str)scans against each of the nineDANGEROUS_PATTERNSregexes. -
If any match, throws
ErrorException("Unsafe command blocked: $cmd_str"). -
Otherwise, calls
run(cmd)and returns theProcess.
Critical path for start_valence_shell:
-
Enters a timed REPL loop (default timeout 300s).
-
Reads a line from stdin.
-
Calls
_is_dangerousunconditionally. -
Calls
_has_capability(input, capabilities)to check the first token. -
If both pass, executes via
read(\`sh -c $input\, String)` and prints stdout.
| Project | Connection |
|---|---|
|
The |
|
ShellIntegration is the standard Julia shell bridge in the ambientops monorepo;
admin automation scripts use |
|
ShellIntegration is catalogued as the systems-integration bridge package. |
|
The zatty terminal detection utility shares the capability-flag mental model;
ShellIntegration’s |
|
|
| Path | What’s There |
|---|---|
|
Entire module (~270 lines): |
|
8 testsets: |
|
End-to-end scenario: calls |
|
Property-based checks: arbitrary strings matching dangerous patterns must always
be blocked; arbitrary safe commands must never be blocked by |
|
Package identity (uuid |
|
Dependency graph: ShellIntegration sits between the OS layer and higher-level packages (SoftwareSovereign, ambientops scripts). |