There aren’t penalties but investors are subject to market conditions. If interest rates go up after purchasing US Treasurys, all other factors being equal, the value of the bonds will go down, and vice versa. Investors should pay attention to their liquidity needs and when funds will be needed they aren’t negatively affected by bond market fluctuations.