DEV Community

Cover image for My own guardrail stopped my coding agent for 70 minutes
Sandeep Shelke
Sandeep Shelke

Posted on AI-assisted

My own guardrail stopped my coding agent for 70 minutes

I left a coding agent running unattended: Copilot CLI, headless, in a resume loop. It loaded my gitpro skill on its own, because the skill's description says to use it before committing.

The skill has one rule: before any git commit, run gitpro why to check the identity. On that machine the gitpro CLI was not installed. The skill also says: if it is missing, ask before installing. There was nobody to ask.

So the agent did exactly what it was told. It kept working, checked once more for gitpro, never committed, and ended the run with a note: the identity preflight is unavailable and must not be bypassed. No --no-verify, no install, no commit under a wrong name.

The guardrail worked. It also left about 70 minutes and 55 files of verified work uncommitted, until I re-ran the tests and committed it myself.

What the rule was missing

  1. A path for unattended runs. "Ask the user" is not a rule when nobody is there.
  2. A difference between a local commit and a push. This repo had no remote. A local commit is easy to undo; a push is not.
  3. A difference between blocked and done. The agent finished the run instead of reporting a blocker.

The change I am proposing

In an unattended run without gitpro: allow a local commit in a repo with no remote, when the repo's own user.email is set, and record that the check was skipped. Anything with a remote, or any push, stops and is reported as blocked, not done.

If you write rules for agents, give every "ask first" an answer for when nobody is there. In an unattended run you can't be available, so the decisions it will need have to be recorded beforehand, as part of the skill. This needs better understanding. How do you handle those decisions in your unattended runs?

gitpro: https://gitpro.dev

PS: Written with help from Claude. The experience and the tool are mine.

Top comments (0)