This is at least part of what Harold Finch was trying to prevent with his Machine in (Person of Interest)[0]. Having it have access to all of the data was bad enough, but being able to ask it any question you wanted was always a terrifying proposition. Especially if you then consider what happens when that AI starts doing things on it's own (see Samaritan from the same show).
[0]: https://www.imdb.com/title/tt1839578/