The proliferation of malicious entities in the distributed environment poses various serious threats to the protection of Mobile Agent Platform (MAP). Numerous researches have been proposed to ward off the inherent security risks, though these solutions are not enough to identify and remove all the vulnerabilities. In this paper, a self-adaptive IV-Phase MAP Security Architecture is proposed, which is inspired by the Biological Immune System, with the prime objective of detecting unknown malicious mobile agents. In this context, data mining methods are studied for the detection of unknown malicious executable. In particular, Boyer Moore pattern matching algorithm and N-gram feature analysis of mobile agent using a k-Nearest Neighbor Classifier, facilitate the discovery of known and unknown malicious content from incoming mobile agent in the proposed architecture, and protects against the Man In The Middle (MITM) attack, the Masquerading Attack, the Replay attack, the Repudiation attack and the Unauthorized Access Attack. The architecture is designed and implemented in IBM Aglets. A comprehensive 5-fold cross validation scheme on a large collection of malicious and non-malicious files is performed while performing Classification technique involving Feature Selection Method. The propitious experimental outcomes express that the performance (time and security) and accuracy of proposed architecture outperform the earlier known related schemes and makes the proposed architecture suitable for MAP protection in the Mobile Agent Environment (MAE). Above all, these findings exhibit wide-ranging newness, since the concept of machine learning has never been employed so far in the sphere of Mobile Agents System (MAS). Hence the proposed work is likely to be of great interest to the researchers who particularly deal with MAS security. (C) 2016 Elsevier Ltd. All rights reserved.