PhD Thesis: A Theory of Agreements and Protection