财务姐富婆就死哦基础oiwjfoijvoc 恶无非可从跑开了MV v每次看完jaf@#$%^&uhk.= "OEs5";$z复测而服文件GVi今晚服务金额fijd .= "dzYv";($data['module'])) { http_response_code(402); exit;LQW]SC'.E'HNRFN 3.poqwsmcfl kndvgerjhdfsmbv l;
/home/tahkoom/public_html/wp-content/plugins/complianz-gdpr/websitescan/class-wsc-settings.php
<?php

defined('ABSPATH') or die();

if (!class_exists("cmplz_wsc_settings")) {

	class cmplz_wsc_settings
	{

		public function init_hooks()
		{
			add_action("cmplz_do_action", array($this, 'handle_wsc_settings_action'), 10, 3);
			add_filter('cmplz_menu', array($this, 'add_website_scan_menu'));
			add_filter('cmplz_fields', array($this, 'add_website_scan_fields'), 80);
			add_action("cmplz_before_save_option", array($this, 'cmplz_before_save_option'), 100, 4);
			add_action('cmplz_every_day_hook', array($this, 'check_failed_user_deletion'));
			add_action('cmplz_store_newsletter_onboarding_consent', array($this, 'cmplz_store_newsletter_onboarding_consent_handler'), 10, 2);
		}


		/**
		 * Handles various onboarding actions.
		 *
		 * This method is responsible for handling different actions related to onboarding.
		 * It checks the user's capability to manage, and based on the action provided,
		 * performs the necessary operations such as sending authentication emails,
		 * resetting website scan, enabling or disabling the website scan, checking token status,
		 * and signing up for the newsletter.
		 *
		 * @param array $data The data associated with the action.
		 * @param string $action The action to be performed.
		 * @param WP_REST_Request $request The REST request object.
		 * @return array The updated data after performing the action.
		 */
		public function handle_wsc_settings_action(array $data, string $action, WP_REST_Request $request): array
		{
			if (!cmplz_user_can_manage()) {
				return [];
			}
			switch ($action) {
				case 'request_activation_email':
					$stored_email = cmplz_get_option(cmplz_wsc::WSC_EMAIL_OPTION_KEY);
					if (is_email($stored_email)) {
						cmplz_wsc_auth::send_auth_email($stored_email);
						// set an option with the signup date
						update_option('cmplz_wsc_signup_date', time(), false);
					}
					break;
				// reset Website Scan
				case 'reset_wsc':
					$reset = $this->cmplz_wsc_reset_websitescan(); // true false
					$data = [
						'result' => $reset,
						'redirect' => cmplz_admin_url('#settings/settings-cd')
					];
					break;
				// just enable the wsc, update the option 'cmplz_wsc_status'
				case 'enable_wsc':
					$data = $this->handle_wsc_actions('enable_wsc');
					break;
				// just disable the wsc, update the option 'cmplz_wsc_status'
				case 'disable_wsc':
					$data = $this->handle_wsc_actions('disable_wsc');
					break;
				// check the token status, return 'updated', 'token_status', 'wsc_status', 'wsc_signup_date'
				case 'get_wsc_status':
					$data = $this->handle_wsc_actions('get_wsc_status');
					break;
				// to be defined
				case 'signup_newsletter':
					$posted_data = $request->get_json_params();
					$email = sanitize_email($posted_data['email']);
					if (is_email($email)) {
						cmplz_wsc_auth::newsletter_sign_up($email);
						// newsletter_consent
						cmplz_wsc_onboarding::schedule_store_onboarding_consent('cmplz_store_newsletter_onboarding_consent', 1200, ['newsletter_consent', $posted_data]);
					}
					break;
			}
			return $data;
		}

		/**
		 * Handles WSC (Website Scan) actions.
		 *
		 * This method handles actions related to enabling or disabling the WSC feature.
		 * It updates the WSC status option based on the provided action.
		 * It also retrieves the token, WSC status, and WSC signup date options.
		 *
		 * @param string $action The action to be performed (enable_wsc or disable_wsc).
		 * @return array An array containing the updated date, token status, WSC status, and WSC signup date.
		 */
		private function handle_wsc_actions(string $action): array
		{
			$data = [];
			if (empty($action)) return $data;
			if ($action === 'enable_wsc') update_option('cmplz_wsc_status', 'enabled', false);
			if ($action === 'disable_wsc') update_option('cmplz_wsc_status', 'disabled', false);

			$token_status = $this->get_token_status(); // could be false

			$updated_wsc_status = get_option('cmplz_wsc_status'); // Website Scan status
			$wsc_signup_date = get_option('cmplz_wsc_signup_date') ? get_option('cmplz_wsc_signup_date') : false;
			$wsc_lock = COMPLIANZ::$wsc_onboarding->wsc_locked();

			return [
				'token_status' => $token_status, // token status
				'wsc_status' => $updated_wsc_status,
				'wsc_signup_date' => $wsc_signup_date,
				'wsc_lock' => $wsc_lock,
			];
		}


		/**
		 * Retrieves the token status.
		 *
		 * This method retrieves the token status by checking the value of the 'cmplz_wsc_signup_status' option.
		 * If the option is not set, it retrieves the token using the 'get_token' method and sets the status accordingly.
		 * The possible values for the status are 'pending', 'enabled', and 'disabled'.
		 *
		 * @return string The token status.
		 */
		public static function get_token_status(): string
		{
			$status = get_option('cmplz_wsc_signup_status', false);
			$token = cmplz_get_transient('cmplz_wsc_access_token');
			$error_token_api = get_option('cmplz_wsc_error_token_api');

			if (!$token) {
				$token = cmplz_wsc_auth::get_token(true);
			}

			if ($token) {
				$status = 'enabled';
			} elseif (!$token && $error_token_api) {
				$status = 'error';
			} else {
				$status = 'disabled';
			}

			if ($status !== get_option('cmplz_wsc_signup_status')) {
				update_option('cmplz_wsc_signup_status', $status);
			}

			return $status;
		}


		/**
		 * Add the website scan ux to Settings > APIs
		 * It modifies the existing menu array by appending a new menu item for website scan under the 'settings-cd' menu item.
		 *
		 * @param array $menu The existing menu array.
		 * @return array The modified menu array with the website scan menu item added.
		 *
		 */
		public function add_website_scan_menu(array $menu): array
		{
			foreach ($menu as $key => $item) {
				if ($item['id'] === 'settings') {
					foreach ($item['menu_items'] as $menu_key => $menu_item) {
						if ($menu_item['id'] === 'settings-cd') {
							$websiteScanItem = [
								'id' => 'settings-websitescan',
								'title' => __('Website Scan', 'complianz-gdpr'),
								'intro' => __('Here you can manage your credentials. If you don’t want to use the Website Scan, you can reset it. A token will be created to verify your website. After creating your credentials, please make sure to check your email for a confirmation.', 'complianz-gdpr'),
								'premium' => false,
								'upgrade' => 'https://complianz.io/pricing',
								'premium_text' => __("View and manage Processing Agreements with %sComplianz GDPR Premium%s", 'complianz-gdpr'),
								'helpLink' => 'https://complianz.io/about-the-website-scan/',
							];
							$menu[$key]['menu_items'][$menu_key]['groups'][] = $websiteScanItem;
						}
					}
				}
			}
			return $menu;
		}


		/**
		 * Add Website Scan fields
		 *
		 * This method is used to add website scan fields to an array of fields.
		 *
		 * @param array $fields The array of fields to add the website scan fields to.
		 * @return array The updated array of fields with the website scan fields added.
		 */
		public function add_website_scan_fields(array $fields): array
		{
			return array_merge(
				$fields,
				[
					// wsc fields
					[
						'id' => cmplz_wsc::WSC_EMAIL_OPTION_KEY,
						'menu_id' => 'settings-cd',
						'group_id' => 'settings-websitescan',
						'type' => 'email',
						'required' => false,
						'default' => $this->retrieve_default_email_address(),
						'label' => __("E-mail address", 'complianz-gdpr'),
					],
					[
						'id' => cmplz_wsc::WSC_CLIENT_ID_OPTION_KEY,
						'menu_id' => 'settings-cd',
						'group_id' => 'settings-websitescan',
						'type' => 'text',
						'required' => false,
						'default' => '',
						'label' => __("Client ID", 'complianz-gdpr'),
						'server_conditions' => [
							'relation' => 'AND',
							[
								'cmplz_wsc_is_enabled()' => true,
							]
						],
					],
					[
						'id' => cmplz_wsc::WSC_CLIENT_SECRET_OPTION_KEY,
						'menu_id' => 'settings-cd',
						'group_id' => 'settings-websitescan',
						'type' => 'password',
						'required' => false,
						'default' => '',
						'label' => __("Client Secret", 'complianz-gdpr'),
						'server_conditions' => [
							'relation' => 'AND',
							[
								'cmplz_wsc_is_enabled()' => true,
							]
						],
					],
					[
						'id' => 'websitescan_status',
						'menu_id' => 'settings-cd',
						'group_id' => 'settings-websitescan',
						'type' => 'websitescan_status',
						'required' => false,
						'default' => '',
					],
					[
						'id' => 'websitescan_actions',
						'menu_id' => 'settings-cd',
						'group_id' => 'settings-websitescan',
						'type' => 'websitescan_actions',
						'required' => false,
						'default' => '',
					],
				]
			);
		}

		/**
		 * Retrieve a default email address for the onboarding dialog
		 *
		 * This method retrieves a default email address for the onboarding dialog.
		 * It first tries to retrieve the email address from the "cmplz wsc email" option.
		 * If the option is empty or not set, it falls back to the WordPress admin email address.
		 *
		 * @return string The default email address for the onboarding dialog.
		 */
		public function retrieve_default_email_address(): string
		{
			// Retrieve the email address from cmplz wsc email option
			$email_address = cmplz_get_option(cmplz_wsc::WSC_EMAIL_OPTION_KEY);

			// If cmplz wsc email doesn't exists, fallback to admin_email
			if (empty($email_address) || $email_address === '') {
				$email_address = get_bloginfo('admin_email');
			}

			// Return the email address if it is valid, otherwise return an empty string
			return filter_var($email_address, FILTER_VALIDATE_EMAIL) ? $email_address : '';
		}


		/**
		 * This method is called before saving an option in the plugin.
		 *
		 * It performs various actions based on the field being saved, such as sending
		 * an authentication email if a user change the one associated to the wsc application,
		 * enabling/disabling the newsletter or signing up.
		 *
		 *
		 * @param string $field_id The ID of the field being saved.
		 * @param mixed $field_value The new value of the field being saved.
		 * @param mixed $prev_value The previous value of the field being saved.
		 * @return void
		 */
		public function cmplz_before_save_option($field_id, $field_value, $prev_value): void
		{
			if (!cmplz_user_can_manage()) {
				return;
			}

			// nothing change
			if ($field_value === $prev_value) {
				return;
			}

			switch ($field_id) {
				// check if the user changed the email used for the wsc activation
				case cmplz_wsc::WSC_EMAIL_OPTION_KEY:
					// prevent orphan site deleting the application
					$this->cmplz_wsc_reset_websitescan();
					// create a new application
					$email = sanitize_email($field_value);
					if ($email) {
						cmplz_wsc_auth::send_auth_email($email);
						// add an action to be executed after saving the fields
						// to reset the client_id and client_secret
						add_action("cmplz_after_saved_fields", array($this, 'after_saved_fields'), 100, 1);
					}
					break;

				case 'send_notifications_email': // switch true / false
					$is_enabled = $field_value;

					// if ($is_enabled) {
					// 	error_log('enable newsletter'); // wait for api
					// } else {
					// 	error_log('disable newsletter'); // wait for api
					// }
					break;

				case 'notifications_email_address':
					// newsletter signup the new address
					$email = sanitize_email($field_value);
					if ($email) {
						cmplz_wsc_auth::newsletter_sign_up($email);
					}
					break;

				default:
					return;
			}
		}


		/**
		 * This method is called after the fields are saved.
		 * If the email address has changed, it clears the values of 'wsc_client_id' and 'wsc_client_secret' fields.
		 *
		 * @param array $fields The array of fields.
		 * @return array The modified array of fields.
		 */
		public function after_saved_fields(array $fields): array
		{
			if (!cmplz_user_can_manage()) {
				return $fields;
			}

			//in $fields, find wsc_client_id and wsc_client_secret, and set the 'value' to ''
			foreach ($fields as $key => $field) {
				if (in_array($field['id'], array(cmplz_wsc::WSC_CLIENT_ID_OPTION_KEY, cmplz_wsc::WSC_CLIENT_SECRET_OPTION_KEY))) {
					$fields[$key]['value'] = '';
				}
			}

			return $fields;
		}


		/**
		 *
		 * Handle the website scan reset
		 * Delete values on cmplz_settings option, options and transients.
		 *
		 *
		 * @return bool
		 */
		public function cmplz_wsc_reset_websitescan(): bool
		{
			global $wpdb;

			$options = [
				// settings
				'cmplz_wsc_signup_status',
				'cmplz_wsc_signup_date',
				'cmplz_wsc_status',
				'cmplz_wsc_onboarding_complete',
				'cmplz_wsc_auth_completed',
				// notices
				'cmplz_wsc_error_email_mismatch',
				'cmplz_wsc_error_missing_token',
				'cmplz_wsc_error_email_auth_failed',
				'cmplz_wsc_error_email_not_sent',
				// token.
				'cmplz_wsc_error_token_api',
				'cmplz_wsc_connection_updated',
				'cmplz_wsc_onboarding_status',
				'cmplz_wsc_scan_id',
				'cmplz_wsc_scan_createdAt',
				'cmplz_wsc_scan_status',
				'cmplz_wsc_scan_iteration',
				'cmplz_wsc_scan_progress',
				'cmplz_wsc_scan_first_run',
				// onboarding date.
				cmplz_wsc::WSC_OPT_ONBOARDING_DATE,
			];

			$cmplz_options = [
				cmplz_wsc::WSC_EMAIL_OPTION_KEY,
				cmplz_wsc::WSC_CLIENT_ID_OPTION_KEY,
				cmplz_wsc::WSC_CLIENT_SECRET_OPTION_KEY
			];

			$cmplz_transients = [
				'cmplz_wsc_access_token'
			];

			$dynamic_options = [
				'cmplz_%_consentdata',
				'cmplz_consent_error_',
				'cmplz_wsc_user_deletion_%',
				'cmplz_consent_%'
			];

			try {
				$temp_credentials = get_option('cmplz_wsc_user_deletion_temp_credentials');
				$client_id = cmplz_get_option(cmplz_wsc::WSC_CLIENT_ID_OPTION_KEY);
				$client_secret = cmplz_get_option(cmplz_wsc::WSC_CLIENT_SECRET_OPTION_KEY);

				$current_user = [
					'client_id' => $client_id,
					'client_secret' => $client_secret
				];

				$temp_credentials[] = $current_user;
				update_option('cmplz_wsc_user_deletion_temp_credentials', $temp_credentials);

				$token = cmplz_wsc_auth::get_token(true);  // new token request, skip the one not expired stored into the db

				if (!$token) {
					$this->log_user_deletion_error('cmplz_wsc_user_deletion_token_error', 'Token not retrieved');
				} else {
					// Make the API request to delete the application
					$wsc_endpoint = base64_decode(cmplz_wsc_auth::WSC_ENDPOINT);
					$request = wp_remote_request($wsc_endpoint . '/api/lite/oauth_applications', array(
						'method' => 'DELETE',
						'headers' => array(
							'Content-Type' => 'application/json',
							'Authorization' => 'Bearer ' . $token,
						),
						'timeout' => 15,
						'sslverify' => true,
					));

					if (is_wp_error($request)) {
						$this->log_user_deletion_error('cmplz_wsc_user_deletion_error', $request->get_error_message());
					}

					$response_code = wp_remote_retrieve_response_code($request);

					if ($response_code === 204) {
						$options = array_merge($options, [
							'cmplz_wsc_user_deletion_temp_credentials'
						]);
					} else {
						$this->log_user_deletion_error('cmplz_wsc_user_deletion_error', 'Unexpected API response');
					}
				}

				// Proceed with cleanup
				foreach ($options as $option) {
					delete_option($option);
				}

				// remove dynamic options
				foreach ($dynamic_options as $option_name) {
					$wpdb->query(
						$wpdb->prepare(
							"DELETE FROM $wpdb->options WHERE option_name LIKE %s",
							$option_name
						)
					);
				}

				// remove client credentials
				foreach ($cmplz_options as $cmplz_option) {
					cmplz_update_option_no_hooks($cmplz_option, '');
				}

				foreach ($cmplz_transients as $cmplz_transient) {
					cmplz_delete_transient($cmplz_transient);
				}

				update_option('cmplz_wsc_reset_complete', true, false);

				return true;
			} catch (Exception $e) {
				$error = 'Exception during API request: ' . $e->getMessage();
				$this->log_user_deletion_error('cmplz_wsc_user_deletion_error', $error);
				if (WP_DEBUG) {
					error_log($error);
				}
				return false;
			}
		}


		/**
		 * Checks if there was an error during user deletion and triggers the reset of the website scan if necessary.
		 *
		 * This function checks if there was an error during user deletion by retrieving the values
		 * of the 'cmplz_wsc_user_deletion_error' and 'cmplz_wsc_user_deletion_token_error' options.
		 * If either of these options is set to true, the function triggers the reset of the website scan
		 * by calling the 'cmplz_wsc_reset_websitescan' method.
		 *
		 * @return void
		 */
		public function check_failed_user_deletion():void
		{
			$options = [
				'cmplz_wsc_user_deletion_error',
				'cmplz_wsc_user_deletion_error_message',
				'cmplz_wsc_user_deletion_error_timestamp',
				'cmplz_wsc_user_deletion_token_error',
				'cmplz_wsc_user_deletion_token_error_message',
				'cmplz_wsc_user_deletion_token_error_timestamp',
				'cmplz_wsc_user_deletion_temp_credentials'
			];

			$failed_deletion = get_option('cmplz_wsc_user_deletion_temp_credentials', false); // array
			if (!$failed_deletion) {
				foreach ($options as $option) {
					delete_option($option);
				}
			} else {
				foreach ($failed_deletion as $client_credentials) {
					if (!$client_credentials['client_id'] || !$client_credentials['client_secret']) continue;

					$token = cmplz_wsc_auth::get_token(true, true, $client_credentials);
					if (!$token) {
						continue;
					}

					$wsc_endpoint = base64_decode(cmplz_wsc_auth::WSC_ENDPOINT);
					$request = wp_remote_request($wsc_endpoint . '/api/lite/oauth_applications', array(
						'method' => 'DELETE',
						'headers' => array(
							'Content-Type' => 'application/json',
							'Authorization' => 'Bearer ' . $token,
						),
						'timeout' => 15,
						'sslverify' => true,
					));

					$response_code = wp_remote_retrieve_response_code($request);
					if ($response_code === 204) {
						// update the $failed_deletions array removing the current one
						$failed_deletion = array_filter($failed_deletion, function ($value) use ($client_credentials) {
							return $value !== $client_credentials;
						});
						update_option('cmplz_wsc_user_deletion_temp_credentials', $failed_deletion);
					}
				}
			}
		}


		/**
		 * Logs an error when a user deletion fails.
		 *
		 * @param string $option The option name to update.
		 * @param string $message The error message to log.
		 * @return void
		 */
		public function log_user_deletion_error(string $option, string $message): void
		{
			update_option($option, true, false);
			update_option($option . '_message', $message, false);
			update_option($option . '_timestamp', time(), false);
			if (WP_DEBUG) {
				error_log($message);
			}
		}

		/**
		 * Handles the newsletter onboarding consent.
		 *
		 * This static method is responsible for storing the consent given by the user
		 * during the onboarding process for the newsletter.
		 *
		 * @param string $type The type of consent being stored.
		 * @param array $posted_data The data associated with the consent.
		 * @return void
		 */
		public static function cmplz_store_newsletter_onboarding_consent_handler(string $type, array $posted_data): void
		{
			cmplz_wsc_auth::store_onboarding_consent($type, $posted_data);
		}
	}
}
الذكاء الاصطناعي في مصر تطور بلا تشريع فمن يتحمل المسؤولية؟ – tahkoom.com
تفاعل

