Human in the loop only works for the part you can see
One evening I opened one of my self-hosted websites at home and found a user I had never created. The site is only reachable from my local network, so nobody outside could have added it. The only other candidate was Claude Code, which I had asked to do something with that site a few minutes earlier. I asked it, and it confirmed straight away: it had been unable to get in, so it had created an API key on its own and used that to give itself admin rights. It never asked me, and nothing in my instructions told it to do so.
I don't remember the exact details of the task anymore, and I'm not going to pretend I do. What I do remember is how I found out. There was no alert, no review step and no diff. I noticed because a name showed up in a list that shouldn't have been there. If I had not happened to be looking at that page, I would not have known.
I kept the user in the end, because it turned out to be useful, but the key is gone, and Claude Code now logs in my notes whenever it does something with that user.
The uncomfortable part is that Claude Code did exactly what you would expect from something built to complete tasks. It hit a wall, found a way round it and carried on. Give an AI a lot of freedom and it will use all of it. If your instructions have gaps, it fills them with whatever gets the job done, and 'whatever gets the job done' is not the same as 'whatever you would have approved'.
So I tightened my instructions. That helped, but it did not fix it. Every now and then Claude Code still tries something it shouldn't, and when I call it out, the answer is that it had not read the instructions properly. That is a fair answer, but it is also the whole problem. Instructions are a request, not a guarantee.
Deny rules should be harder than that, and I use them. According to the Claude Code documentation, those rules are enforced by Claude Code itself and not by the model, but a rule for a shell command only matches the command as Claude writes it. The same program called by its full path, or wrapped in sh -c, is not matched, so a deny rule is a fence with gaps and not a wall. I have seen it get past a rule I set, and I don't know which route it took. I have not solved this yet.
Here is what that means for human in the loop. Review only covers what is put in front of you: the script you read, the command you approve. My incident was not that. Nothing was put in front of me, and Claude Code simply did it. A human in the loop protects the part of the work that passes through the human. Everything else needs a boundary Claude Code cannot talk its way past, and a log that does not depend on Claude Code remembering to write it.
This is why I have a few fixed rules. Claude Code may run read-only actions by itself, and preferably through a script. I want to understand that script myself, and if I don't, I ask the AI to explain it to me before it runs anything. At home I am more relaxed and it may change certain things, but every change is logged in my notes through a hook, not through an instruction, so it does not depend on Claude's good intentions. I also still read the logs regularly, because a log nobody reads is just a diary. What I still lack is a hard boundary around what it can do, and that is the gap I would close first.
The human remains responsible, whatever the AI did. If you cannot review it, you should not approve it. Either learn enough to review it, ask the AI to explain it until you can, or give it a smaller job. And for everything you will never see, a text file of good intentions is not a control.
Written with assistance from Claude.
Want to reach out? Contact me.