Protecting peer-to-peer network with roaming agents Peer-to-peer networks are continuously becoming more popular for sharing data and resources. However, a major drawback of this type of network is its ability to maintain security, since there is no centralized server to oversee the network. One way to remedy this problem is through the use of intelligent mobile agents. These agents will act as guards, which will essentially roam the network and periodically check on each node to ensure that it is not under attack. In our previous research, we have proposed algorithms for initial placement of agents in a given peer-to-peer network. As the agents are mobile, the next issue with agent-based security is how the agents should roam around the network todetect attacks. We want the agents to scan the entire network as quickly as possible which will minimize the detection time of attacks. If we run too many agents simultaneously to scan the network, they will consume system resources which will slow down the performance of applications running on the peer-to-peer network. In this paper we have proposed three roaming algorithms for agents. The first algorithm Heavy Scan Algorithm scans the network with minimum time by sacrificing the performance of the application. The second algorithm Light Scan Algorithm takes the maximum time to complete the scan of the entire network with less degradation of the performance of the application. The third algorithm Medium Scan Algorithm balances time to complete the scan with performance of the application. We have illustrated the proposed algorithms with an example. We have also analyzed the complexity of the proposed algorithms.