# generate_detection_rules

Generate detection rules (Sigma, SPL, KQL) for all discovered attacks. Every offensive technique gets a corresponding detection rule for blue teams. Runs asynchronously; returns immediately with status='running'. Rules attach to findings in the engagement; pull them with get_findings(engagement_id) once status flips to 'completed'.

Agent View of the PolicyLayer registry record for `generate_detection_rules`. HTML page: https://policylayer.com/tools/0xsteph-pentest-ai/generate-detection-rules

## Facts

- Tool: `generate_detection_rules`
- Server: Pentest Ai (`0xsteph/pentest-ai`) — https://policylayer.com/tools/0xsteph-pentest-ai.md
- Homepage: https://github.com/0xSteph/pentest-ai
- Risk category: Write (Medium 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": "generate_detection_rules",
    "arguments": {}
  }
}
```

## Why generate_detection_rules is rated Medium

This tool creates new detection rule artifacts within the engagement system. While the rules themselves are non-malicious (defensive in nature—'for blue teams'), the tool is performing a Write operation by generating and storing new data objects. It is not Read (data retrieval only), not Execute (does not run/trigger external operations), not Destructive (rules can be removed), and not Financial.

From the tool's own definition: "Tool generates and attaches detection rules (Sigma, SPL, KQL) to findings in the engagement; creates new data structures (rules) that are stored and retrieved later via get_findings()."

Risk signals: Bulk/mass operation — affects multiple targets

## Use case

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

## Recommended policy (PolicyLayer)

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

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

## Other tools on Pentest Ai (50)

- `kill_process` — Destructive — https://policylayer.com/tools/0xsteph-pentest-ai/kill-process.md
- `authenticated_scan` — Execute — https://policylayer.com/tools/0xsteph-pentest-ai/authenticated-scan.md
- `builtin_scan` — Execute — https://policylayer.com/tools/0xsteph-pentest-ai/builtin-scan.md
- `ensure_tools_installed` — Execute — https://policylayer.com/tools/0xsteph-pentest-ai/ensure-tools-installed.md
- `http_request` — Execute — https://policylayer.com/tools/0xsteph-pentest-ai/http-request.md
- `plan_tools` — Execute — https://policylayer.com/tools/0xsteph-pentest-ai/plan-tools.md
- `resume_engagement` — Execute — https://policylayer.com/tools/0xsteph-pentest-ai/resume-engagement.md
- `run_probe` — Execute — https://policylayer.com/tools/0xsteph-pentest-ai/run-probe.md
- `run_recon` — Execute — https://policylayer.com/tools/0xsteph-pentest-ai/run-recon.md
- `run_tool` — Execute — https://policylayer.com/tools/0xsteph-pentest-ai/run-tool.md
- `scan_dns_builtin` — Execute — https://policylayer.com/tools/0xsteph-pentest-ai/scan-dns-builtin.md
- `scan_ports_builtin` — Execute — https://policylayer.com/tools/0xsteph-pentest-ai/scan-ports-builtin.md
- `select_agent` — Execute — https://policylayer.com/tools/0xsteph-pentest-ai/select-agent.md
- `start_campaign` — Execute — https://policylayer.com/tools/0xsteph-pentest-ai/start-campaign.md
- `start_engagement` — Execute — https://policylayer.com/tools/0xsteph-pentest-ai/start-engagement.md
- `test_active_directory` — Execute — https://policylayer.com/tools/0xsteph-pentest-ai/test-active-directory.md
- `test_api_security` — Execute — https://policylayer.com/tools/0xsteph-pentest-ai/test-api-security.md
- `test_cloud` — Execute — https://policylayer.com/tools/0xsteph-pentest-ai/test-cloud.md
- `test_credentials` — Execute — https://policylayer.com/tools/0xsteph-pentest-ai/test-credentials.md
- `test_mobile` — Execute — https://policylayer.com/tools/0xsteph-pentest-ai/test-mobile.md
- `test_privesc` — Execute — https://policylayer.com/tools/0xsteph-pentest-ai/test-privesc.md
- `test_social_engineering` — Execute — https://policylayer.com/tools/0xsteph-pentest-ai/test-social-engineering.md
- `test_vulnerabilities` — Execute — https://policylayer.com/tools/0xsteph-pentest-ai/test-vulnerabilities.md
- `test_web_app` — Execute — https://policylayer.com/tools/0xsteph-pentest-ai/test-web-app.md
- `test_wireless` — Execute — https://policylayer.com/tools/0xsteph-pentest-ai/test-wireless.md
- `validate_finding` — Execute — https://policylayer.com/tools/0xsteph-pentest-ai/validate-finding.md
- `browser_inspect` — Read — https://policylayer.com/tools/0xsteph-pentest-ai/browser-inspect.md
- `discover_attack_chains` — Read — https://policylayer.com/tools/0xsteph-pentest-ai/discover-attack-chains.md
- `get_attack_chains` — Read — https://policylayer.com/tools/0xsteph-pentest-ai/get-attack-chains.md
- `get_campaign_summary` — Read — https://policylayer.com/tools/0xsteph-pentest-ai/get-campaign-summary.md
- …and 20 more: https://policylayer.com/tools/0xsteph-pentest-ai.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=0xsteph-pentest-ai · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/0xsteph-pentest-ai
