One policy.yaml generates Grok Bot skills and Auto-review rules with make check for drift
Source read in fullRead first
Overview
People using Grok Bots, Cursor and Grok Build put agent rules in one policy.yaml and render them into each tool's format, avoiding copies that drift independently.
Workflow
- Trigger: The same rules are needed in multiple agent environments. The README says, "Rules are written once in
policy.yamland plain Markdown inshared/.make renderturns them into each environment's format, andmake checkfails if the committed output drifts from the source." - By hand: Install the generated output in Grok Bot. "Add
dist/grok-bot/workspace-conventions/to the shared skill library and a load line to each bot". The result is a skill plus starter Auto-review rules. - Bot: Load workspace conventions at the start of each relevant turn. The skill says, "Load at the start of every turn that reads or writes /workspace, creates files, logs a run, hands work to another bot, or touches secrets." OWN-1 says, "A bot writes only under paths it owns per the layout and
etc/registry.json. Everything else is read-only to it." - Bot: Follow strict rules for secrets, logging and handoffs. SEC-1: "Never write secrets, tokens or environment values to
/workspace, logs, memory or any repo." LOG-1 appends a JSON line to var/log/<bot>/turns.jsonl each turn with duration, tools, message count and errors. "Log counts and metadata, never message content." Handoffs use ATOM-1: "Write to a temp file in the same directory, then rename() it into place." Readers never see a partial file. - Check: The author uses
make checkat build time to render to a temporary directory and diff against committed dist/. The SKILL.md header says "Generated by agent-policies 0.2.0 from policy.yaml. Do not edit; run make render."
Key points and results
- Least privilege relies on conventions. The principles say "All agents run as the same user, so the kernel cannot keep them apart." Each agent restricts its own writes to its owned paths. The README describes hooks as "guardrails, not a security boundary".
- Separate policy from mechanism and regenerate after a change. policy.yaml defines what must happen. Skills, rules and hooks carry it. Generated output is versioned and must not be edited by hand.
- Cross-bot handoffs use file queues. Write a temporary file in var/spool/<queue>/ and rename into place. Each turn atomically overwrites run/<bot>/status.json as a process table.
- Rules are enforced or advisory. Each rule lists what enforces it (convention / auto-review / hook), while tokens_per_bot_per_day is guidance "watched via daily usage routine into var/metrics".
Source
- Platform
- GitHub
- Author
- rsnobles
- Published
- Categories
- Getting started, Limits
What this evidence label means
Source read in full
We read the source (post, article or transcript). That only means the original was read. It does not mean this site reproduced the author's results.