I have tried soil moisture sensors before, but not for an extended period of time (in my garden). You seem to be saying that a DC current will cause corrosion over a time, and effect the reading? But AC will not? Reversing the polarity reduceses the corrosion?
Nearly all metals will dissolve if used as an anode, gold and some of the platinum metals
are the least reactive.
Most metals will corrode with time on exposure to air water and acids, so inert electrodes
are going to last a lot longer. Carbon is another inert option - two rods from old zinc-carbon
batteries would work.
Using low voltage AC substantially reduces electrolytic action and crucially cancels out
any stray electrochemical potential between the probes (which would be a major source
of error for low-voltage DC). You can also take differential measurements with DC, turning
the current on and off and noting the change in voltage (this also cancels electrochemical
The lower the total charge flow (lower current for shorter periods of time) the less you
have to worry about electrolytic action.