# auto_remediate

Generate an automated security fix for a specific finding. Creates a GitHub PR with the patched code. Verifies the fix with Level 1 SAST before opening the PR. Requires authentication, 3 credits, and ANTHROPIC_API_KEY.

Agent View of the PolicyLayer registry record for `auto_remediate`. HTML page: https://policylayer.com/tools/com-graneth-mcp-server/auto-remediate

## Facts

- Tool: `auto_remediate`
- Server: Mcp Server (`@graneth/mcp-server`) — https://policylayer.com/tools/com-graneth-mcp-server.md
- Install: `npx -y @graneth/mcp-server`
- Homepage: https://github.com/zubovartemiy/graneth-mcp
- Risk category: Write (Medium risk)
- Registry record: grade D, identity unverified
- Server auth posture: open
- Server rate-limited: yes
- Parameters: 11 (10 required)
- Recommended policy verdict: Rate-limited

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `ref` | string | no | Git ref (branch/SHA) |
| `file` | string | yes | File path containing the vulnerability (relative, no traversal) |
| `line` | integer | yes | Line number of the finding |
| `repo` | string | yes | GitHub repository name |
| `owner` | string | yes | GitHub repository owner |
| `title` | string | yes | Finding title from scan results |
| `token` | string | yes | GitHub token with repo write access |
| `severity` | string | yes | Finding severity |
| `description` | string | yes | Finding description |
| `finding_type` | string | yes | Finding type e.g. 'command_injection', 'sql_injection' |
| `recommendation` | string | yes | Recommended fix from scan results |

Parameters from the server's own tool schema.

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

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "auto_remediate",
    "arguments": {
      "file": "<file>",
      "line": 0,
      "repo": "<repo>",
      "owner": "<owner>",
      "title": "<title>",
      "token": "<token>",
      "severity": "<severity>",
      "description": "<description>",
      "finding_type": "<finding_type>",
      "recommendation": "<recommendation>"
    }
  }
}
```

## Why auto_remediate is rated Medium

Creates a pull request modifying code, a reversible write action with significant blast radius.

From the tool's own definition: "Creates a GitHub PR with the patched code"

Risk signals: Accepts file system path (file) · Handles credentials or secrets (token) · High parameter count (11 properties)

## Use case

AI agents use auto_remediate to create or update resources in Mcp Server, usually the action step of a workflow, after the agent has gathered context. Every call changes real data in your Mcp Server environment.

## Recommended policy (PolicyLayer)

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

```json
{
  "version": "1",
  "default": "deny",
  "tools": {
    "auto_remediate": {
      "limits": [
        {
          "counter": "auto_remediate_rate",
          "window": "minute",
          "max": 30,
          "scope": "grant"
        }
      ]
    }
  }
}
```

## Other tools on Mcp Server (3)

- `scan_repository` — Execute — https://policylayer.com/tools/com-graneth-mcp-server/scan-repository.md
- `get_findings` — Read — https://policylayer.com/tools/com-graneth-mcp-server/get-findings.md
- `pre_flight_check` — Read — https://policylayer.com/tools/com-graneth-mcp-server/pre-flight-check.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=com-graneth-mcp-server · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/com-graneth-mcp-server
