Skip to main content

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, DynamicFilter advanced 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)

ActionEffectHookGate
Search / date range / quick pillsList filtering——
Advanced filter drawerCategory, flag type, status, reviewed, penalty/notice status, source, case link, sort—legacy filter: compliance + superuser only
Compliance scope tabs / status-queue tabsRe-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 usersuseRunSecurityFlagCheckMutationcapability("run_checks")
Stop / View all checksCancels active background tasks / navigates to Background CheckscancelTasks—
Bulk enforce toggleEnters checkbox bulk-selection mode—capability("bulk_enforce")
Select all matching filtersFilter-wide selection instead of per-row——
Review Bulk EnforcementMulti-step: decide → preview → review → confirm → progresssubmitBulkEnforcementDecision/submitBulkFilterEnforcementDecisioncapability("bulk_enforce")
Send missing noticesBulk-sends enforcement notices where absentuseBulkSendEnforcementNoticeMutation—
Revert Penalty (bulk)Preview then execute bulk balance reversaluseBulkPenaltyReversalPreviewMutation, useBulkRevertPenaltyMutationcapability("revert_penalty")
Create Manual FlagOpens create drawer (deep-linkable via ?create=1&user_id=)POST security_flags_manual_createfeature flag + capability("manual_flags_create")
Bulk Create Manual FlagsCSV preview → confirmPOST security_flags_manual_bulkcapability("bulk_manual_flags_create")
Manual Flags tab → Assign owner / Create caseAssigns owner/team; links or opens compliance casePOST security_flags_manual_assign / _link_caserole/permission checks + feature flag
Compliance ExportQueues async CSV export, polls automation log, offers downloaduseQueueComplianceExportMutationcompliance mode
Clear flagsMarks visible/filter-matching flags "passed"; typed "CLEAR FLAGS" confirmation, optional linked-case auto-closeuseBulkClearSecurityFlagsMutationcapability("clear_flags")
Row menu: View Details / Review SubmissionNavigates to details pagerouter push—
Row menu: Hide/Restore NoticeToggles trader-visible notice, requires typed reasonuseHideSecurityFlagNoticeMutation/useRestoreSecurityFlagNoticeMutationcapability("notice_hide"/"notice_restore")
Row menu: Create Exception RuleOpens quick-create drawer prefilled from the flaguseCreateExceptionRuleMutationcanCreateException
Row menu: Open linked caseNavigates to compliance caserouter pushfeature 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 ChangesReviews a trader's submitted correctionuseStartUserActionReviewMutation, useApprove/Reject/RequestChangesUserActionMutation—
User Action Submitted queue: Create caseOpens/creates a case from a submissionuseCreateComplianceCaseMutationfeature flag
Pagination / rows-per-page10–100 page sizes——
RefreshInvalidates + 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)

ActionEffectHook
Mark Cleared / Confirm ViolationSets status passed/failed (counts toward strike tiers)useReviewSecurityFlagMutation
Request / Approve / Reject / Cancel VerificationKYC/verification workflow, blocked if one is already activeuseRequestSecurityFlagVerificationMutation + Approve/Reject/Cancel
Force EnforceSuperuser override for missed automationuseEnforceSecurityFlagMutation
Review EnforcementPolicy-recommended or custom enforcement decisionuseSubmitEnforcementDecisionMutation
Send Notice / Send Advisory WarningSends enforcement or non-enforcing warning notice, single or bulkuseSendEnforcementNoticeMutation, useSendAdvisoryWarningMutation
Hide/Restore NoticeTyped-reason requireduseHideSecurityFlagNoticeMutation/Restore...
Cancel Batch / Retry dispatchOnly shown while batch is cancellable/retryablecancelEnforcementBatch/retryEnforcementBatchDispatch
Release Enforcement ClaimCancels active action without broker enforcement (reason ≥10 chars)useReleaseEnforcementClaimMutation
Revert Penalty / Custom Penalty ReversalPreview then execute, per-account overridesuseRevertPenaltyMutation, useCustomRevertPenaltyMutation
Platform Ban preview/confirm, reversal preview/confirmTyped confirmation phrases ("PLATFORM BAN" / "REVERSE PLATFORM BAN") + reason ≥10 charsuseConfirmSecurityFlagPlatformBanMutation, useReverseSecurityFlagPlatformBanMutation
Request/Approve/Reject CorrectionMultiple-profiles / third-party-name correction workflowuseRequestSecurityFlagCorrectionMutation + Approve/Reject
Profile-resolution workflowStaff selects primary profile among duplicatesuseStaffSelectPrimaryProfileMutation + request/approve/reject
Manual flag: Edit / Add Evidence / Withdraw / Assign owner / Link caseDirect edits to a manual flagPATCH security_flags_manual_update, POST evidence/withdraw/assign/link_case
Create Exception Rule (contextual)Prefilled from this flaguseCreateExceptionRuleMutation
IP Log inspector actionsSearch/filter, IPQS classification, vendor-consensus filter, Open Broker Session—
Flag history pagination (user/IP/account)Independent tablesuseGetSecurityFlagsUserHistory etc.
Retry Failed (bulk batch result)Retries failed rows in a batchuseRetryFailedEnforcementBatchMutation
RefreshRefetches 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.

ControlEffect
Running / Awaiting review tabsFilters task list
View batch progress/resultsOpens results drawer or navigates to the relevant flag-list section
Stop check / Cancel bulk batchCancels 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.

ControlEffect
Search (IP/username/email), date window widenFilters results (last 30 days default)
IPQS classification / vendor-consensus filtersFilters by risk signal
Row select → inspector tabsIPQS / sessions / geo / history detail
Open Broker SessionOpens session detail dialog