Yahoo Inc. said Wednesday it will bar chat rooms that promote sex between minors and adults and restrict all chat rooms to users 18 and older.

The changes come under an agreement with New York Attorney General Eliot Spitzer and Nebraska Attorney General Jon Bruning.