SMS & voice
Nightwatch reaches the on-call phone through Vonage: a one-time code to approve ASK actions, a short SMS when something needs a person, and a voice call if that SMS goes unacknowledged. It is off until you add credentials.
1Add credentials
Set three environment variables before starting the agent. The phone number is in E.164 format. It is masked in logs and never stored in the database.
export VONAGE_API_KEY=[YOUR KEY] export VONAGE_API_SECRET=[YOUR SECRET] export NIGHTWATCH_ONCALL_NUMBER=+4915100000000
Check the connection with nightwatch page doctor --online. Set NIGHTWATCH_VONAGE=0 to switch paging off again.
2How an approval works
- Trigger. An ASK action is held and nothing runs yet.
- Deliver. A one-time code goes to the on-call phone by SMS. They can ask for a voice call instead.
- Verify. The code is entered in the local console.
- Grant or deny. A correct code runs the action. Wrong, expired or denied means it never runs, and the pending code is cancelled.
If the phone can't be reached, the action can be approved in the local console instead, if approval.local_fallback is on. Every fallback approval is written to the audit log.
3What an SMS says
Pages are built from fixed templates. They contain a status word, the station name, an 8-character reference and redaction counts. Never log text, model output or anything taken from the log.
| When | Example |
|---|---|
| HOLD | Nightwatch HOLD (bay-04): quarantine held (malware hit). Approve via Verify code or console. Ref 7c1e09ab. 2 PII local, 0B logs. |
| BLOCK | Nightwatch BLOCK (bay-04): policy blocked restart_service on protected target. Review needed. Ref 3fa2d610. 2 PII local, 0B logs. |
| ALERT | Nightwatch ALERT (bay-04): AI output rejected by guardrails; escalated safely. Review needed. Ref 91d0c2e4. 0 PII, 0B logs. |
Preview any page offline with nightwatch page preview.
4Voice escalation
If a BLOCK or CRITICAL page is not acknowledged within escalation.voice (5 minutes by default), Nightwatch calls the on-call phone with the same short message read aloud. Acknowledge from the local console or with nightwatch page ack <ref> to cancel the call.
For full Text-to-Speech via Vonage Voice API, also set VONAGE_APPLICATION_ID, VONAGE_PRIVATE_KEY (PEM path or content) and VONAGE_VOICE_FROM. If only API key and secret are set, Nightwatch falls back cleanly to a Verify v2 voice call.
Offline queue and rate limits
- When the uplink is down, pages queue on the box and go out as soon as it returns.
- At most 6 pages an hour are sent, so a bad night doesn't flood the phone.
- During quiet hours only HIGH and CRITICAL pages go out. The rest wait for the morning summary.