Skip to main content

Alerting (Slack & Email)

Overview​

The alerting service dispatches notifications when test results cross configured thresholds. Alerts are evaluated after each result ingestion.

Alerting is not available on Vercel (backend-serverless/): the Alerts & Notifications card is hidden there.

Channels​

Slack​

Alerts are sent as Block Kit formatted messages via a Slack webhook URL.

  1. Create an Incoming Webhook in your Slack workspace
  2. Navigate to Settings → Integrations → Alerts & Notifications → Slack
  3. Paste the webhook URL. It must be an https://hooks.slack.com/services/... or https://hooks.slack.com/workflows/... address; any other host is rejected, and redirects are not followed
  4. Send a test message to verify

Email​

Alerts are sent via SMTP using Nodemailer.

  1. Navigate to Settings → Integrations → Alerts & Notifications → Email
  2. Configure SMTP settings (host, port, username, password)
  3. Add recipient email addresses
  4. Send a test email to verify

When you reopen the dialog, the password is never shown and the Username field is empty, with the saved value (masked, e.g. ****abcd) as a hint. Leave both blank to keep what is saved. Test Channels then uses the saved username and password, but only while the SMTP host is unchanged: if you change the host, type the credentials again, so a test can never send the stored password to a different server.

If the test fails with Connection timeout after about 30 seconds, the server could not reach the SMTP host at all. That is usually an outbound firewall on the ProjectAchilles server dropping traffic to the mail server's port (465 or 587); ask your network team to allow it, or use your organization's internal mail relay.

Thresholds​

Turn on the Thresholds section and fill in the checks you want. An empty field turns that check off.

FieldAlert when
Defense Score minimum (%)The Defense Score is below this value
Error Rate maximum (%)The error rate is above this value
Secure Score minimum (%)Microsoft Secure Score is below this value (shown when Microsoft Defender is configured)
SentinelOne agent health: infected, detect-only and outdated agents maxThe count from the latest SentinelOne posture snapshot is above the maximum (shown when SentinelOne is configured)
Cooldown (minutes)Minimum time between two alerts (default 15)

All metrics are sent in one message: the ones that crossed their threshold and the ones that pass.

Which Defense Score the alert uses​

The alert compares your threshold to the same score as the dashboard tile:

  • Each test on each host counts once, by its latest conclusive result. A multi-stage test is protected if any of its stages was blocked or detected.
  • The window is fixed at the last 30 days. The dashboard tile follows the date range you pick there, so the two numbers match when the dashboard is set to 30 days with no filters. On an install with several organizations the alert scores all of them together, while the dashboard shows the viewer's organization.
  • Results covered by a risk acceptance are left out, as on the dashboard.
  • A test that starts failing lowers the score on its next run. The score is read from a snapshot kept for about 30 seconds, so the check runs when a result arrives and once more about 35 seconds after the last result of a burst; a breach is noticed within about a minute.
  • If no test has a conclusive result in the last 30 days, there is no score and this check is skipped. The other checks still run.

The alert message prints this basis next to the number.

EDR detections are attached to results a few minutes later, when the EDR integration next syncs. A result that an EDR detected can therefore count as unprotected when the alert is checked and trigger an alert, while the dashboard shows it as detected a few minutes later.

Notification Bell​

Recent alerts also appear in the in-app notification bell, next to the search box in the sidebar, and under Recent Alerts on the settings card. The list holds the last 50 alerts and is empty again after a backend restart.

Architecture​

The alerting service is hooked into the result ingestion pipeline — every time a test result is ingested into Elasticsearch, the service evaluates configured thresholds and dispatches notifications.

Dispatch Pipeline​

The full evaluation and dispatch flow proceeds as follows:

Threshold Evaluation Logic​

These metrics are evaluated independently. Each can trigger an alert if its configured threshold is breached:

MetricDirectionExampleEvaluation
Defense ScoreMinimum (floor)defense_score_min: 80Alert if current score < 80%
Error RateMaximum (ceiling)error_rate_max: 5Alert if error rate > 5%
Secure ScoreMinimum (floor)secure_score_min: 75Alert if Microsoft Secure Score < 75%
SentinelOne agent healthMaximum (ceiling)s1_infected_agents_max: 0, s1_detect_only_agents_max: 0, s1_outdated_agents_max: 10Alert if the count of infected, detect-only or outdated agents is above the maximum
info

The Secure Score threshold is only evaluated when the Microsoft Defender integration is configured, and the SentinelOne thresholds only when SentinelOne is configured. Otherwise they are silently skipped.