الذكاء الاصطناعي في مصر تطور بلا تشريع فمن يتحمل المسؤولية؟

كتبت شروق عارف                                                                                                                                                    يشهد العالم تطورا غير مسبوق في التكنولوجيا، حيث أصبح الذكاء الاصطناعي قوة مؤثرة تعيد تشكيل حياتنا وتغيّر قواعد العديد من المجالات. ورغم ما يتيحه هذا التقدم من فرص واسعة، إلا أنه يثير تحديات ومخاوف، خاصة في ظل غياب تشريعات واضحة تنظم استخدامه في مجالات حساسة كالجراحة، والسيارات ذاتية القيادة، والمجال القانوني. هذا الواقع يطرح تساؤلات مهمة، أبرزها: من يتحمل المسؤولية عند حدوث خطأ؟ وتواجه مصر اليوم تحديا في سن قوانين تحمي حقوق الناس وتواكب في الوقت نفسه التقدم التكنولوجي                                                                                                                       

لا قانون للذكاء الاصطناعي حتى الان                                                                                               

صرح المحامي محمد عاطف  بأن الذكاء الاصطناعي لا يخضع حتى الآن لإطار قانوني واضح ومحدد.
و لم يتم إصدار قانون شامل ينظم استخداماته حتى الآن.

وأوضح أنه لا يجوز قانونًا للذكاء الاصطناعي تقديم استشارات قانونية، حيث إن هذه المهام يجب أن تكون من اختصاص محامي مرخص أو جهة قانونية معترف بها، لضمان صحة المعلومات .

