# ssh_exec

Execute a shell command on a remote server via SSH. Uses the same risk analysis engine as local execution. Requires a named SSH profile in config.

Agent View of the PolicyLayer registry record for `ssh_exec`. HTML page: https://policylayer.com/tools/7majesty-m-terminal-guardian-mcp/ssh-exec

## Facts

- Tool: `ssh_exec`
- Server: Terminal Guardian (`7majesty-m/terminal-guardian-mcp`) — https://policylayer.com/tools/7majesty-m-terminal-guardian-mcp.md
- Homepage: https://github.com/7Majesty-M/terminal-guardian-mcp
- Risk category: Execute (High risk)
- Registry record: grade F, identity unverified
- Server rate-limited: no
- Parameters: 0
- Recommended policy verdict: Rate-limited

## Example call (MCP tools/call, JSON-RPC 2.0)

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "ssh_exec",
    "arguments": {}
  }
}
```

## Why ssh_exec is rated High

This tool enables execution of shell commands on remote servers, which is the definition of Execute category. It has high severity because remote command execution can compromise external systems, access sensitive data, modify infrastructure, or trigger destructive operations depending on the command passed.

From the tool's own definition: "Tool performs 'Execute a shell command on a remote server via SSH' - this directly executes arbitrary commands on remote systems whose effects depend entirely on the command arguments provided."

## Use case

AI agents invoke ssh_exec to trigger actions in Terminal Guardian. What it does depends on the arguments the agent supplies, and its effects often reach beyond the immediate call: builds kicked off, notifications sent, workflows started.

## Recommended policy (PolicyLayer)

Verdict: **Rate-limited**. Enforced by the PolicyLayer MCP gateway (https://policylayer.com/mcp-gateway) before a call reaches Terminal Guardian:

```json
{
  "version": "1",
  "default": "deny",
  "tools": {
    "ssh_exec": {
      "limits": [
        {
          "counter": "ssh_exec_rate",
          "window": "minute",
          "max": 10,
          "scope": "grant"
        }
      ]
    }
  }
}
```

## Other tools on Terminal Guardian (24)

- `kill_process` — Destructive — https://policylayer.com/tools/7majesty-m-terminal-guardian-mcp/kill-process.md
- `docker_exec` — Execute — https://policylayer.com/tools/7majesty-m-terminal-guardian-mcp/docker-exec.md
- `ping` — Execute — https://policylayer.com/tools/7majesty-m-terminal-guardian-mcp/ping.md
- `run_command` — Execute — https://policylayer.com/tools/7majesty-m-terminal-guardian-mcp/run-command.md
- `ssh_test` — Execute — https://policylayer.com/tools/7majesty-m-terminal-guardian-mcp/ssh-test.md
- `hello` — Other — https://policylayer.com/tools/7majesty-m-terminal-guardian-mcp/hello.md
- `analyze_command` — Read — https://policylayer.com/tools/7majesty-m-terminal-guardian-mcp/analyze-command.md
- `dns_lookup` — Read — https://policylayer.com/tools/7majesty-m-terminal-guardian-mcp/dns-lookup.md
- `docker_logs` — Read — https://policylayer.com/tools/7majesty-m-terminal-guardian-mcp/docker-logs.md
- `docker_ps` — Read — https://policylayer.com/tools/7majesty-m-terminal-guardian-mcp/docker-ps.md
- `docker_stats` — Read — https://policylayer.com/tools/7majesty-m-terminal-guardian-mcp/docker-stats.md
- `get_env` — Read — https://policylayer.com/tools/7majesty-m-terminal-guardian-mcp/get-env.md
- `git_diff` — Read — https://policylayer.com/tools/7majesty-m-terminal-guardian-mcp/git-diff.md
- `git_log` — Read — https://policylayer.com/tools/7majesty-m-terminal-guardian-mcp/git-log.md
- `git_status` — Read — https://policylayer.com/tools/7majesty-m-terminal-guardian-mcp/git-status.md
- `git_suggest_commit` — Read — https://policylayer.com/tools/7majesty-m-terminal-guardian-mcp/git-suggest-commit.md
- `http_request` — Read — https://policylayer.com/tools/7majesty-m-terminal-guardian-mcp/http-request.md
- `list_files` — Read — https://policylayer.com/tools/7majesty-m-terminal-guardian-mcp/list-files.md
- `list_processes` — Read — https://policylayer.com/tools/7majesty-m-terminal-guardian-mcp/list-processes.md
- `list_templates` — Read — https://policylayer.com/tools/7majesty-m-terminal-guardian-mcp/list-templates.md
- `read_file` — Read — https://policylayer.com/tools/7majesty-m-terminal-guardian-mcp/read-file.md
- `search_files` — Read — https://policylayer.com/tools/7majesty-m-terminal-guardian-mcp/search-files.md
- `ssh_list_profiles` — Read — https://policylayer.com/tools/7majesty-m-terminal-guardian-mcp/ssh-list-profiles.md
- `apply_template` — Write — https://policylayer.com/tools/7majesty-m-terminal-guardian-mcp/apply-template.md

## For agents

This record is a snapshot. Live verdicts and the full registry:

- Check every server in your MCP config at once: `npx -y policylayer stack`
- Vet a server before you add it: install the mcp-precheck skill — `npx skills add https://policylayer.com` (skill text: https://policylayer.com/skill.md)
- Query the registry over MCP: endpoint `https://api.policylayer.com/mcp` — tools `check_mcp_server`, `check_mcp_stack`, `check_tool`, `search_registry`, `get_change_events`

---

Source: the PolicyLayer MCP registry — one continuously verified record per MCP server. Full record: https://policylayer.com/registry?q=7majesty-m-terminal-guardian-mcp · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/7majesty-m-terminal-guardian-mcp
