Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:0xSteph Pentest ai WebhookNotifier

From Leeroopedia
Knowledge Sources
Domains Webhooks, Notifications, Integration
Last Updated 2026-10-23 00:00 GMT

Overview

Concrete tool for sending webhook notifications to Slack, Jira, or generic HTTP endpoints when key engagement events occur, provided by the pentest-ai engine.

Description

The WebhookNotifier class sends HTTP POST notifications when configured events fire during an engagement. Supported events: engagement.started, engagement.completed, engagement.failed, finding.new, finding.critical, phase.started, phase.completed. Supports generic, Slack, and Jira webhook types. URL can be set via constructor or PENTEST_WEBHOOK_URL env var.

Usage

Import this class when you need to send engagement event notifications. Used by the orchestrator at phase and engagement boundaries.

Code Reference

Source Location

Signature

VALID_EVENTS = frozenset({...})

class WebhookNotifier:
    def __init__(
        self,
        url: str | None = None,
        events: set[str] | None = None,
        headers: dict[str, str] | None = None,
        webhook_type: str = "generic",
    ): ...

    def notify(self, event: str, payload: dict[str, Any]) -> bool: ...

Import

from engine.webhooks import WebhookNotifier, VALID_EVENTS

I/O Contract

Inputs

Name Type Required Description
url None No Webhook URL (defaults to PENTEST_WEBHOOK_URL env)
event str Yes Event name from VALID_EVENTS
payload dict Yes Event payload to send
webhook_type str No "generic", "slack", or "jira" (default: "generic")

Outputs

Name Type Description
success bool True if notification was sent successfully

Usage Examples

Send Webhook Notifications

from engine.webhooks import WebhookNotifier

notifier = WebhookNotifier(
    url="https://hooks.slack.com/services/T0/B0/X",
    webhook_type="slack",
)

notifier.notify("engagement.started", {"target": "example.com", "engagement_id": "abc"})
notifier.notify("finding.critical", {"title": "SQLi", "target": "https://example.com/search"})

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment