Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.runlayer.com/llms.txt

Use this file to discover all available pages before exploring further.

Enforce intercepts MCP tool calls to apply security policies before execution. Unlike Detect (which discovers configurations), Enforce actively controls what shadow MCPs can do in real-time.

How It Works

When Enforce is installed, it intercepts MCP tool calls before execution:
  1. User invokes a tool — The AI assistant requests a tool call from a shadow MCP
  2. Intercept — The call is captured before reaching the MCP server
  3. Policy evaluation — The call is checked against your organization’s policies
  4. Decision — The call is either:
    • Allowed — Proceeds to the MCP server normally
    • Blocked — Prevented and logged for security review
  5. Audit logging — All intercepted calls are logged for visibility

What Gets Intercepted

Enforce intercepts tool calls from shadow MCP servers — those configured directly in the client rather than through Runlayer. This includes MCP servers embedded in native client plugins (e.g. Claude Code marketplace plugins). The hook resolves MCP endpoints from installed plugin manifests and enforces the same rules. Tool calls to Runlayer-managed MCPs (server, plugin, and skill proxy URLs) are recognized as managed and allowed through. All other remote MCP URLs are blocked unless they appear on the allowlist.

Allowed remote MCP URLs (allowlist)

When Enforce hooks are installed, Enforce blocks remote (HTTP/S) MCP servers that do not point at your Runlayer instance. Workspace admins can add allowed remote MCP URLs under SettingsShadow MCPs, in the Enforce section (Save allowlist). Each entry is a base URL. A tool call’s MCP URL is allowed when:
  • The scheme, host, and port match the entry (default ports 443 / 80 for HTTPS / HTTP are treated the same as omitting the port).
  • If the entry has no path (or only /), any path on that origin is allowed.
  • If the entry includes a path (for example https://partner.example.com/mcp), the MCP URL’s path must match that prefix with a path boundary — /mcp and /mcp/stream match; /mcpbackup does not.
You can configure up to 50 allowed URLs. Stdio-based MCP commands are not controlled by this list; they must still use Runlayer-managed invocations (for example the Runlayer CLI with a server UUID).

Supported Clients

ClientmacOSWindows
CursorComing soon
Claude CodeComing soon
CodexComing soon
Additional client support is in active development. Check the Runlayer dashboard for the latest supported clients.

Deployment

Installed Enforce hooks block shadow MCP tool calls by default. The Full session scanning controls under SettingsWorkspace are separate and are not required for Shadow MCP enforcement.
TLS trust: The runlayer CLI and MDM-deployed aiwatch binary verify HTTPS through the OS trust store — macOS Keychain (login + System), Windows certificate stores (Current User + Local Machine), and the Linux distro CA bundle (/etc/ssl/certs). Corporate root CAs pushed via MDM, GPO, or Intune are honored automatically with no extra config. If your corporate root is not installed system-wide and hooks fail with CERTIFICATE_VERIFY_FAILED, see Troubleshooting for --ca-bundle, RUNLAYER_CA_BUNDLE, SSL_CERT_FILE, and REQUESTS_CA_BUNDLE overrides.

MDM Deployment

Deploy Enforce across your organization directly from the Runlayer dashboard. Navigate to SettingsShadow MCPs to create or view an Enforce configuration, then follow the guide for your MDM platform:

SimpleMDM

macOS deployment

Jamf Pro

macOS deployment

Mosyle

macOS deployment

Iru/Kandji

macOS deployment

Other MDM

Any MDM with script execution

Manual Installation

For testing or individual device setup, install Enforce directly using the Runlayer CLI. Step 1 — Install the Runlayer CLI:
curl -LsSf https://astral.sh/uv/install.sh | sh
uv tool install runlayer
Restart your terminal after installing so ~/.local/bin (macOS/Linux) or %USERPROFILE%\.local\bin (Windows) is on PATH. Enforce hooks require runlayer to be available on PATH at runtime — using uv tool install (rather than uvx) ensures the binary is permanently available. Step 2 — Verify the CLI is on PATH:
runlayer --help
If you see command not found, restart your terminal or run uv tool update-shell. See Troubleshooting for more details. Step 3 — Log in to your Runlayer instance:
runlayer login --host https://your-runlayer-instance.com
Credentials are stored in your OS keychain when available, with a fallback to ~/.runlayer/config.yaml. Step 4 — Install Enforce:
runlayer setup hooks --install --yes --host https://your-runlayer-instance.com
FlagDescription
--installPerform the installation
--uninstallRemove hooks
--yesSkip confirmation prompts
--hostValidate this host exists in config before install
--clientInstall for a specific client (cursor, claude_code, or codex; default: all)
--all-eventsRegister all hook events including pipeline (default: enforcement only)
--no-enforcementMonitoring only — register hooks but skip blocking enforcement
--mdmInstall to enterprise location (requires elevated permissions)
MDM-generated scripts run setup hooks --install --mdm --yes (with an optional --client flag). The --mdm flag writes hooks to the enterprise location (e.g., /Library/Application Support/Cursor/) and skips the user config check since the script runs as root.
Use --no-enforcement when you want visibility into shadow MCP tool calls without blocking any requests. All calls are still logged and sent through the data pipeline, but no policy enforcement is applied. This is useful for a rollout phase where you want to observe before enforcing. Uninstall:
runlayer setup hooks --uninstall --yes

Troubleshooting

  1. Restart the client application after installation
  2. Check that the client is supported (see table above)
  3. Ensure Enforce is installed for the correct client
  1. Ensure uv is installed: curl -LsSf https://astral.sh/uv/install.sh | sh
  2. Check network connectivity to your Runlayer instance
  3. Verify the host URL is correct
  4. Try running with verbose output for more details
  1. Check your Runlayer instance connectivity
  2. Review the number of policies being evaluated
  3. Contact Runlayer support if issues persist

Shadow MCP Overview

Understanding the shadow MCP problem

Detect

Discover shadow servers via scheduled scans

Policies

Configure access control policies

Audit Logs

View intercepted tool calls