Cooldown mechanism: After an alert is dispatched, a configurable cooldown period (default: 15 minutes) prevents duplicate alerts from firing on subsequent result ingestions. The time of the last alert is saved with the alert settings (last_alert_at), so the cooldown survives a backend restart.

Alert history: A fixed-size in-memory ring buffer stores the last 50 alerts for display in the Notification Bell component. This history is not persisted — it resets on server restart.

Agent Alerts​

In addition to test result thresholds, the alerting service monitors agent health and dispatches notifications when fleet conditions degrade. Agent alerts are evaluated every 60 seconds alongside the offline detection background job.

ThresholdDescriptionExample
Offline DurationAlert when any agent has been offline longer than X hoursoffline_hours_threshold: 24 — alert if any agent offline >24h
FlappingAlert when an agent reconnects more than N times in 24 hoursflapping_threshold: 5 — alert if agent reconnects >5x/day
Fleet Online %Alert when the percentage of online agents drops below X%fleet_online_percent_min: 80 — alert if fewer than 80% of fleet is online

Agent alerts use a separate cooldown from test result alerts (default: 30 minutes). This prevents the two alert types from suppressing each other.

Configure agent alerts in Settings → Integrations → Alerts & Notifications → Agent Alerts.

Slack Block Kit Format​

Slack alerts use the Block Kit framework for rich, structured messages:

┌─────────────────────────────────────────┐
│ ⚠️ ProjectAchilles Alert │ ← Header block
├─────────────────────────────────────────┤
│ One or more security metrics have │ ← Section: summary text
│ crossed configured thresholds. │
├─────────────────────────────────────────┤
│ ✗ Defense Score: 72% (threshold: > 80%) │ ← Section: breached metrics
│ ✓ Error Rate: 3% (threshold: < 5%) │ (✓ = passing, ✗ = breached)
│ ✗ Secure Score: 68% (threshold: > 75%) │
├─────────────────────────────────────────┤
│ Triggered by: T1059.001 (WORKSTATION-3) │ ← Context: test + agent
├─────────────────────────────────────────┤
│ [ View Dashboard ] │ ← Actions: link button
└─────────────────────────────────────────┘

Both breached and passing metrics are included so the recipient sees the full picture at a glance. The dashboard button links directly to the Analytics page.

Email Template​

HTML email alerts follow the same information structure:

SectionContent
Red banner"ProjectAchilles Alert" with alert summary
Metric tableEvery evaluated metric with its current value, threshold and status
Context blockTriggering test name and agent
Dashboard buttonDirect link to the Analytics dashboard
FooterWhere to configure the thresholds

Emails are sent via Nodemailer with configurable SMTP settings (host, port, TLS, authentication).

Settings Storage​

Alert configuration is stored in ~/.projectachilles/integrations.json, with the sensitive fields encrypted with AES-256-GCM:

{
"alerts": {
"thresholds": {
"enabled": true,
"defense_score_min": 80,
"error_rate_max": 5,
"secure_score_min": 75
},
"cooldown_minutes": 15,
"slack": {
"webhook_url": "enc:<iv>:<tag>:<ciphertext>",
"configured": true,
"enabled": true
},
"email": {
"smtp_host": "smtp.gmail.com",
"smtp_port": 587,
"smtp_secure": false,
"smtp_user": "enc:<iv>:<tag>:<ciphertext>",
"smtp_pass": "enc:<iv>:<tag>:<ciphertext>",
"from_address": "alerts@example.com",
"recipients": ["admin@example.com"],
"configured": true,
"enabled": true
},
"agent_alerts": {
"enabled": true,
"offline_hours_threshold": 24,
"flapping_threshold": 5,
"fleet_online_percent_min": 80,
"cooldown_minutes": 30
}
}
}
tip

Sensitive fields (webhook URLs, SMTP credentials) are prefixed with enc: and encrypted using AES-256-GCM. The encryption key is derived from the ENCRYPTION_SECRET environment variable.

On an install with Clerk organizations, a user in an organization saves the alert settings for that organization (orgs.<org id>.alerts in the same file). The threshold and agent checks read the install-wide section, which is the one saved by a user who is not in an organization.

Connection Testing​

Before saving channel configuration, use the built-in test functions:

  • Slack: Sends a test message to the webhook URL and verifies a 200 response. Only hooks.slack.com webhooks are accepted
  • Email: Opens a transient SMTP connection and verifies authentication succeeds. Blank or masked credentials fall back to the saved ones only when the host matches the saved host

Both test endpoints are available in the Settings UI and return clear success/failure messages.