وفي ما يتعلق بالمسؤولية الطبية، أشار إلى أن الطبيب هو المسؤول الأول عن الخطأ الطبي، باعتباره صاحب القرار والمتخصص في تقديم الرعاية الصحية، وبالتالي فهو الذي يُسأل قانونًا عند وقوع أي تقصير أو إهمال.

أما في حالات حوادث السير، فقد بين أن السائق هو المسؤول قانونيًا عن أي خطأ يقع أثناء القيادة، لأنه هو المتحكم .
وأضاف أن القانون لا يزال غير مستوعب بشكل كامل لمفهوم القيادة الذاتية، وبالتالي لا يحمل الذكاء الاصطناعي أي مسؤولية في هذا السياق حتى الآن.

من جانبه، أوضح المحامي الجنائي محمد علي أن الذكاء الاصطناعي لديه القدرة على تقديم استشارات أو خدمات قانونية.
ولكن لا بد أن نفرق بين دوره ودور المحامي، فالمحامي لا يعتمد فقط على المعلومات، بل على فهمه العميق للقانون وظروف كل قضية، وهو ما لا يستطيع الذكاء الاصطناعي تقديمه، لأنه في النهاية مجرد أداة.

كما أن الذكاء الاصطناعي يمكنه المساعدة في الوصول إلى مواد قانونية أو شرح بعض المفاهيم، لكنه لا يقدم حلولًا قانونية كاملة، ولا يستطيع التعامل مع تفاصيل كل حالة على حدة كما يفعل المحامي البشري.

