cd /news/developer-tools/cfg-guard-a-lock-and-a-witness-for-c… · home › topics › developer-tools › article
[ARTICLE · art-156410] src=dev.to ↗ pub= topic=developer-tools verified=true sentiment=· neutral

cfg-guard: A lock and a witness for config files too many hands…

A developer released cfg-guard, an MIT-licensed Python tool that protects shared config files using flock plus a content-hash compare-and-swap to reject writes whose base bytes changed, and uses inotify with /proc to identify processes that write around the lock. The tool relies only on the standard library and sends no data anywhere, and its author cautions that its checks can produce false positives and should be used to flag candidates for rewriting rather than to grade writers.

by read1 min views3 publishedOct 23, 2026

Most cfg-guard write-ups stop at the README: here is what the tool does, here is how you run it. This one covers what it refuses to do, and where it breaks.

A lock and a witness for config files too many hands edit: flock plus a content-hash compare-and-swap refuse a write whose base bytes moved, and inotify with /proc names whoever writes around the lock. Stdlib only.

In Russian: Замок и свидетель для конфигов, которые правят много рук: flock плюс compare-and-swap по хэшу содержимого не дают затереть чужую правку, а inotify и /proc называют того, кто пишет мимо замка. Только stdlib.

pip install cfg-guard

Python. MIT licensed. Standard library first: the tool reads the data you point it at and sends nothing anywhere.

Every rule in a checker like this can produce a false positive. Use it to find candidates for a rewrite, not to grade a writer, and not where the voice is the point.

Source, issue tracker and documentation: https://gitlab.com/ameobius-ai/cfg-guard

Other tools from the same author: https://ameobius-ai.gitlab.io

── more in #developer-tools 4 stories · sorted by recency
── more on @cfg-guard 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/cfg-guard-a-lock-and…] indexed:0 read:1min 2026-10-23 · —