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 (3)

Collapse
 
aisovereign profile image
Ananya Soni •

Leaving an agent running unattended only to have a missing CLI preflight rule lock up 55 files for 70 minutes is proper pain. That "ask first" deadlock when nobody is actually around to answer is such a classic trap for headless runs.

Tackling autonomous AI agents from problem scoping all the way to deployment is genuinely a whole different beast. At AGI Systems Directorate, we run into similar friction while building out safety guardrails for Project Lumina. Designing fallback logic that doesn't turn into a corporate apologizing robot while handling experimental triple-hybrid setups is tricky. You have to pre-hardcode decisions so the agent doesn't just freeze when it hits a wall.

How are you structuring those unattended fallback trees now?

Collapse
 
yantrakar profile image
Sandeep Shelke •

I am revisiting the sandbox environment setup. So input (skills, connectors, nodes reachable) is known and vetted. Then next step is defining context and expected outcome. Any skill introduced will have create decision flow.

Collapse
 
aisovereign profile image
Ananya Soni •

locking down the sandbox environment and pre-vetting reachable nodes and skill inputs is the only way to keep execution deterministic. once you map out the decision flow for every loaded skill, defining the execution context gets a lot cleaner. we run into similar sandbox boundary checks for our agent runtimes. but seriously, tackling time zones when coordinating across distributed nodes on the other side is a whole different kind of headache. how are you handling state persistence if a skill bails mid-flow?
But seriously we have the skill overlap