Could robots have rights? On the one hand, robots are becoming increasingly human-like in appearance and behavior. On the other hand, legal systems around the world are increasingly recognizing the rights of nonhuman entities. Observing these macro-level trends, in this paper I present an ecological framework for evaluating the conditions under which some robots might be considered eligible for certain rights. I argue that a critical, materialist, and broadly ecological interpretation of the environment, along with decisions by jurists establishing or upholding the rights of nature, support extension of rights to nonhuman entities like robots.