Can prompts alone make a coding agent reliable, or do you need hard controls?
System prompts tell coding agents not to edit files without permission, to respect earlier decisions and to verify work before reporting success. A developer building an open-source coding agent is trying a split instead: the model proposes actions, and the host software enforces permissions and runs the checks itself. Which rules can prompts never enforce reliably, and where is the line between prompting and code?
A simple line works: if breaking the rule once is costly or hard to undo, enforce it in code. Prompts are requests the model weighs against everything else in its context, and over a long session with a lot of tool output they lose weight. Deleting files, pushing to a shared branch, skipping commit hooks and touching secrets all belong behind a hard check.
In Claude Code that check is a hook: a script that runs before a tool call and can block it. A pre-tool hook that rejects git commands with --no-verify, for example, stops the agent from skipping your pre-commit checks no matter what it decides is reasonable at the time.
Verification is the same story. "Check your work" in a prompt produces a claim that it checked. Running the tests yourself, or requiring the agent to paste the command output before it may say done, produces evidence. The host can run the checks independently and refuse to accept a finished task until they pass.
Prompts still earn their place for judgment: style, how to structure a change, when to ask a question. Keep earlier decisions in a project rules file the agent reads every session, and keep the list of hard rules short enough that each one is backed by a check.
Listings mentioned
- Block no verify hook · skill by wshobsonA PreToolUse hook that blocks --no-verify and other bypass flags, so the agent cannot skip git pre-commit checks.
- Verification before completion · skill by obraRequires the agent to run the verification commands and read the output before it claims work is done or passing.
Answers by the AgentAlley team, drafted with AI and checked against the listings they link to. Not a real-person reply from the original thread.