The advent of mobile and ubiquitous systems has enabled the development of autonomous systems such as wireless-sensors for environmental data collection and teams of collaborating Unmanned Autonomous Vehicles (UAVs) used in missions unsuitable for humans. However, with these range of new application-domains come a new challenge -enabling self-management in mobile autonomous systems. Autonomous systems have to be able to manage themselves individually as well as to form self-managing teams which are able to recover or adapt to failures, protect themselves from attacks and optimise performance.This paper proposes a novel distributed policy-based framework that enables autonomous systems of varying scale to perform self-management individually and as a team. The framework allows missions to be specified in terms of roles in an adaptable and reusable way, enables dynamic and secure team formation with a utility-based approach for optimal role assignment, caters for communication link maintenance amongst team-members and recovery from failure. Adaptive management is achieved by employing a policy-based architecture to enable dynamic modification of the management strategy relating to resources, role behaviour, communications and team management, without interrupting the basic software within the system. Evaluation of the framework shows that it is scalable with respect to the number of roles, and consequently the number of autonomous systems participating in the mission. It is also shown to be optimal with respect to role assignments, and robust to intermittent communication link disconnections and permanent team-member failures.