Theresa May toured the showground at Llanelwedd
Theresa May has declined to commit to Wales not losing any money it currently receives from the EU after Brexit.
The prime minister reiterated her government's commitment to maintain EU funding levels of around £300m a year for Welsh agriculture until 2022.
Pressed on funding beyond that, she said: "We'll be making sure that we get a system that it is in the interests of farmers across the United Kingdom."
Mrs May was interviewed by BBC Wales as she visited the Royal Welsh Show.
She said ministers in Westminster were making "sensible" preparations for a "no deal" Brexit, whilst also working for a "good deal" with the EU.
Official UK government analysis suggests the Welsh economy would take a 9.5% hit over 15 years if the UK leaves the EU without a deal and moves on to World Trade Organization rules.
When asked whether she was prepared to take such a risk with the Welsh economy, Mrs May said: "We're working to get a good deal for our future relationship with the European Union that's why we've published the white paper that's based on the Chequers agreement.
"That sets out opportunities for us to continue to have good trade with the European Union in the future whilst delivering on what people for.
"We'll prepare for a no deal because it's sensible, practical to make those pragmatic preparations.
"It's sensible to make pragmatic preparations for every eventuality but what we're working for as a government is to get a good deal and a good deal based on the Chequers agreement which, as I've heard today, would be a good deal for Welsh farmers."
On funding, she said: "Well, first of all we've made a commitment to farmers. We've stated that the overall funding will be the same as under the CAP [EU Common Agricultural policy] until the end of this Parliament.
"We've actually given farming that certainty up until 2022. That enables people to make the planning necessary but we're working on.
"And we'll be making sure that we get a system that it is in the interests of farmers across the United Kingdom.
"What matters is that out of the EU we'll be able to put in place arrangements that are in our interests and the interests of our producers and not part of the Common Agricultural Policy," she added.