As the government wraps up its Troubled Asset Relief Program, the company that received the most from the fund, the American International Group, is offering an exit plan with no clear sense of whether the taxpayers will end up with a gain or a loss.

A.I.G.’s exit agreement, announced Thursday, includes a number of steps that must be taken by early 2011, when the Federal Reserve Bank of New York will officially sever its ties to the company and the Treasury Department will expand its stake to 92.1 percent, then convert all of its preferred shares to common.

For many months if not years afterward, the Treasury will retain an A.I.G. exposure as it slowly sells off its stake on the public markets. A rapid sell-off would spoil the taxpayers’ recovery by driving down the share price.

The exit plan does leave open the possibility that the taxpayers will ultimately be made whole for the assistance they extended to A.I.G., by far the most offered to any nongovernmental company during the financial crisis of 2008. But taxpayers could end up in the red if A.I.G.’s stock price falls before the Treasury can finish selling its shares. Market-moving events, like big jury awards or hurricane losses, are at the heart of the insurance business.