dcg

PagerDuty

monitoring.pagerduty

Protects against destructive PagerDuty CLI/API operations like deleting services and schedules (which can break incident routing).

  • 7blocking rules
  • 4safe patterns
  • 2Critical
  • 5High
~/.config/dcg/config.toml
[packs]
enabled = ["monitoring.pagerduty"]

Evaluated when a command contains pd, pagerduty, api.pagerduty.com.

Blocking rules

Each rule ID is monitoring.pagerduty:<name>. Use it in allowlists and [policy.rules].

  1. pagerduty-api-delete-service

    Critical

    PagerDuty API DELETE /services/{id} deletes a PagerDuty service.

    Explanation
    Direct API deletion of a service removes all incident routing immediately. There is no confirmation prompt when using curl directly. Safer alternatives: - GET the service first to verify the ID - Use the pd CLI for better feedback - Export service configuration before deletion
  2. pd-service-delete

    Critical

    pd service delete removes a PagerDuty service, which can break incident routing.

    Explanation
    Deleting a PagerDuty service removes all incident routing, integrations, and escalation policies attached to it. Incidents will no longer be created for this service, potentially causing outages to go unnoticed. Safer alternatives: - pd service list: Verify the service before deletion - Disable the service temporarily instead of deleting - Export service configuration via API before deletion
  3. pagerduty-api-delete-schedule

    High

    PagerDuty API DELETE /schedules/{id} deletes a PagerDuty schedule.

    Explanation
    API deletion of a schedule removes on-call rotations immediately. Escalation policies referencing this schedule will have coverage gaps. Safer alternatives: - GET the schedule first to verify the ID - Use the pd CLI for better feedback - Check dependent escalation policies before deletion
  4. pd-escalation-policy-delete

    High

    pd escalation-policy delete removes a PagerDuty escalation policy.

    Explanation
    Deleting an escalation policy breaks incident routing for all services using it. Incidents may not be escalated properly, leading to delayed response times. Safer alternatives: - Review which services use this escalation policy - Update the policy rather than deleting - Assign services to a different policy before deletion
  5. pd-schedule-delete

    High

    pd schedule delete removes a PagerDuty schedule.

    Explanation
    Deleting a schedule removes all on-call rotations and overrides. Escalation policies using this schedule will have gaps in coverage, potentially leaving incidents unassigned. Safer alternatives: - pd schedule get <id>: Review schedule details first - Update the schedule rather than deleting - Check which escalation policies reference this schedule
  6. pd-team-delete

    High

    pd team delete removes a PagerDuty team.

    Explanation
    Deleting a team removes the organizational grouping and may affect access controls, service ownership, and escalation policies. Safer alternatives: - pd team list: Verify the team before deletion - Reassign team members and services first - Merge teams rather than delete
  7. pd-user-delete

    High

    pd user delete removes a PagerDuty user.

    Explanation
    Deleting a user removes them from all schedules and escalation policies. On-call coverage may have gaps, and incident history associated with this user may be affected. Safer alternatives: - Deactivate the user instead of deleting - Reassign their schedule shifts first - Transfer incident ownership before deletion

Safe patterns

Checked first. A command that matches one is never blocked by this pack.

  • pd-service-read
  • pd-schedule-read
  • pd-incident-list
  • pagerduty-api-get