feat(security): add System Use Notification gate for FedRAMP AC-8 (WCH-AC8-001) - #324
Open
smohite-nice wants to merge 10 commits into
Open
feat(security): add System Use Notification gate for FedRAMP AC-8 (WCH-AC8-001)#324smohite-nice wants to merge 10 commits into
smohite-nice wants to merge 10 commits into
Conversation
smohite-nice
temporarily deployed
to
pr-preview-324
September 7, 2026 07:24 — with
GitHub Actions
Inactive
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements a FedRAMP AC-8 “System Use Notification” (SUN) gate in Webchat v3 by adding a new configurable notice screen and persisting per-session acceptance in browser storage, integrating it into the existing “privacy notice” gating flow.
Changes:
- Adds
systemUseNotificationsettings to the config schema and default config state. - Introduces a new
SystemUseNotificationpresentational screen and renders it before the privacy notice inWebchatUI. - Stores/restores SUN acceptance via Redux UI state + browser storage, wired through UI middleware.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/webchat/store/ui/ui-reducer.ts | Adds SUN acceptance state + action. |
| src/webchat/store/ui/ui-middleware.ts | Persists SUN acceptance to browser storage. |
| src/webchat/store/config/config-reducer.ts | Adds default systemUseNotification config block. |
| src/webchat/helper/privacyPolicy.ts | Adds storage helpers for per-session SUN acceptance. |
| src/webchat/components/Webchat.tsx | Restores SUN acceptance from storage on mount. |
| src/webchat/components/ConnectedWebchatUI.tsx | Plumbs SUN acceptance state/dispatch into WebchatUI props. |
| src/webchat-ui/components/WebchatUI.tsx | Gates chat start/send behind SUN (before privacy notice) and renders the new screen. |
| src/webchat-ui/components/presentational/SystemUseNotification.tsx | New SUN screen component. |
| src/common/interfaces/webchat-config.ts | Extends IWebchatSettings with systemUseNotification. |
Suppressed comments (2)
src/webchat-ui/components/WebchatUI.tsx:1726
- The implementation treats hasAcceptedSystemUseNotification as a global boolean, but sessions can change at runtime via SWITCH_SESSION (new conversation / previous conversations). Once set to true, the notice will stay bypassed even after switching to a new sessionId, which contradicts the intended per-session gating.
// System Use Notification (AC-8 / FedRAMP) is shown BEFORE the privacy notice.
// It is gated per session: a new conversation (new sessionId) requires re-acceptance.
if (sun?.enabled && !hasAcceptedSystemUseNotification)
src/webchat-ui/components/presentational/SystemUseNotification.tsx:67
- External links rendered from markdown open a new tab (target="_blank") but use rel="noreferrer" only. Use rel="noopener noreferrer" to prevent reverse-tabnabbing and to align with existing Cypress expectations for external links.
a: ({ node, ...props }) => (
// eslint-disable-next-line jsx-a11y/anchor-has-content
<a {...props} target="_blank" rel="noreferrer" />
),
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
smohite-nice
temporarily deployed
to
pr-preview-324
September 7, 2026 07:30 — with
GitHub Actions
Inactive
smohite-nice
temporarily deployed
to
pr-preview-324
September 7, 2026 07:37 — with
GitHub Actions
Inactive
smohite-nice
temporarily deployed
to
pr-preview-324
September 7, 2026 07:55 — with
GitHub Actions
Inactive
smohite-nice
temporarily deployed
to
pr-preview-324
September 7, 2026 07:59 — with
GitHub Actions
Inactive
smohite-nice
force-pushed
the
fedramp/CSA-97598/WCH-AC8-001/systemUseNotification
branch
from
September 7, 2026 09:23
3690e5a to
c58c8e8
Compare
smohite-nice
temporarily deployed
to
pr-preview-324
September 7, 2026 09:23 — with
GitHub Actions
Inactive
smohite-nice
temporarily deployed
to
pr-preview-324
September 7, 2026 09:33 — with
GitHub Actions
Inactive
smohite-nice
temporarily deployed
to
pr-preview-324
September 7, 2026 09:39 — with
GitHub Actions
Inactive
smohite-nice
temporarily deployed
to
pr-preview-324
September 7, 2026 09:56 — with
GitHub Actions
Inactive
…H-AC8-001) Implements the AC-8 System Use Notification as a separate feature from the existing privacyNotice, satisfying FedRAMP Moderate control AC-8. Design decisions: - Separate config section (systemUseNotification) — not merged with privacyNotice. These serve different purposes (AC-8 vs GDPR), apply to different customer segments (FedRAMP vs all), and have different persistence semantics. - Per-session acceptance keyed by sessionId (not userId): every new conversation session requires re-acceptance, matching the AC-8 requirement of prior-to-every-user-session display. - Non-FedRAMP customers unaffected: systemUseNotification.enabled defaults to false; existing privacyNotice behaviour unchanged. - disableLocalStorage bypass fixed: returns false (show notice) rather than true (skip notice) when no storage is available. Changes: - webchat-config.ts: systemUseNotification? config section added - config-reducer.ts: defaults with AC-8 placeholder text - privacyPolicy.ts: hasAcceptedSunInStorage / setHasAcceptedSunInStorage keyed by sessionId; no-storage returns false (not true) - ui-reducer.ts: hasAcceptedSystemUseNotification state + action - ui-middleware.ts: persist SUN acceptance by sessionId on accept - SystemUseNotification.tsx: new component (reuses PrivacyNotice UI) - WebchatUI.tsx: SUN gate shown BEFORE privacyNotice; header title aware - Webchat.tsx: restore SUN acceptance on mount from sessionId - ConnectedWebchatUI.tsx: wire new state/action Jira: CSA-97598 Confluence: https://cognigy.atlassian.net/wiki/spaces/Engineering/pages/2753232912 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…CH-AC8-001) Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…ute (WCH-AC8-001) Address two Copilot review comments: 1. hasAcceptedSystemUseNotification was never reset when the user started a new conversation (SWITCH_SESSION). The boolean stayed true, bypassing the per-session gate even for a different sessionId. Fix: ui-reducer resets hasAcceptedSystemUseNotification=false on SWITCH_SESSION. ui-middleware then re-checks storage for the new sessionId — if already accepted (e.g. returning to an existing conversation), the flag is immediately restored; otherwise the notice shows for the new session. 2. SystemUseNotification rendered external links with rel="noreferrer" only. Added rel="noopener noreferrer" to prevent reverse-tabnabbing, aligning with PrivacyNotice.tsx. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…(WCH-AC8-001) 1. ui-reducer.ts: add SetHasAcceptedSystemUseNotificationAction and SwitchSessionAction to UIAction union — fixes broken reducer typing (missing types caused dispatch/type errors). 2. SystemUseNotification.tsx: replace fixed 303px AcceptButton width with width:100% + maxWidth:303 to prevent horizontal overflow on small viewports (WCAG 1.4.10 Reflow at 320px CSS px). 3. Webchat.tsx: always dispatch setInitialSessionId from the socket client's actual sessionId (not just when provided via initWebchat options) so that state.options.sessionId matches the sessionId used for SUN storage checks, eliminating the mismatch that prevented acceptance from being correctly restored on page reload. 4. WebchatUI.tsx: handleAcceptSystemUseNotification now uses currentSession (synced from socket client) instead of options.sessionId, and calls onShowChatScreen() after acceptance when the privacy notice gate is not active — ensuring storedMessages are flushed via connection-middleware. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…H-AC8-001) Covers all Copilot comment 5 requirements: - Rendering: enabled/disabled, title/text/button customisation - Accept flow: notice dismissed, chat history visible, blocks before accept - Per-session gating: no re-appearance within same session after accept - Ordering: SUN shown before PrivacyNotice when both enabled - WCAG 2.2 AA: cy.checkA11yCompliance on SUN surface and post-accept chat Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…ion.cy.ts Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…C8-001) - systemUseNotification.cy.ts: fix wrong 5-tab indentation inside the disabled-config object (content was at same level as the opening key) - WebchatUI.tsx: inline the privacyGateActive variable into the if-condition to avoid a multi-line assignment that Prettier merges Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…AC8-001) Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…t (WCH-AC8-001) The SUN gate only triggers when the user attempts to start a conversation. Without cy.startConversation() the SUN screen never renders and the test timed out looking for .webchat-system-use-notification-root. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…-8 text (WCH-AC8-001) Replace placeholder text with the InfoSec-approved AC-8 mandatory language: "You are accessing a U.S. Government information system. Information system usage may be monitored, recorded, and subject to audit. Unauthorized use of the information system is prohibited and subject to criminal and civil penalties. Use of the information system indicates consent to monitoring and recording." Jira: CSA-97598 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
smohite-nice
force-pushed
the
fedramp/CSA-97598/WCH-AC8-001/systemUseNotification
branch
from
September 11, 2026 06:08
9155ed4 to
072fc02
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the AC-8 System Use Notification as a separate feature from the existing
privacyNotice, satisfying FedRAMP Moderate control AC-8.Jira: CSA-97598
Confluence: WCH-AC8-001
Platform PR: cognigy-ai-app #66423 — adds
FEATURE_SYSTEM_USE_NOTIFICATION_ENABLEDHelm flag toserviceEndpointKey design decisions
Separate from
privacyNotice— these serve different purposes and must not be merged:privacyNotice(existing)systemUseNotification(new)enabled: falseenabled: false— auto-enabled viaFEATURE_SYSTEM_USE_NOTIFICATION_ENABLEDplatform flagPer-session display — shown before every new conversation (
sessionIdchanges), not every page refresh. Resets onSWITCH_SESSIONand re-checks storage for the new session.No silent bypass —
disableLocalStorage: truereturnsfalse(show notice), nottrue(skip).Changes
webchat-config.ts—systemUseNotification?config section addedconfig-reducer.ts— defaults with AC-8 placeholder text (pending compliance approval)privacyPolicy.ts—hasAcceptedSunInStorage/setHasAcceptedSunInStoragekeyed bysessionIdui-reducer.ts—hasAcceptedSystemUseNotificationstate + action; resets onSWITCH_SESSIONui-middleware.ts— persists SUN acceptance bysessionId; re-checks storage afterSWITCH_SESSIONSystemUseNotification.tsx— new component (reuses PrivacyNotice UI)WebchatUI.tsx— SUN gate shown beforePrivacyNotice; all send gates updatedWebchat.tsx— restores SUN acceptance on mount fromsessionIdConnectedWebchatUI.tsx— wires new state + actionsystemUseNotification.cy.ts— E2E test suite (11 tests: rendering, accept flow, per-session gating, ordering, WCAG 2.2 AA)Still needed before production
config-reducer.ts)FEATURE_SYSTEM_USE_NOTIFICATION_ENABLED=trueauto-activates the noticeSuccess criteria
sessionId)switchSession(new conversation)privacyNoticebehaviour unchangeddisableLocalStorage: truedoes not bypass the noticeSecurity
Accessibility (WCAG 2.2 AA)
npm run lint:a11ypassescy.checkA11yCompliance()for the new SUN surface (systemUseNotification.cy.ts)Documentation Considerations
AC-8 banner text in
config-reducer.tsis a placeholder pending Legal/Compliance approval.🤖 Generated with Claude Code