A restriction has to live in a record. The instrument of transfer, the gift agreement, the terms of a fund, the language of a will: these are what a charity's lawyers read years later. An oral understanding with a development officer who has since left is not one of them. This is the single most common gap between what a donor believes they arranged and what the charity is obliged to do.
A community foundation is required by federal tax regulation to be able to override you. To be treated as a single publicly supported organization rather than a pile of separate funds, a community trust's governing body must have the power, under 26 CFR 1.170A-9(f)(11)(v)(B)(1), "to modify any restriction or condition on the distribution of funds for any specified charitable purposes or to specified organizations if in the sole judgment of the governing body (without the necessity of the approval of any participating trustee, custodian, or agent), such restriction or condition becomes, in effect, unnecessary, incapable of fulfillment, or inconsistent with the charitable needs of the community or area served." A donor writing a restricted fund at a community foundation should understand that this power is not something the foundation negotiated for. It is a condition of its own tax classification, and a foundation that gave it up would jeopardize that classification.
State law decides when a restriction can be released or changed, and there are more routes than donors expect. California's enactment of the Uniform Prudent Management of Institutional Funds Act, at Probate Code section 18506, is a workable illustration of the pattern. Subdivision (a) lets the institution release or modify a restriction if the donor consents in a record, though not so as to allow the fund to be used for a non-charitable purpose. Subdivision (b) lets a court modify a restriction on management or investment where it "has become impracticable or wasteful," where it impairs management or investment, or where circumstances the donor did not anticipate mean modification will further the fund's purposes; any such modification must, to the extent practicable, be made "in accordance with the donor's probable intention." Subdivision (c) reaches further, letting a court modify the purpose itself where a particular charitable purpose or restriction "becomes unlawful, impracticable, impossible to achieve, or wasteful," in a manner "consistent with the charitable purposes expressed in the gift instrument." Those two subdivisions are the statutory versions of what practitioners call deviation and cy pres respectively: (b) changes the means, (c) changes the end.
And there is a route with no court in it. Under subdivision (d), an institution that determines a restriction is unlawful, impracticable, impossible to achieve or wasteful may release or modify it 60 days after notifying the Attorney General and the donor, if the fund is worth less than $100,000, more than 20 years have passed since it was established, and the property is used consistently with the charitable purposes expressed in the gift instrument. That is how a small, ancient, narrowly written fund gets unstuck.
Notice runs to the Attorney General, and that tells you who enforces. Every court route in the California statute requires the institution to notify the Attorney General and give that office an opportunity to be heard. The donor is entitled to notice only on the small-and-old route in subdivision (d). Whether a donor personally has standing to sue a charity to enforce a restriction is a question of the governing state's law and is not something to assume; the statutory design routes supervision through the state's charity regulator. A donor who wants a personal enforcement right has to negotiate for it in the gift agreement, and get it in writing, before the money moves.
The practical implication runs against the instinct. A donor who writes the narrowest possible restriction, naming one program at one institution in one city, has not protected the gift; they have raised the probability that the purpose becomes impracticable and a court or a governing body changes it anyway. A restriction stated at the level of the purpose, with the specific program given as the donor's preference rather than as a condition, survives changed circumstances better and is easier for the charity to honor.