I do not think there is a general rule. It is done on a case by case basis.
DGC often share secrets with me - of the most trivial nature - what presents they have bought people for birthdays/Christmas, a surprise for a friend or something like that. These are what I called conspiratorial secrets with both party's complicit. Children love secrets and I see no problem with them, while they are trivial.
The real problem is when an adult makes a child feel uncomfortable by forcing a secret on them that they do not want or makes them do some thing they are not comfortable with and then forces secrecy upon them or if the child is planning something that would put them at moral or physical risk. If a child told me about something like these in secrecy, I would not think twice about taking appropriate action, which doesn't have to be a clear breach of confidence. Sometimes children tell you things like this because they want you to rescue them from a situation they are not happy about. Sometimes a solution can be found, without the child being aware you have breached their confidence.
In between are the problem areas and I would judge each case on its merits.