SG SealGrid Athena Docs

Session Recordings

Capture the built-in WebRTC technician screen-share as a stored video, disclose recording to the end user, control recording per agent, and replay, export, or auto-retain the results.

Session recordings extend the built-in WebRTC remote-desktop feature: when recording is enabled, the technician's screen-share of an agent is captured to a single WebM file on the server, with a metadata row you can list, replay in the browser, download, or delete. Whether a given session is recorded is decided on the server before the session starts — the technician's browser can never turn recording on by itself.

How recording works#

Recording is decided once, at session start, and enforced by the server:

  1. When a screen-share session reaches the connected state, the server resolves a record decision and a disclose decision and stamps them on the live session. These flags — not any browser or helper reply — are the authoritative truth.
  2. Only if the record flag is true does the browser obtain a recording id (POST api/recordings/begin). If recording is not enabled for the session, begin is refused with 409 Conflict and no recording row is ever created.
  3. The browser then streams captured video to the server in chunks, appended to a single per-session file. Chunks are written straight to disk — the whole session is never buffered in memory.
  4. When the session ends the recording is finalized: the server repairs the WebM duration, computes a whole-file SHA-256, and stamps the end time, duration and final size.

Because the record decision is resolved server-side and begin is refused unless that decision is true, a technician cannot self-authorize a recording — even by calling the API directly.

Recording captures the built-in WebRTC screen-share only. The optional RustDesk integration is a separate remote-access path and is not captured by this feature.

Record policy & disclosure#

Whether a session is recorded is the combination of a global default and an optional per-agent override:

Policy resolution is default-deny: if the server cannot read the effective policy for any reason, the session is not recorded. The per-agent override is exposed in the agent-details UI and via the API and PowerShell (see below).

Disclosure to the end user is controlled globally, independent of the per-agent record override:

SettingPurposeDefault
RemoteSession:Recording:DiscloseToUserShow the end user that the session is being recordedtrue
RemoteSession:Recording:DisclosureMessageText shown to the end user when disclosure is onThis session is being recorded.

Every recording row also snapshots, at capture start, the consent state and whether recording was disclosed (wasDisclosed), so the disclosure that was in effect is preserved with the recording.

Recording metadata#

Each recording is described by a metadata row. The recording id is also the name of its on-disk folder.

FieldMeaning
idRecording unique identifier (also the on-disk folder name)
agentIdAgent the recording belongs to
sessionIdScreen-share session the recording captures
technicianUsernameTechnician who captured the recording
startTimeWhen capture started
endTimeWhen capture finished (null until finalized)
durationSecondsTotal duration in seconds (null until finalized)
fileSizeBytesOn-disk size of the recording file (grows as chunks arrive)
sha256Whole-file SHA-256 hash (null until finalized)
consentStateSnapshot of the consent state at capture start
wasDisclosedWhether recording was disclosed to the end user
statusLifecycle status (see below)

A recording moves through these statuses:

StatusMeaning
recordingCapture in progress — chunks are being appended
finalizingClose in progress (duration repair + hashing)
completeFinalized cleanly — duration, size and SHA-256 stamped
partialFinalized from the uploaded prefix (e.g. an interrupted in-flight recording)
failedFinalize could not produce a usable file (e.g. the on-disk file was missing)

Viewing, exporting & deleting#

Recordings are served as WebM video. Any Operator or Admin may list an agent's recordings, read a recording's metadata, stream it in the player, or download it:

Reads are not ownership-restricted — any Operator or Admin can view any recording; the controls are the unguessable recording id plus the role policy. Uploads and finalize are restricted to the owning technician (or an Admin).

Storage & retention#

Recordings are stored on the server as one WebM file per recording, under {StoragePath}/{recordingId}/recording.webm. A background retention sweep runs about once an hour and purges recordings whose start time is older than the retention window, deleting the file first and then the metadata row, and writing a RecordingPurged audit event for each.

SettingPurposeDefault
Recording:EnabledMaster switch for session recording storagefalse in code; true in the shipped appsettings.json
Recording:StoragePathWhere recording folders are written./recordings
Recording:RetentionDaysAge (in days) after which recordings are purged; 0 or blank = keep forever30
Recording:MaxSessionSizeMBMaximum size captured for a single session2048

Set Recording:RetentionDays to 0 (or leave it blank) to retain recordings indefinitely — the retention sweep becomes a no-op and nothing is purged.

Roles#

ActionMinimum role
List / view / stream / download recordingsOperator
Upload chunks / finalize a recordingOwning technician (or Admin)
Set an agent's record policyOperator
Delete a recordingAdmin

See Roles & Permissions for the full role model.

REST API#

Method & pathPurpose
POST api/recordings/beginMint the recording id for a live, record-enabled session (idempotent per session; 409 if recording is not enabled)
GET api/agents/{agentId}/recordingsList an agent's recordings, newest first
GET api/recordings/{id}Get a single recording's metadata
POST api/recordings/{id}/chunkAppend captured bytes to the recording (owner/Admin)
POST api/recordings/{id}/finalizeClose the recording — repair duration, hash, stamp end time (owner/Admin)
GET api/recordings/{id}/streamStream the WebM with Range support for the player
GET api/recordings/{id}/downloadDownload the WebM as an attachment (audited)
DELETE api/recordings/{id}Delete the recording row and file (Admin only, audited)
POST api/agents/{id}/record-policySet the per-agent record override ({ "policy": true | false | null } = Always / Never / Inherit)

Recording endpoints require the Operator or Admin role, with DELETE restricted to Admin. See the API Reference for conventions and authentication.

PowerShell#

CmdletPurpose
Get-AthenaRecordingList an agent's recordings (-AgentId) or fetch one by id (-Id)
Set-AthenaAgentRecordPolicySet an agent's record override: -Policy Always / Never / Inherit
# Force recording on for every "kiosk"-tagged agent, then list a machine's recordings
Get-AthenaAgent -Tag "kiosk" | Set-AthenaAgentRecordPolicy -Policy Always

Get-AthenaRecording -AgentId "12345678-1234-1234-1234-123456789012"

See the PowerShell Module reference for connection and session details.

Recording start, finalize, download, delete and retention purge are all written to the audit log (RecordingStarted, RecordingFinalized / RecordingPartial / RecordingFailed, RecordingDownloaded, RecordingDeleted, RecordingPurged). See Audit & SIEM.