dcg

SendGrid

email.sendgrid

Protects against destructive SendGrid API operations like template deletion, API key deletion, and domain authentication removal.

  • 8blocking rules
  • 0safe patterns
  • 3Critical
  • 3High
  • 2Medium
~/.config/dcg/config.toml
[packs]
enabled = ["email.sendgrid"]

Evaluated when a command contains sendgrid, api.sendgrid.com.

Blocking rules

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

  1. sendgrid-delete-api-key

    Critical

    DELETE to SendGrid /v3/api_keys removes an API key.

    Explanation
    Deleting an API key immediately revokes access. All applications using this key will fail to authenticate. You cannot recover the key value after deletion. Safer alternatives: - Create new API key before deleting old one - Update applications with new key first - Use API key scopes to limit damage
  2. sendgrid-delete-subuser

    Critical

    DELETE to SendGrid /v3/subusers removes a subuser account.

    Explanation
    Deleting a subuser removes all their data including templates, statistics, and API keys. Applications using subuser credentials will fail immediately. This cannot be undone. Safer alternatives: - Export subuser data and configurations - Migrate to new subuser before deleting - Disable subuser access instead of deleting
  3. sendgrid-delete-whitelabel-domain

    Critical

    DELETE to SendGrid /v3/whitelabel/domains removes domain authentication.

    Explanation
    Deleting domain authentication removes DKIM and SPF records. Emails sent from this domain will fail authentication checks, leading to delivery issues and potential spam classification. Safer alternatives: - Document DNS records before deletion - Verify new domain authentication is working - Plan for DNS propagation delays
  4. sendgrid-delete-sender

    High

    DELETE to SendGrid /v3/senders or /v3/verified_senders removes a sender identity.

    Explanation
    Deleting a sender identity prevents sending from that email address. Marketing campaigns and transactional emails using this sender will fail. Re-verification may require email confirmation. Safer alternatives: - Create new sender identity before deleting - Update email configurations first - Check for scheduled campaigns using this sender
  5. sendgrid-delete-suppression

    High

    DELETE to SendGrid suppression endpoints removes entries from suppression lists.

    Explanation
    Removing suppression entries allows emails to be sent to addresses that previously bounced, complained, or unsubscribed. This can damage sender reputation and violate CAN-SPAM compliance. Safer alternatives: - Verify the email address is valid before removing - Check bounce reason codes - Respect unsubscribe requests (may be legally required)
  6. sendgrid-delete-template

    High

    DELETE to SendGrid /v3/templates removes a transactional template.

    Explanation
    Deleting a template breaks any email sends referencing that template ID. Applications will receive errors when trying to send with a deleted template. All versions of the template are removed. Safer alternatives: - GET /v3/templates/{id}: Export template before deletion - Create a new version instead of deleting - Check email code for template ID references
  7. sendgrid-delete-teammate

    Medium

    DELETE to SendGrid /v3/teammates removes a teammate from the account.

    Explanation
    Deleting a teammate revokes their access to the SendGrid account. They lose access to templates, statistics, and settings they may have been managing. Safer alternatives: - Change teammate permissions instead of deleting - Ensure knowledge transfer is complete - Verify teammate doesn't own critical configurations
  8. sendgrid-delete-webhook

    Medium

    DELETE to SendGrid /v3/user/webhooks removes a webhook configuration.

    Explanation
    Deleting a webhook stops event notifications to your application. Bounce handling, open tracking, and click tracking data will not be received. This can affect email analytics and automation. Safer alternatives: - Document webhook URL and event types - Test new webhook before removing old one - Verify no critical automations depend on events