diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json
index 567e7ca3f8b2..62140fb4e933 100644
--- a/app/_locales/en/messages.json
+++ b/app/_locales/en/messages.json
@@ -3645,6 +3645,15 @@
"securityAlert": {
"message": "Security alert from $1 and $2"
},
+ "securityAlerts": {
+ "message": "Security alerts"
+ },
+ "securityAlertsDescription1": {
+ "message": "Enable this to have your transactions and signature requests reviewed locally (no data shared with third parties) and warnings displayed when malicious activity is detected."
+ },
+ "securityAlertsDescription2": {
+ "message": "Always be sure to do your own due diligence before approving any requests. There's no guarantee all mailcious activity will be detected by this feature."
+ },
"securityAndPrivacy": {
"message": "Security & privacy"
},
diff --git a/app/scripts/controllers/preferences.js b/app/scripts/controllers/preferences.js
index 9be792c49437..e21f3239e90d 100644
--- a/app/scripts/controllers/preferences.js
+++ b/app/scripts/controllers/preferences.js
@@ -41,6 +41,9 @@ export default class PreferencesController {
useNftDetection: false,
useCurrencyRateCheck: true,
openSeaEnabled: false,
+ ///: BEGIN:ONLY_INCLUDE_IN(blockaid)
+ securityAlertsEnabled: false,
+ ///: END:ONLY_INCLUDE_IN
advancedGasFee: null,
// WARNING: Do not use feature flags for security-sensitive things.
@@ -185,6 +188,19 @@ export default class PreferencesController {
});
}
+ ///: BEGIN:ONLY_INCLUDE_IN(blockaid)
+ /**
+ * Setter for the `securityAlertsEnabled` property
+ *
+ * @param {boolean} securityAlertsEnabled - Whether or not the user prefers to use the security alerts.
+ */
+ setSecurityAlertsEnabled(securityAlertsEnabled) {
+ this.store.updateState({
+ securityAlertsEnabled,
+ });
+ }
+ ///: END:ONLY_INCLUDE_IN
+
/**
* Setter for the `advancedGasFee` property
*
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js
index eaeb27816873..1f0761ced3be 100644
--- a/app/scripts/metamask-controller.js
+++ b/app/scripts/metamask-controller.js
@@ -649,6 +649,11 @@ export default class MetamaskController extends EventEmitter {
networkControllerMessenger,
'NetworkController:stateChange',
),
+ securityAlertsEnabled:
+ this.preferencesController.store.getState().securityAlertsEnabled,
+ onPreferencesChange: this.preferencesController.store.subscribe.bind(
+ this.preferencesController.store,
+ ),
});
///: END:ONLY_INCLUDE_IN
@@ -1596,6 +1601,9 @@ export default class MetamaskController extends EventEmitter {
this.institutionalFeaturesController.store,
MmiConfigurationController: this.mmiConfigurationController.store,
///: END:ONLY_INCLUDE_IN
+ ///: BEGIN:ONLY_INCLUDE_IN(blockaid)
+ PPOMController: this.ppomController,
+ ///: END:ONLY_INCLUDE_IN
...resetOnRestartStore,
});
@@ -2153,6 +2161,12 @@ export default class MetamaskController extends EventEmitter {
setOpenSeaEnabled: preferencesController.setOpenSeaEnabled.bind(
preferencesController,
),
+ ///: BEGIN:ONLY_INCLUDE_IN(blockaid)
+ setSecurityAlertsEnabled:
+ preferencesController.setSecurityAlertsEnabled.bind(
+ preferencesController,
+ ),
+ ///: END:ONLY_INCLUDE_IN
setIpfsGateway: preferencesController.setIpfsGateway.bind(
preferencesController,
),
diff --git a/ui/pages/settings/experimental-tab/__snapshots__/experimental-tab.test.js.snap b/ui/pages/settings/experimental-tab/__snapshots__/experimental-tab.test.js.snap
index 81a8427b6cf1..ecab1af296d7 100644
--- a/ui/pages/settings/experimental-tab/__snapshots__/experimental-tab.test.js.snap
+++ b/ui/pages/settings/experimental-tab/__snapshots__/experimental-tab.test.js.snap
@@ -5,6 +5,96 @@ exports[`ExperimentalTab with desktop enabled renders ExperimentalTab component
+
+ Security
+
+
+
+
+ Security alerts
+
+
+
+ Enable this to have your transactions and signature requests reviewed locally (no data shared with third parties) and warnings displayed when malicious activity is detected.
+
+
+ Always be sure to do your own due diligence before approving any requests. There's no guarantee all mailcious activity will be detected by this feature.
+