Recently, agent-based software technology (ABST) has received widespread attention from the research community and users. However, security issues facing ABST are critical. When a mobile agent migrates from their home machine to perform tasks, the agent becomes vulnerable to attacks by the destination machine, which has full control over the visiting mobile agent. To address this security issue, we propose a dummy task selection (DTS) approach to protect the mobile agent by confusing the attacker (destination machine) with regard to distinguishing the real task among dummy attacks. Considering that side information may be employed by the attacker to perform advanced attacks, we introduce improved DTS as an enhancement of the DTS approach. The improved DTS approach generates strong dummy tasks based on execution probabilities that lead to the highest entropy. Unlike previous approaches, the improved-DTS approach performs the full protection mechanism at the home machine, which in turn limits the ability of the attacker to control the visiting mobile agent. Compared to previous approaches, both the DTS and improved-DTS methods achieved better performance and higher resistance to advanced active attacks such as alternation, collusion, and DoS attacks. INDEX TERMS Agent, attack, destination machine, dummy, home machine, task.