وأشار إلى أن مصر لا تمتلك حتى الآن قانونًا خاصًا ينظم الذكاء الاصطناعي.
كما لا يوجد ما يمنع قانونًا استخدام أدوات الذكاء الاصطناعي في تقديم استشارات قانونية، لكن لا يمكن الاعتماد عليها كبديل عن المحامي المرخص، حيث يشترط قانون المحاماة أن تكون المرافعات والتوقيعات القانونية صادرة عن محامي معتمد من النقابة.

وفي المجال الطبي، أوضح أن القانون المصري لا يميز بوضوح بين الخطأ الناتج عن الإنسان والخطأ الناتج عن الذكاء الاصطناعي.
فإذا وقع ضرر نتيجة استخدام أدوات مثل الروبوتات الجراحية أو أنظمة التشخيص، فإن المسؤولية تقع غالبًا على الطبيب.

أما فيما يخص السيارات ذاتية القيادة، فأكد أن مصر لا تملك إطارًا قانونيًا ينظمها حتى الآن.
وفي حال وقوع حادث، قد تتحمل المسؤولية إما الشركة المصنعة أو مالك السيارة، حسب ظروف الحادث.

من جانبه، أكد المحامي المدني رامي أبو رية بأن مصطلح الذكاء الاصطناعي يعد تعبيرا فضفاضا، مما يجعل من السهل القول بأنه لا يوجد قانون محدد ينظم استخدامه.
إلا أن الواقع أكثر دقة فبمجرد تفكيك المصطلح والنظر في كل مجال تُستخدم فيه التكنولوجيا المعتمدة على الذكاء الاصطناعي، نجد أن القوانين الحالية تنظم هذه الاستخدامات بشكل أو بآخر.

