Manchester-born, the 19-year-old will command a development fee, expected to be in the region of £350,000, rising to £750,000.
Primarily a centre back, Egan-Riley can also play at right back and as a holding midfielder.
At City, he helped the Under 18s win the title in 2019/20, and the EDS side win Premier League 2 the following season.
He made his first team debut in the 6-1 Carabao Cup win over Wycombe in September, before helping retain the PL2 title, captaining the side to the trophy.
Egan-Riley also made his Champions League debut in March in a goal-less draw at home to Sporting CP in the Round of 16 second leg, before making his Premier League bow as a half-time substitute in the 5–0 home win over Newcastle United in May.
He has been called up for England at every age group from Under 15s to Under 19s, also representing the Republic of Ireland in the 2018 Victory Shield.
Egan-Riley is Kompany’s third signing, following Scott Twine and Luke McNally, with Taylor Harwood-Bellis expected to agree a season-long loan from City.
Kompany is also closing in on Standard Liege pair Jackson Muleka and Samuel Bastien.