Approval hashes stored inside the KB are forgeable; keep approvals per machine
PitfallVerified 2 Oct 2026Holds anywhere
Pitfall. The symptom, what causes it, and the fix that was run and seen to work.
Symptom#
An approval hash for a lesson's Check or Probe script that is stored inside the KB is forgeable. An agent can compute the hash and write it with sed -i or Python, which no deny rule catches, and --confirm is only a flag an agent can type.
Cause#
Anything inside the KB is writable by the agent, and Claude Code permission rules do not allow a wildcard in the middle, so Bash(rkb * --confirm*) is invalid.
Fix#
Store approvals outside the KB, per machine (~/.config/rkb/approvals.toml, never synced), and make --confirm read y from /dev/tty, which an agent does not have.
Evidence#
Found during the rkb design; the approvals file and /dev/tty check were implemented.
Cost accepted#
needs_user works only because agents cooperate, so the real safety is approvals plus an export review.
Also found by searching
- approval hash stored inside the KB is forgeable
- agent writes approvals.toml hash with sed -i
- --confirm is only a flag an agent can type
- Bash(rkb * --confirm*) is invalid in Claude Code