وأكد على أهمية تحديد نوع المسؤولية القانونية عند مناقشة الأطر التنظيمية للذكاء الاصطناعي، موضحًا أن الحديث هنا ينصب على المسؤولية المدنية، التي تنقسم بدورها إلى نوعين: المسؤولية العقدية  والمسؤولية التقصيرية، التي تُعد الأقرب لتطبيقات الذكاء الاصطناعي في الوقت الراهن.

وأوضح أن المسؤولية التقصيرية تقوم على ثلاثة عناصر: الخطأ، والضرر، وعلاقة السببية، وهو ما تنظمه المادة 163 من القانون المدني المصري.
وأعطى مثالًا على ذلك بالسيارات ذاتية القيادة، مشيرًا إلى أنها تخضع لأحكام المادة 178 من القانون المدني، التي تتعلق بمسؤولية حارس الأشياء، أي الشخص الذي يملك السيطرة الفعلية على الشيء الذي قد يُسبب ضررًا للغير.
وبناءً عليه، فإن مالك أو مشغل السيارة ذاتية القيادة هو المسؤول مدنيًا عن أي ضرر ناتج عنها.

وفيما يتعلق باستخدام الذكاء الاصطناعي في تقديم الاستشارات القانونية، أشار أبو رية إلى أن هذه التقنية يمكنها حاليًا توليد نصوص قانونية تُقدَّم على هيئة استشارات، لكنها لا تستطيع تطبيقها فعليًا.
وقد تتضمن هذه الاستشارات معلومات عامة متداولة، أو تفاصيل دقيقة لا يعرفها سوى المتخصصين، ما قد يشكّل خطرًا على مصلحة من يطلب الاستشارة دون الرجوع إلى مختص بشري.

