Security guidance for Dragon Copilot SDK for Android

This article provides secure configuration guidance for customers integrating Dragon Copilot SDK for Android. Because the SDK processes protected health information (PHI) and personally identifiable information (PII), your integration must follow the practices described here to maintain the confidentiality, integrity, and availability of patient data.

Handled data

Dragon Copilot SDK for Android captures, encrypts, stores, decrypts, and securely uploads data that fall under healthcare privacy regulations. Treat the following information as sensitive:

Category Examples Classification
Patient demographics MRN, name, date of birth, gender PHI
Encounter context Appointment ID, encounter ID, reason for visit PHI
Audio recordings Ambient clinical conversation audio PHI
Provider information Name, email, user ID, EHR ID PII
Authentication tokens OAuth 2.0 bearer tokens (held transiently in memory; never persisted to disk) Credentials

Important

Audio recordings of clinical encounters are among the most sensitive data Dragon Copilot SDK for Android handles. The SDK encrypts the recordings at the point of capture and stores them encrypted on disk. When ready for upload, the SDK decrypts the audio in memory and transmits it securely over an authenticated channel. After a successful upload, the SDK deletes the encrypted audio files from disk.

Data stored on the device

Dragon Copilot SDK for Android follows a standard policy of retaining data for no longer than 30 days. Data is often removed sooner. In some scenarios, data might remain on the device longer than 30 days. All audio on the device is encrypted with a key unique to the device.

Sensitive data stored encrypted on the device includes:

  • Audio recordings of patient-doctor conversations
  • Patient data
    • EMR ID
    • MRN
    • First name
    • Last name
    • Middle name
    • Date of birth
    • Gender
    • Reason for visit
  • Provider data
    • User GUID
    • Name
    • Email
    • Customer ID
    • EMR ID

Data removal after upload

When the SDK delivers audio to Dragon Copilot, it removes the audio file as soon as it successfully uploads the final audio block. This removal often happens in much less than 30 days.

When an upload fails, the SDK retries up to 300 times. An exponential backoff algorithm controls these retries, with a maximum delay of three minutes between upload attempts. Once the service exceeds the maximum retries, it stops trying to upload and immediately deletes the audio file.

Retry delays cluster around 3 minutes after a small number of attempts (fewer than 10), which leads to a window of about 14 hours for an upload to complete before the audio is deleted. As retries only occur when the app is in the foreground, this retry window can extend over a longer period. Two or three days are likely with normal app usage.

Data removal after 30 days

When an encounter has no updates within a 30-day period, the next SDK initialization deletes the encounter data along with all associated audio files.

For audio that exceeds 30 days while pending upload, the next SDK initialization deletes the audio file. If the device is lost or stolen and the client app isn't opened, no SDK initialization occurs and the audio remains on the device indefinitely. The audio is encrypted and should remain secure.

Encryption at rest

Audio recordings

Dragon Copilot encrypts audio data immediately after Opus encoding, using XAES-256-GCM (Extended-Nonce AES-256-GCM, according to the C2SP specification).

Attribute Details
Algorithm XAES-256-GCM (AES-256-GCM with extended nonce)
Key size 256-bit, generated for each recording by the OS CSPRNG (cryptographically secure pseudorandom number generator)
Nonce size 192-bit, generated for each audio chunk by the OS CSPRNG
Implementation OpenSSL 3.5.0 (vendored)
Key storage Android Keystore

Dragon Copilot seals each 20 ms Opus frame with a unique derived key and nonce, and then writes it into an Ogg container. The app stores the per-recording master key in the device's Android Keystore and never writes it to disk in plaintext.

Local database

Session metadata (patient demographics, encounter context, provider details) is persisted in a SQLCipher-encrypted SQLite database.

Attribute Details
Algorithm AES-256-GCM (hardware-accelerated)
Integrity PRAGMA cipher_page_check = ON (per-page tamper detection)
Key management Key derived at database creation, subject to Android access control
SQL injection prevention Parameterized queries via Diesel ORM

On Android, the database file resides in the app's private files directory context.getFilesDir(), accessible only to the app process.

Authentication

Dragon Copilot SDK for Android delegates token acquisition to the integrating app through the AccessTokenProvider interface:

fun interface AccessTokenProvider {
    fun accessToken(
        onSuccess: (token: String, expiryTime: Date) -> Unit,
        onError: (Exception) -> Unit,
    )
}

