New York City, embracing an experimental mechanism for financing social services that has excited and worried government reformers around the world, will allow Goldman Sachs to invest nearly $10 million in a jail program, with the pledge that the financial services giant would profit if the program succeeded in significantly reducing recidivism rates.

The city will be the first in the United States to test “social impact bonds,” also called pay-for-success bonds, which are an effort to find new ways to finance initiatives that might save governments money over the long term.

First used in Britain and now being explored in Australia, the bonds are rapidly capturing the imagination of some public officials in the United States: on Wednesday, Massachusetts announced that it was completing negotiations with two nonprofit groups to finance juvenile justice and homelessness programs, with the promise of repayment only if the programs work.

The federal government, Connecticut, New York State and Cuyahoga County, Ohio, among others, are at various stages of considering using the bonds to harness new funds for human-services programs.