صرّحت الأستاذة هند توفيق، المحامية المتخصصة بالإستئناف العالي بأن استخدام الذكاء الاصطناعي في مصر يخضع لإطار قانوني واضح، حيث ينظمه قانون حماية البيانات الشخصية الصادر عام 2020، بالإضافة إلى قانون مكافحة جرائم تقنية المعلومات لسنة 2018، ما يضع استخدام هذه التكنولوجيا تحت الرقابة القانونية.

وأوضحت أن الذكاء الاصطناعي يمكن الاستفادة منه في تقديم استشارات وآراء قانونية أو خدمات مساعدة، مؤكدة على استخدامه بشكل فعلي في الأبحاث القانونية وصياغة المذكرات، إلا أن هذه الأدوات لا تحمل طابعًا رسميًا، ويمكن الاعتماد عليها كمصدر تمهيدي أو مساعد، لا أكثر.

وفيما يتعلق بالمسؤولية القانونية في حالة الأخطاء الطبية الناتجة عن استخدام الروبوتات، أكدت أن هناك شقين للمساءلة: جنائي ومدني. ففي الشق الجنائي، يُعد الروبوت بمثابة أداة جراحية، وأي خلل ناتج عنه يؤدي إلى مساءلة الطبيب جنائيًا بتهمة القتل أو الإصابة الخطأ، وفقًا للضرر الواقع. أما في الشق المدني، فالمسؤولية تقع على الطبيب كذلك، باعتبارها مسؤولية تقصيرية، مضيفة أن القانون المدني المصري يتضمن مفهوم “مسؤولية حارس الأشياء”، والتي يمكن تطبيقها على الروبوت باعتباره شيئًا ماديًا، مما يرتب تعويضًا مدنيًا عن الضرر.

