Mobile adhoc network (MANET) provides a promising platform for pervasive computing applications. Mobile agents are found to be effective for executing such applications. The motivations behind this are advancement in technology, wireless networking, sensor network etc. However, since MANET is inherently more vulnerable to security threats and prone to topology changes, reliability and security issues must be addressed before mobile agents are commercially deployed. There are few works on securing mobile agents but even fewer focuses on MANET. This work is our attempt to design a lightweight trust based reputation scheme to protect the agents against network layer threats. The scheme is based on Dempster-Shafer belief theory. Performance of the trust based reputation scheme with respect to network and system reliability is analysed. The work is simulated and the results show that even for a fairly hostile MANET, the effective reliability of distributed application can be increased using mobile agents.