Status: all phases built; not yet audited externally. Report vulnerabilities privately through GitHub private vulnerability reporting. Do not open public issues for them.
| Provider | Mechanism | Implementation | Reference |
|---|---|---|---|
| Twilio webhooks | X-Twilio-Signature: HMAC-SHA1 of the exact URL plus sorted, de-duplicated POST params, keyed by the auth token. JSON bodies are covered by a bodySHA256 query param. The URL is tried with and without the default port. |
validateTwilioRequest / validate_twilio_request |
twilio-python RequestValidator; fixtures generated from it |
| Twilio Media Streams handshake | Lowercase x-twilio-signature on the WebSocket upgrade |
TwilioMediaTransport.validateConnection |
Same algorithm. The exact URL Twilio signs for the handshake is not yet verified against a live stream. |
| Plivo callbacks | X-Plivo-Signature-V3: HMAC-SHA256 over the method-specific base URL and the nonce. The header may list several signatures. |
validatePlivoRequest / validate_plivo_request |
plivo-python signature_v3; fixtures generated from it |
| Telnyx stream handshake | Not described in Telnyx's streaming docs | Host-supplied connectionValidator |
As for Plivo |
| Vonage WebSocket handshake | Authorization: a custom value, or Bearer HS256 JWT signed with the signature secret |
VonageMediaTransport (authorization option), verifyVonageJwt |
alg must be HS256; iat is required and must fall within maxAgeSeconds (default 300); exp and nbf are honoured |
| Plivo Audio Streams handshake | Not documented by Plivo | Host-supplied connectionValidator. Until one is supplied, stream_auth_validation is requires_configuration. |
Put a per-call secret in the stream URL or extraHeaders and check it in the validator |
Rules:
- Always pass the raw request URL and body (
WebhookRequest.rawBody). Re-serializing parsed params, or re-encoding the URL, breaks signatures. - Behind a proxy, reconstruct the public URL Twilio or Plivo called (scheme, host and path), not the internal one.
- All signature comparisons are constant-time (
timingSafeEqual/hmac.compare_digest). - Validation helpers return
falseand never throw on hostile input. Adapters turn that intosignature_invalidorauthentication_failed.
-
REST call control: the auth token is resolved per request and sent only in the
Authorization: Basicheader. A test asserts that the token appears nowhere else in the request. Account SIDs and auth IDs are not secret. -
STT keys: the Deepgram adapter never sees the API key. The host opens the socket with its own header.
-
Adapters take credentials as
SecretResolverfunctions (() => Promise<string>), resolved on each use. No adapter stores a token string on a config object, andProviderErrornever includes one. -
Test fixtures use obviously fake tokens (
*-test-token-not-real). -
.gitignoreexcludes.env*. Published artifacts contain onlydist/(npm) and thecalling_agent_toolkitpackage (PyPI).
Provider messages are untrusted. Each media session enforces:
| Limit | Default | Option |
|---|---|---|
| Raw message size | 1 MiB | maxMessageBytes / max_message_bytes |
| Decoded audio payload | 64 KiB | maxPayloadBytes / max_payload_bytes |
| Queued events | 500 | maxQueuedEvents / max_queued_events |
Further protections:
- Malformed JSON, invalid UTF-8, bad base64, wrong field types, unknown tracks, messages for another stream, and messages out of order all raise typed errors without changing session state.
- When the queue is full, audio is dropped and counted, and control events raise
buffer_overflow. Memory stays bounded either way.
- No module logs audio, transcripts, DTMF digits, phone numbers or email addresses. Errors carry codes and ids only.
- Plivo
extra_headersand TwiliocustomParametersare passed through to the host as given. Don't put secrets you wouldn't want in your own logs there. - Recording consent and data retention stay the host's responsibility. The toolkit does not persist audio.