Generally, a free confession to officers isn't automatically illegal, but its use in a trial is a complicated matter. The essential factor is whether it was obtained properly. Officers must adhere to specific rules, https://panchanandshaw.com/blog/confession-law-guide/