Security flags
modules/dashboard/pages/{SecurityFlagsUI, SecurityFlagsDetailsUI, BackgroundChecksUI, IPLogListUI, securityFlags/} — the largest, most action-dense cluster in the app.
Security Flags list — Live
Routes: /dashboard/reports/security-flags/tos /ip-checks /idle-check /copy-trading /dashboard/reports/compliance
One component (SecurityFlagsUI) reused across 5 routes via category/fixedFlagType/compliance props — the flag queue, filters, bulk-enforce workflow, manual-flag creation, and (in compliance mode) the unified work-queue with scope/status tabs and export.
Sub-modules (18 files)
- SecurityFlagsFilterBar — Search, date range, quick-filter pills,
DynamicFilteradvanced drawer - SecurityFlagsBulkEnforceBar — Select-all-matching, review bulk enforcement, send missing notices, bulk revert penalty
- ComplianceWorkQueueHeader — Compliance-mode heading + Export/Actions menu + Create Manual Flag
- ManualFlagCreateDrawer / ManualFlagBulkCreateDrawer — Single create / superuser CSV bulk-create (preview→confirm)
- ManualFlagQueuePanel — Manual-flag operations queue (metrics, assign owner, link case)
- ManualFlagPoliciesPanel — Manual-flag type policy editor (used from Policy Center, not this page's tabs)
- ManualReviewsPanel — Retired approve/reject queue — APIs kept, tab hidden
- ExceptionQuickCreateDrawer — Quick-create exception rule prefilled from a flag row
- UserActionSubmittedQueue — Trader-submitted corrections awaiting staff review
- RunCheckConfirmModal — Confirms dispatch of a detector run
- BulkBalanceRevertPenaltyModal — Per-account balance-reversal review/execute
Actions available (26)
| Action | Effect | Hook | Gate |
|---|---|---|---|
| Search / date range / quick pills | List filtering | — | — |
| Advanced filter drawer | Category, flag type, status, reviewed, penalty/notice status, source, case link, sort | — | legacy filter: compliance + superuser only |
| Compliance scope tabs / status-queue tabs | Re-scopes category or workflow status with live counts | — | compliance mode |
| Run Check(s) | Opens confirm modal → dispatches detector run for a date range or up to N users | useRunSecurityFlagCheckMutation | capability("run_checks") |
| Stop / View all checks | Cancels active background tasks / navigates to Background Checks | cancelTasks | — |
| Bulk enforce toggle | Enters checkbox bulk-selection mode | — | capability("bulk_enforce") |
| Select all matching filters | Filter-wide selection instead of per-row | — | — |
| Review Bulk Enforcement | Multi-step: decide → preview → review → confirm → progress | submitBulkEnforcementDecision/submitBulkFilterEnforcementDecision | capability("bulk_enforce") |
| Send missing notices | Bulk-sends enforcement notices where absent | useBulkSendEnforcementNoticeMutation | — |
| Revert Penalty (bulk) | Preview then execute bulk balance reversal | useBulkPenaltyReversalPreviewMutation, useBulkRevertPenaltyMutation | capability("revert_penalty") |
| Create Manual Flag | Opens create drawer (deep-linkable via ?create=1&user_id=) | POST security_flags_manual_create | feature flag + capability("manual_flags_create") |
| Bulk Create Manual Flags | CSV preview → confirm | POST security_flags_manual_bulk | capability("bulk_manual_flags_create") |
| Manual Flags tab → Assign owner / Create case | Assigns owner/team; links or opens compliance case | POST security_flags_manual_assign / _link_case | role/permission checks + feature flag |
| Compliance Export | Queues async CSV export, polls automation log, offers download | useQueueComplianceExportMutation | compliance mode |
| Clear flags | Marks visible/filter-matching flags "passed"; typed "CLEAR FLAGS" confirmation, optional linked-case auto-close | useBulkClearSecurityFlagsMutation | capability("clear_flags") |
| Row menu: View Details / Review Submission | Navigates to details page | router push | — |
| Row menu: Hide/Restore Notice | Toggles trader-visible notice, requires typed reason | useHideSecurityFlagNoticeMutation/useRestoreSecurityFlagNoticeMutation | capability("notice_hide"/"notice_restore") |
| Row menu: Create Exception Rule | Opens quick-create drawer prefilled from the flag | useCreateExceptionRuleMutation | canCreateException |
| Row menu: Open linked case | Navigates to compliance case | router push | feature flag |
| Row menu: Edit / Add Evidence / Withdraw (manual flags) | Routes to details page in the relevant edit mode | — | permission checks |
| User Action Submitted queue: Start Review / Approve / Reject / Request Changes | Reviews a trader's submitted correction | useStartUserActionReviewMutation, useApprove/Reject/RequestChangesUserActionMutation | — |
| User Action Submitted queue: Create case | Opens/creates a case from a submission | useCreateComplianceCaseMutation | feature flag |
| Pagination / rows-per-page | 10–100 page sizes | — | — |
| Refresh | Invalidates + refetches list (and facets in compliance mode) | — | — |
Flag Details / Enforcement Center — Live
Route: /dashboard/reports/security-flags/details?flag_id=…
Single detail page handling every flag type (TOS, IP, idle, copy-trading) via flag_id — evidence panels specific to the flag type, plus the Decision/Enforcement Center where staff review, enforce, reverse, and manage notices.
Sub-modules (~36 files)
- DecisionCenter — Core review rail: review, verification, force enforce, revert-penalty/platform-ban entry points, notice hide/restore, correction/profile-resolution approve/reject
- enforcementCenter/ —
EnforcementActionBar,EnforcementSummaryCard,EnforcementAuditTimeline,TraderNoticeCard(send/hide/restore/history) - EnforcementModal / CustomEnforcementModal / AdvisoryWarningModal — Policy-recommended, custom, and advisory-only enforcement flows
- BalanceRevertPenaltyModal / CustomRevertPenaltyModal — Balance and non-balance penalty reversal
- BulkEnforcementFlowModal / BulkEnforceResultModal — Multi-step bulk flow + results/retry-failed viewer
- ManualFlagManagementPanel / ManualFlagOperationsPanel — Edit/Withdraw/Evidence; Assign owner + SLA history
- IPLogInspector / IPLogTable — Full IP evidence browser with IPQS/session/geo/history tabs (also reused stand-alone by IP Logs page)
- TradesInspector, PositionOverlapTimeline, TradeCopyTimeline, DeviceEvidenceList, VpnProxyDetectionStrip, SuspiciousIpDetailsCard, SignalAnalysisSection, MismatchedTables — Read-only evidence panels, shown conditionally by flag type
Actions available (26)
| Action | Effect | Hook |
|---|---|---|
| Mark Cleared / Confirm Violation | Sets status passed/failed (counts toward strike tiers) | useReviewSecurityFlagMutation |
| Request / Approve / Reject / Cancel Verification | KYC/verification workflow, blocked if one is already active | useRequestSecurityFlagVerificationMutation + Approve/Reject/Cancel |
| Force Enforce | Superuser override for missed automation | useEnforceSecurityFlagMutation |
| Review Enforcement | Policy-recommended or custom enforcement decision | useSubmitEnforcementDecisionMutation |
| Send Notice / Send Advisory Warning | Sends enforcement or non-enforcing warning notice, single or bulk | useSendEnforcementNoticeMutation, useSendAdvisoryWarningMutation |
| Hide/Restore Notice | Typed-reason required | useHideSecurityFlagNoticeMutation/Restore... |
| Cancel Batch / Retry dispatch | Only shown while batch is cancellable/retryable | cancelEnforcementBatch/retryEnforcementBatchDispatch |
| Release Enforcement Claim | Cancels active action without broker enforcement (reason ≥10 chars) | useReleaseEnforcementClaimMutation |
| Revert Penalty / Custom Penalty Reversal | Preview then execute, per-account overrides | useRevertPenaltyMutation, useCustomRevertPenaltyMutation |
| Platform Ban preview/confirm, reversal preview/confirm | Typed confirmation phrases ("PLATFORM BAN" / "REVERSE PLATFORM BAN") + reason ≥10 chars | useConfirmSecurityFlagPlatformBanMutation, useReverseSecurityFlagPlatformBanMutation |
| Request/Approve/Reject Correction | Multiple-profiles / third-party-name correction workflow | useRequestSecurityFlagCorrectionMutation + Approve/Reject |
| Profile-resolution workflow | Staff selects primary profile among duplicates | useStaffSelectPrimaryProfileMutation + request/approve/reject |
| Manual flag: Edit / Add Evidence / Withdraw / Assign owner / Link case | Direct edits to a manual flag | PATCH security_flags_manual_update, POST evidence/withdraw/assign/link_case |
| Create Exception Rule (contextual) | Prefilled from this flag | useCreateExceptionRuleMutation |
| IP Log inspector actions | Search/filter, IPQS classification, vendor-consensus filter, Open Broker Session | — |
| Flag history pagination (user/IP/account) | Independent tables | useGetSecurityFlagsUserHistory etc. |
| Retry Failed (bulk batch result) | Retries failed rows in a batch | useRetryFailedEnforcementBatchMutation |
| Refresh | Refetches flag detail | — |
:::info Note
All gating in this cluster goes through useSessionContext().capability(...) plus permission-string helpers in riskFlagPermissions.ts — useCapabilityMutationGate/resolveCapabilityAvailability are not used here (only in Compliance Cases).
:::
Background Checks — Live
Route: /dashboard/reports/security-flags/background-checks
Task-queue view of in-flight/recent detector runs and bulk-enforcement batches. Its hook also exports BackgroundChecksPoller, a headless component mounted globally in DashboardWrapper that coordinates a single cross-tab poller (via a localStorage lease) and broadcasts completions app-wide.
| Control | Effect |
|---|---|
| Running / Awaiting review tabs | Filters task list |
| View batch progress/results | Opens results drawer or navigates to the relevant flag-list section |
| Stop check / Cancel bulk batch | Cancels a running task or batch |
| Dismiss (completed) | Removes row from awaiting-review list |
| Retry Failed (batch results) | Retries failed enforcement actions in a batch |
IP Logs — Live
Route: /dashboard/reports/security-flags/ip-logs
Thin wrapper reusing the flag-details IPLogTable in "all logs" mode — IP-log search across every user, not scoped to one flag.
| Control | Effect |
|---|---|
| Search (IP/username/email), date window widen | Filters results (last 30 days default) |
| IPQS classification / vendor-consensus filters | Filters by risk signal |
| Row select → inspector tabs | IPQS / sessions / geo / history detail |
| Open Broker Session | Opens session detail dialog |