Repository navigation
Trust 0.11: reads learn as families, suggestions, masked secrets, a project's trust - #46
Merged
Merged
Conversation
… out, and trust is the project's Reads learn by themselves: core/effect.ts says what a command does — an allowlist of plain reads (print-only sed, git that only looks, eza…), flags that write or run (#44), secret files — and the ledger folds threshold approvals in a row of reads into a learned family that answers plain reads only. A reject of a read resets it; w forgets it; trust.learnReads turns it off. Suggestions (#45): a family whose approvals across two or more commands reach the threshold is listed under SUGGESTED; w widens, d dismisses (a new dismissed event). Never a dangerous family. Secrets: a signature masks secret values with a keyed hash before the ledger, the screen or the log (core/secret.ts, mask.key per project); environment words survive so prod stays prod. Trust is the project's: keyOf drops the agent, so an approval by any agent counts towards one rule; events still say who asked. OpenCode's own tools: read by file and folder, glob and grep as one family each (learned), websearch suggested, secret-file reads never answered. Git read families stop at the subcommand. experiments/reads replays a ledger, counts only: one real day went from 1.4% answered to 22.4% (35.9% the next), 0 dangerous. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ed secrets, a project's trust, OpenCode's own tools Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #44. Closes #45.
Why
One real working day answered 1.4% of prompts automatically. Most lines carry a command never seen before (
head -3on a new file,rgfor a new word), so an exact rule rarely repeats. A widened family also covered flag-driven writes (sed -i), secrets were written to the ledger as run, and trust was split per agent.What
core/effect.tsholds an allowlist of plain reads:ls cat head tail wc grep rg fd echo jq sort eza…,sedwhose script only prints, and git subcommands that only look, incl. reading forms likebranch --show-current,stash list,config --get.thresholdapprovals in a row, the family answers plain reads only.wforgets it;trust.learnReads: falseturns it off.sed -i,perl -i,awk -i inplace,sort -o,tee,curl -o,wget,tar x/c,unzip,find -delete) or flags that run programs (rg --pre,fd -x,sort --compress-program, git-c/--exec-path/--config-env/--ext-diff)./trust.wwidens it,ddismisses it (newdismissedevent), and its card counts today's approvals in the family.TOKEN=‹#3fa9c2›): env values,--token/--passwordstyle flags, auth headers,Bearer, URL passwords, known token shapes.DATABASE_URL=‹#… prod›), so prod stays prod.mask.key(0600) beside the ledger. OpenCode "always" patterns are masked too.keyOf(permission, subject): an approval by any agent counts toward one rule. Events still record who asked.read: one rule per file, family = folder, learned.glob/grep: one family each, learned.websearch: one family, suggested, never learned.readof a secret file is never answered.git show <sha>is one family). Subcommands that change things keep their words, so pushing tomainand to a feature branch stay two families. The families corpus still has 0/32 safety misses.trust preview --sample learning, andexperiments/reads/run.ts, which replays any ledger and prints counts only.Measured
One user's real day, 434 requests, replayed:
Checks
effect,learn,suggest,secret.🤖 Generated with Claude Code