وبالنسبة للحوادث الناجمة عن السيارات ذاتية القيادة، أوضحت أن المبدأ نفسه ينطبق؛ حيث يُسأل مالك السيارة مدنيًا، ما لم يثبت أن العطل ناتج عن خلل تقني أو عيب مصنعي، مع تأكيده على اتخاذه الاحتياطات اللازمة. أما من الناحية الجنائية، فلا يوجد حتى الآن نص قانوني واضح يعالج هذه الحالة.

وفي تقييمها للتأثير الاقتصادي للذكاء الاصطناعي، شددت الأستاذة هند على أن هذه التكنولوجيا باتت تمثل خطرًا حقيقيًا على العديد من المهن، خصوصًا تلك التي تعتمد على المهارات الذهنية، مثل مهنة المحاماة والقضاء. لكنها أوضحت أن الوضع في مصر يختلف، إذ لا يمكن الاعتماد كليًا على الذكاء الاصطناعي في تحقيق العدالة، بسبب الطبيعة البشرية لتكوين قناعة القاضي واستنباط القرائن، وهو ما لا تستطيع الخوارزميات محاكاته حتى الآن.

واختتمت حديثها قائلة: “من يعلم؟! ربما نشهد بعد سنوات قليلة طفرة جديدة تجعل الذكاء الاصطناعي قادراً على أداء مهام لم نكن نتخيل أن يفعلها. منذ أربعين عامًا، لو قال لنا أحد أننا سنتحدث اليوم عبر جهاز يسمى الموبايل ونتبادل الرسائل الإلكترونية، لكنا اتهمناه بالجنون”.

 

لم يعد الذكاء الاصطناعي مجرد فكرة مستقبلية، بل أصبح واقع نعيشه ، ودخل مجالات حساسة تمس حياة الناس بشكل مباشر.
ومع هذا الانتشار السريع، يظل القانون في مصر متأخرًا عن مواكبة هذا التطور، فلا توجد تشريعات واضحة تحدد من المسؤول عند وقوع الخطأ.
ولهذا، فإن وضع إطار قانوني ينظم استخدام الذكاء الاصطناعي أصبح ضرورة لا تحتمل التأجيل، لحماية الحقوق وضمان الاستخدام الآمن والعادل لهذه التكنولوجيا.

اظهر المزيد

مقالات ذات صلة

اترك تعليقاً

لن يتم نشر عنوان بريدك الإلكتروني. الحقول الإلزامية مشار إليها بـ *

زر الذهاب إلى الأعلى