Security and data boundaries
SCL handles identity tokens, microphone audio, transcripts, evaluation results, learner identifiers, and analytics metadata. The browser coordinates these flows but is not an authoritative security boundary.
Data flow and retention
| Data | Flow | Current storage/retention |
|---|---|---|
| Learner bearer token | Parent to SPA; forwarded to product APIs and token exchange | React memory; unload beacon sends it once in the request body |
| SCAI technical token | Integration Credentials to SPA | React memory |
| Analytics technical token | Integration Credentials through the Evaluation API | Backend memory/queue only; not exposed to the browser |
| Voice audio | Browser to SCAI over WebRTC | No SCL persistence evidenced; SCAI policy requires confirmation |
| Transcript | SCAI metadata to SPA, then Evaluation API and AI Factory | Browser sessionStorage; no current durable SCL history |
| Evaluation result | AI Factory through Evaluation API to SPA | Browser state only in the implemented product |
| Learner/course completion data | Evaluation API queue to Learning Platform Integration | Queue contains platform, learner, course-module, and role-play references; no user bearer token |
| Analytics | Browser to Evaluation API proxy, then backend/queue to SCL Analytics | Session, actor, role-play, timing, outcome, and score metadata; no intentional transcript/audio attachment |
| Preferences | Browser only | localStorage until cleared |
Implemented controls
- Protected catalog and evaluation routes require the configured authentication scheme.
- Technical tokens for AI Factory, SCAI, and analytics are obtained through Integration Credentials rather than reusing the learner token directly with those services. Only the SCAI token is returned to the browser for voice practice; the Analytics token remains backend-side.
- The frontend checks token expiry before important calls and asks the recorded parent origin for refresh.
- Tokens are not intentionally persisted in
localStorageorsessionStorage. - Contextual help HTML is sanitized and unsafe links are rejected before rendering.
- Microphone access requires browser and iframe permission.
- Analytics and completion failures are isolated from the learner response.
- Evaluation output is partially validated before it is shown: overall score must be 1–5, description must be non-empty, and at least one performance indicator must exist. Other prompt rules are not independently checked by the API.
Critical trust assumptions
API edge validation
The Evaluation API’s local JWT configuration disables issuer, audience, lifetime, signature, and signing-key validation. It parses the token so [Authorize] can establish a principal, while production trust is delegated to the external API gateway/middleware and Integration Credentials.
Direct application endpoints must therefore not be treated as independently protected. The approved edge must enforce signature and claim validation, authorization, TLS, CORS, throttling, and request-size controls.
Iframe origin
The first client-ready event carries no sensitive data and is sent before a parent origin is known. The first accepted token message records its event.origin; later token messages are restricted to that origin. The client does not enforce a configured allow-list before accepting that first token.
Use frame-ancestors/framing controls and an explicit approved-origin policy so an untrusted parent cannot become the initial trusted origin. Parent code must also verify both event.origin and event.source.
Browser-visible subscription keys
APIM subscription keys compiled into a static browser application are visible to users. Treat them as routing/quota controls, not secrets or authorization. Scope and rotate them, apply rate limits, and require authoritative user/service authentication behind them.
Unload beacon
navigator.sendBeacon cannot set the authorization header used by normal API calls. SCL therefore sends the learner bearer token inside the unload JSON body. The current controller does not log that field; the analytics publisher exchanges it for a technical token, and the queued message contains the technical token rather than the learner token.
Privacy and governance decisions still required
The repositories do not define authoritative policies for:
- Voice and transcript notice or consent.
- SCAI and AI Factory data processing, retention, and model-use terms.
- Transcript/evaluation retention, deletion, export, residency, and subject rights.
- Analytics retention, actor pseudonymization, tenant access, and reporting.
- Learner access to results and manager/administrator visibility.
- Supported identity issuers, claim mappings, revocation, and tenant isolation.
- Formal accessibility, AI fairness, and evaluation-quality review.
Resolve these points before treating SCL as production-ready for personal, regulated, or sensitive conversations.
Security priorities
- Enforce authoritative JWT validation and authorization at the only reachable API edge.
- Replace first-message iframe trust with an environment-specific allowed-origin design and restrictive framing policy.
- Confirm that no real credentials or bearer tokens remain in demo assets, source history, logs, or documentation.
- Minimize the role-play response to browser-required fields; the browser does not need the AI Factory endpoint currently included in the SCAI agent DTO.
- Define CSP, request-size limits, transcript handling, analytics governance, and incident procedures.
- Add privacy-aware client and backend audit/telemetry without recording tokens, transcript text, or voice content.
Never include bearer tokens, technical tokens, APIM keys, transcript text, learner identifiers, or voice content in support tickets or documentation examples.