# docker_exec

Execute a command inside a running Docker container. Requires confirmed: true. Output capped at 512KB.

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

## Facts

- Tool: `docker_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": "docker_exec",
    "arguments": {}
  }
}
```

## Why docker_exec is rated High

This tool allows running arbitrary commands within Docker containers, which can have wide-ranging side effects depending on what commands are executed. While the server claims to provide sandboxing and risk analysis, the tool itself performs command execution whose effects depend entirely on the arguments provided. This places it in the Execute category rather than Read or Write.

From the tool's own definition: "Tool description states 'Execute a command inside a running Docker container'. The word 'Execute' directly indicates code execution capability. Combined with the ability to run arbitrary commands in containers, this is a clear Execute-category tool."

## Use case

AI agents invoke docker_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": {
    "docker_exec": {
      "limits": [
        {
          "counter": "docker_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
- `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_exec` — Execute — https://policylayer.com/tools/7majesty-m-terminal-guardian-mcp/ssh-exec.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
