The agreements, if implemented, would represent the clearest progress yet towards a wider ceasefire that the US sees as a stepping stone towards peace talks to bring an end to Russia's three-year-old war in Ukraine.
Both countries said they would rely on the US to enforce the deals.
"If the Russians violate this, then I have a direct question for (US) President (Donald) Trump. If they violate, here is the evidence - we ask for sanctions, we ask for weapons, etc," Ukrainian President Volodymyr Zelenskiy told reporters at a news conference in Kyiv.
Russian Foreign Minister Sergei Lavrov said: "We will need clear guarantees. And given the sad experience of agreements with just Kyiv, the guarantees can only be the result of an order from Washington to Zelenskiy and his team to do one thing and not the other."
The agreements, reached in Saudi Arabia, follow talks initiated by Trump, who has vowed to swiftly end the war.
Under the agreement with Russia, the US promised to help restore Russian access to markets for its agricultural and fertiliser exports.
The Kremlin said this would require lifting some sanctions.
The talks followed separate phone calls last week between Trump and the two presidents, Zelenskiy and Vladimir Putin.
Putin rejected Trump's proposal for a full ceasefire lasting 30 days, which Ukraine had previously endorsed.
Ukrainian Defence Minister Rustem Umerov said his country would regard any movement of Russian military vessels outside the eastern part of the Black Sea as a violation and a threat, in which case Ukraine would have the full right to self-defence.
Russia has attacked Ukraine's power grid with missiles and drones throughout the war, arguing that civil energy infrastructure is a legitimate target because it helps Ukraine's war-fighting capability.
More recently, Ukraine has been launching long-range strikes on Russian oil and gas targets, which it says provide fuel for Russian troops and income to fund its war effort.
Early in the war, Russia imposed a de facto naval blockade on Ukraine, one of the world's biggest grain exporters, which threatened to worsen a global food crisis.
But maritime battles have been only a comparatively small part of the war since 2023, when Russia withdrew its naval forces from the eastern Black Sea after a number of successful Ukrainian attacks.
Ukraine was able to reopen its ports and resume exports at about pre-war levels, despite the collapse of a previous United Nations-brokered Black Sea shipping agreement.
The accords are the first ones aimed at halting energy strikes since Russia launched its full-scale invasion in February 2022.
The fighting rages on across a 1000km front line.
Trump is pressing both sides to bring a swift end to the war, a goal he promised to achieve when he ran for president last year.
At the same time he is pursuing a rapid rapprochement with Russia that the US and the Kremlin say could lead to lucrative business opportunities.
Ukraine and its European allies fear Trump could strike a hasty deal with Putin that undermines their security and caves in to Russian demands, including for Ukraine to abandon its ambitions to join the NATO military alliance and give up the entirety of four regions claimed by Russia as its own.
Ukraine has rejected that as tantamount to surrender.
with AP