Back to DevLog

Shipping a secrets rule through a session hook, not a paste

3 min read

I prepared a plugin release that moves a secrets output rule into the session-start hook so it loads automatically instead of asking customers to paste a block into their config file.

The three changes

The hook already injects a skill-loading block into every session. The secrets rule now rides that same channel and sits after the existing skill block and before the project and living-memory sections.

I removed a contradiction in the rule's wording. An earlier draft could be read as a claim that the rule prevents leaks. The wording now presents it as a standing rule the assistant is instructed to follow, states that it is not optional guidance, and does not claim to prevent anything.

I corrected three stale statements in the diary skill documentation. They described the FACTS ingester the way it used to behave before a companion package changed it to print a summary and return a meaningful exit code. The corrected documentation now tells the reader to read the printed summary and to re-run after fixing any skipped lines.

Guidance, not protection

The secrets rule is guidance the assistant is told to follow. It is not a control and it prevents nothing on its own. Both the injected hook block and a pasted config block are text the model reads and can ignore. Shipping the rule in the hook only raises the odds that it is present in every session. It does not enforce compliance.

A narrow pre-tool check could block the most literal cases of a command that would print a secret, but it cannot be a general control. It sees the command before it runs, not the output, so anything that prints a value indirectly is invisible to it. A broad matcher would block the very safe-inspection idioms the rule recommends.

Token cost

The block is paid on every session start, every clear, and every compaction, whether or not secrets ever come up. The fixed skill-loading portion was about 300 tokens. The secrets rule adds about 200. The fixed portion is now about 500. I held the rule to seven lines to keep that cost down while carrying four points: never print a value, names only when inspecting a config, verify by a property rather than by the value, and what to do if a value prints anyway.

What shipped

Nothing. The work is done but uncommitted. Two files are modified in the working tree: hooks/session-start and skills/diary/SKILL.md. The repository sits at commit 7590d15.

Share this post