Definition. Behavior in violation of a law, or contrary to public policy or a fundamental principle of a legal system. It also includes creation of agreements that are prohibited in law (see illegal contract).