# simulate_refactor

Simulate a code change and verify it is safe — detects behavior changes and security issues.

Agent View of the PolicyLayer registry record for `simulate_refactor`. HTML page: https://policylayer.com/tools/3d-tech-solutions-code-scalpel/simulate-refactor

## Facts

- Tool: `simulate_refactor`
- Server: Code Scalpel (`3d-tech-solutions/code-scalpel`) — https://policylayer.com/tools/3d-tech-solutions-code-scalpel.md
- Homepage: https://github.com/3D-Tech-Solutions/code-scalpel
- Risk category: Execute (High risk)
- Registry record: grade D, 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": "simulate_refactor",
    "arguments": {}
  }
}
```

## Why simulate_refactor is rated High

The tool simulates code execution/refactoring and analyzes behavioral changes, implying it runs or symbolically executes code paths to detect issues. Paired with sibling tool 'symbolic_execute', this server clearly runs code analysis pipelines. Misuse could trigger unintended code execution, expose security vulnerabilities, or validate malicious refactors as 'safe'.

From the tool's own definition: "'Simulate a code change and verify it is safe — detects behavior changes and security issues'"

## Use case

AI agents invoke simulate_refactor to trigger actions in Code Scalpel. 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 Code Scalpel:

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

## Other tools on Code Scalpel (3)

- `symbolic_execute` — Execute — https://policylayer.com/tools/3d-tech-solutions-code-scalpel/symbolic-execute.md
- `analyze_code` — Read — https://policylayer.com/tools/3d-tech-solutions-code-scalpel/analyze-code.md
- `unified_sink_detect` — Read — https://policylayer.com/tools/3d-tech-solutions-code-scalpel/unified-sink-detect.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=3d-tech-solutions-code-scalpel · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/3d-tech-solutions-code-scalpel
