feat(auto-permissions): count confirmed dialog answers as user evidence - #25
Draft
hank-warren wants to merge 2 commits into
Draft
feat(auto-permissions): count confirmed dialog answers as user evidence#25hank-warren wants to merge 2 commits into
hank-warren wants to merge 2 commits into
Conversation
- allowlist entries match verbatim; bare names match any namespace, dotted names are exact - require explicit cancelled:false and boolean isError; reject notes-only answers - lead records with the user-selected content and label the assistant-drafted question - root the prompt rule in the structured source field and mark the question as non-instruction - fingerprint: omit empty allowlist, sort entries; config: deduplicate - add end-to-end harness test threading config into evidence and resetting lineage - document the full accept/reject contract and matching semantics; extend security boundary
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.
Implements #24: an operator-allowlisted, tool-agnostic way for confirmed
interactive-dialog answers to count as user authorization evidence.
Changes
config.ts—reviewEvidence.userAnswerTools: string[](default[],trimmed, validated; current behavior unchanged when absent).
review.ts—collectReviewEvidencetakes the allowlist. A successful,non-cancelled
toolResultfrom an allowlisted tool (matched on base name, sofunctions.ask_user_questionqualifies) whosedetailscarry{ answers: [{ question, answer? | selected[], notes? }], cancelled: false }(and no
errorfield) emits one record per answered question at thetoolResult entry:
{ source: "user", text: 'USER (dialog answer): selected "…" — assistant-drafted question: "…"' }.The user-chosen content leads the record; the assistant-drafted question is
labeled as quoted context. Bare allowlist names match the tool in any
namespace; dotted names match exactly.
Keys are stable (
entryId:answerIndex:dialog-answer), so delta mode and theevidence-prefix cache are unaffected. Envelope prose, cancelled/errored
results, and unanswered questions are never read.
USER (dialog answer):records:authorization for exactly the selected content, with the caveat that question
and option wording is assistant-drafted.
index.ts— passes the allowlist into evidence collection and adds it to thereviewer fingerprint so a policy change resets reviewer lineage.
operator trust in the tool name; nothing inferred).
Testing
bun test: 50 pass (12 new — config validation/trim/reject, promotion,multi-select + notes, base-name matching, and the full ignore matrix:
non-allowlisted, cancelled, errored, empty, malformed).
userAnswerTools: ["ask_user_question"]: the dialog selections surface asUSER (dialog answer):records naming the exact files and commit message theguardian previously could not see. The same evidence, injected via a bridge
extension, was verified end-to-end to flip the guardian from
ask_usertoapproveon that command.Draft pending your take on the shape from #24 — happy to adjust naming, record
format, or the prompt wording.
Update: after two independent review passes, pushed a hardening commit
(
2a5269f): verbatim allowlist matching (a dotted entry can pin an exact tool;bare names match across namespaces), strict
cancelled: false/ booleanisErrorgating, notes-only answers rejected, records restructured to leadwith the user-chosen content, the prompt rule rooted in the structured source
field, fingerprint/config normalization, an end-to-end harness test proving the
allowlist threads through real config load and resets reviewer lineage, and the
full accept/reject contract documented in the README. 52 tests pass.