diff --git a/includes/rules.core.inc b/includes/rules.core.inc
index 0e85c7b..c0240f8 100644
--- a/includes/rules.core.inc
+++ b/includes/rules.core.inc
@@ -30,6 +30,11 @@ class RulesEntityController extends EntityAPIControllerExportable {
         ->condition('id', $entity->id)
         ->execute()
         ->fetchCol('tag');
+      $entity->dependencies = db_select('rules_dependencies')
+        ->fields('rules_dependencies', array('module'))
+        ->condition('id', $entity->id)
+        ->execute()
+        ->fetchCol('module');
       $entities[$entity->id] = $entity;
     }
     $queried_entities = $entities;
@@ -117,6 +122,7 @@ class RulesEntityController extends EntityAPIControllerExportable {
     if ($rules_config instanceof RulesTriggerableInterface) {
       $this->storeEvents($rules_config);
     }
+    $this->storeDependencies($rules_config);
     return $return;
   }
 
@@ -153,6 +159,20 @@ class RulesEntityController extends EntityAPIControllerExportable {
     }
   }
 
+  protected function storeDependencies($rules_config) {
+    db_delete('rules_dependencies')
+      ->condition('id', $rules_config->id)
+      ->execute();
+    foreach ($rules_config->dependencies() as $dependency) {
+      db_insert('rules_dependencies')
+        ->fields(array(
+        'id' => $rules_config->id,
+        'module' => $dependency,
+      ))
+      ->execute();
+    }
+  }
+
   /**
    * Overridden to support tags and events in $conditions.
    * @see EntityAPIControllerExportable::buildQuery()
@@ -191,6 +211,9 @@ class RulesEntityController extends EntityAPIControllerExportable {
         db_delete('rules_tags')
           ->condition('id', $config->id)
           ->execute();
+        db_delete('rules_dependencies')
+          ->condition('id', $config->id)
+          ->execute();
       }
     }
     return parent::delete($ids, $transaction);
@@ -283,6 +306,7 @@ abstract class RulesExtendable extends FacesExtendable {
       // We don't need that any more.
       unset($itemInfo['extenders'], $itemInfo['overrides']);
     }
+    //@todo Remove dirty configurations.
   }
 
   /**
@@ -613,7 +637,10 @@ abstract class RulesPlugin extends RulesExtendable {
   }
 
   /**
-   * Returns an array of required modules.
+   * Calculates an array of required modules.
+   *
+   * You can use $this->dependencies to access dependencies for saved
+   * configurations.
    */
   public function dependencies() {
     $this->processSettings();
@@ -687,11 +714,14 @@ abstract class RulesPlugin extends RulesExtendable {
     // First process the settings if not done yet.
     $this->processSettings();
     // Check dependencies.
-    foreach ($this->dependencies() as $module) {
+    $dependencies = empty($this->dependencies) ? $this->dependencies() : $this->dependencies;
+    foreach ($dependencies as $module) {
       if (!module_exists($module)) {
-        throw new RulesException('Missing required module %name.', array('%name' => $module), $this);
+        $this->dirty = 0x01;
+        throw new RulesDependencyException('Missing required module %name.', array('%name' => $module), $this);
       }
     }
+    $this->dirty = 0x00;
     // Check the parameter settings.
     $this->checkParameterSettings();
     // Check variable names for provided variables to be valid.
@@ -2295,6 +2325,11 @@ class RulesException extends Exception {
 }
 
 /**
+ * An exception for missing dependencies.
+ */
+class RulesDependencyException extends RulesException {}
+
+/**
  * Determines the plugin to be used for importing a child element.
  *
  * @param $key
diff --git a/modules/rules_core.rules.inc b/modules/rules_core.rules.inc
index c2c28ed..e4d58b1 100644
--- a/modules/rules_core.rules.inc
+++ b/modules/rules_core.rules.inc
@@ -253,6 +253,27 @@ function rules_element_invoke_component_operations(RulesPlugin $element) {
 }
 
 /**
+ * Validate callback to make sure the component is not dirty.
+ */
+function rules_element_invoke_component_validate(RulesPlugin $element) {
+  $info = $element->info();
+  $component = rules_config_load($info['#config_name']);
+  if (!$component) {
+    throw new RulesException('Component %config does not exist.', array('%config' => $info['#config_name']));
+  }
+  $component->integrityCheck();
+}
+
+/**
+ * Dependencies callback to add the component's dependencies.
+ */
+function rules_element_invoke_component_dependencies(RulesPlugin $element) {
+  $info = $element->info();
+  $component = rules_config_load($info['#config_name']);
+  return $component->dependencies();
+}
+
+/**
  * Implements the features export callback of the RulesPluginFeaturesIntegrationInterace.
  */
 function rules_element_invoke_component_features_export(&$export, &$pipe, $module_name = '', $element) {
diff --git a/rules.install b/rules.install
index 9902a7f..2655bfa 100644
--- a/rules.install
+++ b/rules.install
@@ -74,6 +74,13 @@ function rules_schema() {
         'size' => 'tiny',
         'description' => 'The exportable status of the entity.',
       ),
+      'dirty' => array(
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0x00,
+        'size' => 'tiny',
+        'description' => 'Indicates broken configurations. 0 = OK, 1 = missing dependency, 2 = failed integrity check.',
+      ),
       'module' => array(
         'description' => 'The name of the providing module if the entity has been defined in code.',
         'type' => 'varchar',
@@ -137,6 +144,27 @@ function rules_schema() {
       'id' => array('rules_config' => 'id'),
     ),
   );
+  $schema['rules_dependencies'] = array(
+    'fields' => array(
+      'id' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'description' => 'The primary identifier of the configuration.',
+      ),
+      'module' => array(
+        'type' => 'varchar',
+        'length' => '255',
+        'not null' => TRUE,
+        'default' => '',
+        'description' => 'The name of the module that is required for the configuration.',
+      ),
+      'primary key' => array('id', 'module'),
+      'foreign keys' => array(
+      	'id' => array('rules_config' => 'id'),
+      ),
+    ),
+  );
   $schema['cache_rules'] = drupal_get_schema_unprocessed('system', 'cache');
   $schema['cache_rules']['description'] = 'Cache table for the rules engine to store configured items.';
   return $schema;
@@ -322,3 +350,42 @@ function rules_update_7204() {
     db_create_table('rules_tags', $schema['rules_tags']);
   }
 }
+
+/**
+ * Add the rules_dependencies DB table and the "dirty" DB field.
+ */
+function rules_update_7205() {
+  if (!db_table_exists('rules_dependencies')) {
+    $schema['rules_dependencies'] = array(
+      'fields' => array(
+        'id' => array(
+          'type' => 'int',
+          'unsigned' => TRUE,
+          'not null' => TRUE,
+          'description' => 'The primary identifier of the configuration.',
+        ),
+        'module' => array(
+          'type' => 'varchar',
+          'length' => '255',
+          'not null' => TRUE,
+          'default' => '',
+          'description' => 'The name of the module that is required for the configuration.',
+        ),
+        'primary key' => array('id', 'module'),
+        'foreign keys' => array(
+        	'id' => array('rules_config' => 'id'),
+        ),
+      ),
+    );
+    db_create_table('rules_dependencies', $schema['rules_dependencies']);
+  }
+  if (!db_field_exists('rules_config', 'dirty')) {
+    db_add_field('rules_config', 'dirty', array(
+      'type' => 'int',
+      'not null' => TRUE,
+      'default' => 0x00,
+      'size' => 'tiny',
+      'description' => 'Indicates broken configurations. 0 = OK, 1 = missing dependency, 2 = failed integrity check.',
+    ));
+  }
+}
diff --git a/rules.module b/rules.module
index cfc7db1..5a0ee71 100644
--- a/rules.module
+++ b/rules.module
@@ -1065,6 +1065,31 @@ function rules_element_info() {
  * Implements hook_modules_enabled().
  */
 function rules_modules_enabled($modules) {
+  // Re-enable Rules configurations that depend on the modules.
+  foreach ($modules as $module) {
+    $query = db_select('rules_dependencies', 'rd');
+    $query->join('rules_config', 'rc', 'rd.id = rc.id');
+    $ids = $query->fields('rd', array('id'))
+      ->condition('rd.module', $module)
+      ->condition('rc.dirty', 0x01)
+      ->execute()
+      ->fetchCol();
+    $rules_configs = entity_load('rules_config', $ids);
+    foreach ($rules_configs as $rules_config) {
+      try {
+        $rules_config->integrityCheck();
+        // If no exceptions were thrown we can set the configuration back to OK.
+        // Don't use $rules_config->save() here as we don't want to override the
+        // stored dependencies.
+        db_update('rules_config')
+          ->fields(array('dirty' => 0x00))
+          ->condition('id', $rules_config->id)
+          ->execute();
+        drupal_set_message(t('Rules configuration %config was re-enabled.', array('%config' => $rules_config->label)));
+      }
+      catch (RulesException $e) {}
+    }
+  }
   rules_clear_cache();
 }
 
@@ -1072,8 +1097,24 @@ function rules_modules_enabled($modules) {
  * Implements hook_modules_disabled().
  */
 function rules_modules_disabled($modules) {
+  // Disable Rules configurations that depend on the modules.
+  foreach ($modules as $module) {
+    $ids = db_select('rules_dependencies')
+      ->fields('rules_dependencies', array('id'))
+      ->condition('module', $module)
+      ->execute()
+      ->fetchCol();
+    foreach ($ids as $id) {
+      db_update('rules_config')
+        ->fields(array('dirty' => 0x01))
+        ->condition('id', $id)
+        ->execute();
+    }
+    if (!empty($ids)) {
+      drupal_set_message(t('Some Rules configurations have been marked as dirty and will not be executed anymore.'), 'warning');
+    }
+  }
   rules_clear_cache();
-  //TODO: Disable configs with now broken dependencies?
 }
 
 /**
