The central security concern for systems where agents roam is how to establish trust in the agent. We present a Fuzzy Logic mechanism to calculate a level of trust and an optimal route for a mobile agent system in a smart home. The mechanism consists of two parts. The first path calculates a trust level at the platform side to decide which actions should be allowed to a visiting mobile agent. The second part calculates an optimal route at the mobile agent side to decide an alternative destination in the case of rejection by a platform. We provide examples from smart home scenarios, showing how flexible the proposed mechanism is. The simulation has been implemented using Matlab Simulink.