Integrations

Shell shim

Universal shell shim protection for any AI agent.


The shell shim is a universal integration that protects any AI tool that runs shell commands — with zero integration effort from the tool's side.

How it works

sl shield enable installs PATH-priority wrapper scripts in ~/.securitylayer/bin/. Because this directory is prepended to PATH, all shell commands route through Security Layer before reaching the real binary.

Shimmed binaries

BinaryDescription
bashBash shell
shPOSIX shell
zshZsh shell
pythonPython interpreter
python3Python 3 interpreter
nodeNode.js runtime
rubyRuby interpreter
perlPerl interpreter

Execution flow

AI Tool → shimmed bash → sl check → real bash
                              ↓ (if denied)
                         error message
  1. AI tool calls bash -c "some command"
  2. The shim in ~/.securitylayer/bin/bash intercepts
  3. sl check evaluates the command
  4. If allowed → forwarded to the real /usr/bin/bash
  5. If denied → error returned, command never executes

Caller detection

The shim identifies which AI tool triggered the command by checking:

  • Environment variables specific to each tool
  • Parent process names

This allows different capability profiles for different tools (e.g., Claude Code gets exec + file.write, while an untrusted tool gets only file.read).

Setup

# Enable
sl shield enable

# Verify
sl shield status

# Disable
sl shield disable

After enabling, restart your shell or open a new terminal for the PATH change to take effect.

Supported AI tools

Any tool that executes shell commands is automatically protected:

  • Claude Code
  • Cursor
  • Aider
  • GitHub Copilot
  • Custom agents
  • Any tool running shell commands

See also

  • shield — Shield command reference
  • callers — Caller detection profiles
  • check — The check command used by shims

On this page