Recommendations

  • Use a trusted identity provider: Acquire tokens from Microsoft Entra ID (or an equivalent OAuth 2.0 / OpenID Connect provider). Don't implement custom token generation. For more information, see: Authentication for apps integrating or embedding Dragon Copilot

  • Request minimal scopes: Only request the scopes required by the SDK service. Avoid broad or wildcard scopes.

  • Don't persist tokens to disk: Let MSAL or your identity library manage token caching. If you must cache, use Android Keystore and encrypt the value.

  • Handle token expiry: The SDK calls AccessTokenProvider.accessToken() when it needs a valid token. Your implementation must return a fresh or cached-but-unexpired token. Prefer using MSAL's acquireTokenSilently with automatic refresh.

  • Fail securely on errors: Call onError with a descriptive exception rather than returning an empty or expired token.

  • Protect the token in transit: All SDK network communication is conducted over TLS. Ensure that your AccessTokenProvider also fetches tokens over HTTPS.

Example (Entra ID / MSAL)

val accessTokenProvider = AccessTokenProvider { onSuccess, onError ->
    EntraIdHelper.acquireToken(
        context = activity,
        onSuccess = { token, expiryTime -> onSuccess(token, expiryTime) },
        onError = { error -> onError(error) },
    )
}

Attack surface

Dragon Copilot SDK for Android doesn't expose any network listeners, public APIs, or user interface of its own. The following table describes the SDK's components and interfaces:

Surface Description
Public API AmbientClient, AmbientSession, AmbientRecording — Kotlin interfaces consumed in-process.
Network (outbound only) Authenticated gRPC/TLS streams to the Dragon Copilot service for audio upload and configuration retrieval.
Local storage Encrypted database and encrypted audio files in the app's private files directory.
Permissions INTERNET, RECORD_AUDIO, FOREGROUND_SERVICE_MICROPHONE, FOREGROUND_SERVICE, POST_NOTIFICATIONS, READ_PHONE_STATE

The attack surface is limited to:

  • Compromise of the host app's process. Mitigate by following Android's hardening guidelines (code signing, ProGuard/R8 obfuscation, tamper detection).
  • Physical device access. Mitigate by enforcing device-level encryption, screen lock, and biometric authentication. Audio and database encryption keys are stored in hardware-backed keystores that require recent device unlock.
  • Token theft. Mitigate by following the authentication best practices described earlier.

Because the SDK has no server component, UI, or dynamically loaded code, its attack surface doesn't change between releases unless the public API or permission set is modified.

Network security

  • All outbound connections use TLS 1.2 or higher.
  • Certificate verification is performed by Android's default trust store (via rustls-platform-verifier).
  • The SDK doesn't support disabling TLS or pinning custom certificates in production builds.
  • Configuration and upload endpoints are retrieved from an authenticated configuration service; they're not hard-coded.

For more information, see: Frequently asked questions about Dragon Copilot

Communication channels

All traffic is outbound only. The SDK doesn't open any listening sockets. The following table lists the SDK's outbound communication channels and their authentication methods:

Channel Protocol Port Authentication Purpose
Configuration service HTTPS 443 Bearer token (JWT) Fetches streaming URLs and supported languages.
Audio upload/streaming gRPC 443 Bearer token (JWT) Securely streams audio to the Dragon Copilot service.
Logging service HTTPS 443 Bearer token (JWT) Uploads anonymized operational telemetry.
Discovery service HTTPS 443 None (HTTP redirect) Resolves environment-specific service URLs via Microsoft fwlink.

The configuration service determines the streaming and logging URLs at runtime based on the Provider.serverEnvironment and Provider.cloudInstance values. You don't need to hard-code or manually configure any endpoint addresses.

Note

If your network restricts outbound traffic, make sure you add the required URLs to the allow list. For more information, see: URL allow list for Dragon Copilot web app for desktop

Hardening beyond defaults

Dragon Copilot SDK for Android ships with secure defaults. The following additional measures can further reduce risk for high-security deployments:

  • Exclude SDK data from Android auto-backup. Add a <full-backup-content> rule to your AndroidManifest.xml that excludes the drc_ambient directory:

    <application android:fullBackupContent="@xml/backup_rules" ...>
    

    In res/xml/backup_rules.xml:

    <?xml version="1.0" encoding="utf-8"?>
    <full-backup-content>
         <exclude domain="file" path="drc_ambient" />
    </full-backup-content>
    
  • Enforce device security posture. Before initializing AmbientClient, verify that the device has a screen lock enabled and isn't rooted. SDK encryption keys are stored in hardware-backed keystores that benefit from device-level protection.

  • Pin the SDK version. Use a specific SDK release version in your dependency declaration rather than a version range, and validate the artifact checksum against the published SBOM.

Permissions and privileges

Android permissions

The following table lists the Android permissions the SDK requests:

