Untreated lumber is the safest to use in the vegetable garden. Redwood, red cedar and bald cypress trees grow in the US.
and provide lumber that is naturally insect and rot resistant. The highest grade of any of these varieties is the unblemished heartwood from the center of the tree.
You can use other species of untreated lumber, but they are not insect or rot resistant.
Wood treated with disodium octaborate tetrahydrate (DOT borates) is decay and insect resistant and is safe to use around food plants. Slight leaching of the borates may occur, which can affect plants' growth.
DOT is not poisonous to humans or pets, but it will kill fish and aquatic plants if it leaches into water. Do not use DOT lumber near ponds.
Toxic Pressure-treated Wood
The Environmental Protection Agency recommends that pressure-treated wood processed with toxic chemicals such as chromate copper arsenate (CCA), ammoniacal copper arsenate (ACA), and ammoniacal copper zinc arsenate (ACZA) should not be used near animals or food crops.