Taha Bagatur

Home › Notes

My coding agents triggered 223 safety decisions in 8 days

The problem

Coding agents can run shell commands, edit files and call connected tools. A broad “yes” or “no” policy either leaves risky actions unchecked or interrupts routine work. I wanted a small, inspectable guard that asks for a human decision when a rule calls for it.

What Bekci does: ask, don’t block

Bekci is a local PreToolUse hook for Claude Code and Codex. Built-in protections cover credential files, AI attribution, external actions and destructive commands. Extra Markdown rules can ask, warn or deny; they cannot weaken the built-in protections. In Claude Code, an ask decision requests approval. Codex has no approval prompt for this hook, so Bekci maps ask to deny there. The same rule therefore has a different user experience across clients.

Real use, measured from the decision log

From 16 to 23 November 2026, the log contains 223 decisions across an 8-day date range: 174 asks, 43 denials and 6 warnings. Entries appear on seven of those dates. The log also records 21 secret-related rule matches and 73 push/force-push rule matches. These are rule and decision counts, not a count of unique commands or users. The snapshot ends at 16:04:02 on 23 November.

Examples (command shapes only)

The log stores timestamps, tool names, decisions and rule identifiers, not command text. These examples describe tested rule shapes; they are not quoted log entries.

What broke, and the fix

My test suite was writing to the production log, so the first count included 32 test-generated lines, including all 10 malformed-rule skips. I fixed this by making the tests hermetic: they write to a temporary log. Separately, malformed rules previously failed open because Bekci skipped them. They now fail closed with ask (which Codex maps to deny), and --check validates the rules file. The OSS fix is commit 7e928cf.

Try it

Bekci is public on GitHub. It is a small Python hook; the repository README has setup instructions and tests.

Next

This is the first post in a monthly agent-security audit series: one concrete tool or workflow, tested in use, with findings and limits documented.

Questions or notes on this write-up · All notes