Permission Type Purpose Can be removed?
INTERNET Normal Outbound network for uploading recordings and fetching configuration. No — required for core functionality.
RECORD_AUDIO Dangerous (runtime) Microphone access for recording clinical encounters. No — required for core functionality.
FOREGROUND_SERVICE Normal Runs recording in a foreground service with a visible notification. No — required by Android for sustained audio capture.
FOREGROUND_SERVICE_MICROPHONE Normal Declares the foreground service type as microphone (Android 14+). No — required by Android 14+.
POST_NOTIFICATIONS Dangerous (runtime) Shows a notification while recording is active. No — required for foreground service notification.
READ_PHONE_STATE Dangerous (runtime) Detects incoming phone calls to pause recording. Optional — can be removed if call-interruption handling isn't needed.

The SDK doesn't request any permissions beyond what's listed here. It doesn't access contacts, location, camera, storage, or any other sensitive resources.

Privilege delegation

The SDK runs entirely within the host app's process and inherits its permissions. It doesn't:

  • Start additional processes or services beyond the foreground recording service.
  • Request elevated (root or admin) privileges.
  • Delegate permissions to other apps.
  • Use ContentProvider or BroadcastReceiver components accessible to other apps.

The RecorderForegroundService is declared with android:exported="false", so other apps can't bind to it or start it.

Auditing and traceability

Dragon Copilot SDK for Android generates several correlation identifiers that enable end-to-end traceability of recordings through the system. Use these IDs in support investigations and compliance audits.

Identifier Scope Generated by Purpose
appRunId Per app launch SDK (UUID.randomUUID()) Correlates all activity within a single app session.
clientRunId Per AmbientClient initialization SDK (UUID.randomUUID()) Distinguishes SDK instances within the same app run.
session identifier Per patient encounter Your app (passed to session()) Links recordings to a clinical encounter.
recordingId Per recording SDK (UUID) Uniquely identifies a single audio recording.
correlation_id Per server request SDK Tracks individual requests across SDK and service boundary.
deviceId Per device Android (Settings.Secure.ANDROID_ID) Identifies the physical device.

Audit trail access

  • Client-side: Session and recording identifiers are available through AmbientClient.Listener and AmbientRecording.Listener callbacks (onRecordingStarted, onUploadComplete, and others). Log these identifiers in your own audit systems.
  • Server-side: The Dragon Copilot service retains server-side logs keyed by correlation_id and recordingId. Contact your Dragon Copilot account team for access to server-side audit data.
  • Operational telemetry: The SDK uploads anonymized telemetry (app version, SDK version, device model, OS version) for reliability monitoring. This telemetry doesn't contain PHI. Provider data included in telemetry metadata is hashed with SHA-256 before transmission.

Credential and key management

The following table summarizes how the SDK stores and rotates each type of credential or key:

Secret Storage Rotation
Audio encryption key Android Keystore (per recording) Automatic - new key per recording
Database encryption key Android Keystore Persists for database lifetime
OAuth bearer token In-memory only (managed by AccessTokenProvider) Per-request or on expiry
Build-time PATs ~/.gradle/gradle.properties or AZURE_ARTIFACTS_ENV_ACCESS_TOKEN env var See root README

Important

Never commit credentials to source control. Use environment variables or user-level property files for build-time authentication tokens.

Logging and PHI redaction

Dragon Copilot SDK for Android automatically redacts PHI and PII fields in log output. It replaces sensitive fields with [REDACTED] before emitting any log statement. The SDK further anonymizes provider data by logging only a SHA-256 hash of the combined provider attributes.

  • Avoid logging the raw values returned by EHRData, Patient, or Provider objects.
  • Ensure that app-level logging doesn't capture SDK callback payloads that contain PHI.
  • Follow your organization's log retention and access control policies for any logs that reference SDK operations.

Android-specific guidance

  • Minimum SDK: API 33 (Android 13). Older API levels aren't supported.
  • Foreground service: The SDK runs audio capture in a foreground service (FOREGROUND_SERVICE_MICROPHONE) so the user is always aware that recording is active through a persistent notification.
  • Backup: Android's auto-backup might back up the app's private files directory. Because the database and audio files are encrypted, backup exposure is mitigated. If your threat model excludes cloud backup, add a <full-backup-content> rule to exclude the drc_ambient directory.
  • ProGuard/R8: The SDK ships with consumer ProGuard rules that preserve the required JNI and FFI bindings. Don't add rules that strip classes in com.microsoft.spoke.ffi.

Compliance references

  • NIST SP 800-108r1 — Key Derivation Using Pseudorandom Functions
  • NIST SP 800-38D — AES-GCM Authenticated Encryption
  • C2SP XAES-256-GCM specification
  • Microsoft Security Development Lifecycle (SDL)