Index: code/ai/ai_profiles.cpp
===================================================================
--- code/ai/ai_profiles.cpp	(revision 9286)
+++ code/ai/ai_profiles.cpp	(working copy)
@@ -449,6 +449,8 @@
 
 			set_flag(profile, "$countermeasures affect aspect seekers:", AIPF2_ASPECT_LOCK_COUNTERMEASURE, AIP_FLAG2);
 
+			set_flag(profile, "$ai guards specific ship in wing:", AIPF2_AI_GUARDS_SPECIFIC_SHIP_IN_WING, AIP_FLAG2);
+
 			profile->ai_path_mode = AI_PATH_MODE_NORMAL;
 			if(optional_string("$ai path mode:"))
 			{
Index: code/ai/ai_profiles.h
===================================================================
--- code/ai/ai_profiles.h	(revision 9286)
+++ code/ai/ai_profiles.h	(working copy)
@@ -63,6 +63,7 @@
 #define AIPF2_PLAYER_WEAPON_SCALE_FIX								(1 << 9)
 #define AIPF2_NO_WARP_CAMERA										(1 << 10)
 #define AIPF2_ASPECT_LOCK_COUNTERMEASURE							(1 << 11)
+#define AIPF2_AI_GUARDS_SPECIFIC_SHIP_IN_WING						(1 << 12)
 
 // AI Path types
 #define	AI_PATH_MODE_NORMAL 0
Index: code/ai/aicode.cpp
===================================================================
--- code/ai/aicode.cpp	(revision 9286)
+++ code/ai/aicode.cpp	(working copy)
@@ -7366,9 +7366,9 @@
 	aip = &Ai_info[shipp->ai_index];
 	aip->avoid_check_timestamp = timestamp(1);
 
-	//	If ship to guard is in a wing, guard that whole wing.
+	//	If ship to guard is in a wing, guard that whole wing, unless the appropriate flag has been set
 	ai_info	*other_aip = &Ai_info[Ships[other_objp->instance].ai_index];
-	if ((other_aip->wing != -1) && (other_aip->wing != aip->wing)) {
+	if ((other_aip->wing != -1) && (other_aip->wing != aip->wing) && !(The_mission.ai_profile->flags2 & AIPF2_AI_GUARDS_SPECIFIC_SHIP_IN_WING)) {
 		ai_set_guard_wing(objp, Ai_info[Ships[other_objp->instance].ai_index].wing);
 	} else {
 
