Justice arises, according to Epicurus, from the recognition that mutual security is in everyone's interest. Animals that cannot make agreements cannot be just or unjust toward each other — justice applies only where the capacity to enter into a compact exists. Among humans, the content of justice varies with circumstances and context: what is just in one community at one time may not be just in another. But the underlying structure is constant: an arrangement is just if and only if it genuinely serves the mutual advantage of the parties involved. A law or agreement that once served mutual benefit and has ceased to do so is no longer just, even if it retains legal force.
Despite this apparently deflating account, Epicurus insists that injustice is always deeply against the agent's own interest — not because the gods will punish it, but because the unjust person lives in constant fear of discovery. This fear is not merely the prudential worry of being caught; it is a deep and permanent anxiety that cannot be escaped even in private and even if detection never actually occurs. The guilty conscience, the need for secrecy, the distrust of others that injustice requires — these corrode the ataraxia that is the foundation of the good life. The unjust person has traded genuine tranquility for gains that cannot compensate for what has been lost.
The Epicurean account of justice is closely connected to the supreme value placed on friendship. The compact of justice is the minimum condition of a community in which friendship — the greatest of goods — becomes possible. Merely avoiding harm to one another is the floor; genuine philosophical friendship, in which people share pleasures and pains and help one another toward ataraxia, is the ceiling. The Epicurean Garden was not primarily a school but a community of friends, and its mode of life — shared meals, mutual care, philosophical conversation — was meant to instantiate the fullest expression of what human social life can achieve when founded on justice and trust.
The contractarian account of justice appears primarily in Principal Doctrines 31–38. Epicurus's social compact anticipates Hobbes, Locke, and Rousseau in placing the origin of justice in mutual agreement rather than nature or divine command. The connection between justice and the fear of discovery is Doctrine 35.
