fix(ai): Redact session input and gate state-changing tools on approval#188
Merged
Conversation
Content seeded into an assistant session from the UI, such as a file being edited or pasted command output, was sent to the model provider verbatim. Known secret values and credential-shaped assignments are now stripped from it before it enters the transcript, matching the guarantee the analyze endpoints already made: secrets never leave the server.
An auto-run session executed every tool without a pause, including ones that change state, gated only by the caller's permissions. Now a tool batch containing a state-changing call always waits for per-call operator approval, in every session: reads run free, writes ask first.
Code Review SummaryThis PR improves the security of AI sessions by redacting secrets from input context and enforcing manual approval for all state-changing tools, even when auto-run is enabled. This ensures sensitive credentials stay internal and hazardous operations remain under human control. 🚀 Key Improvements
💡 Minor Suggestions
|
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.
Found while wiring the file editors to the assistant (flatrun/ui#71), two gaps in the "live editing" story.
Content seeded into a session from the UI, a file being edited or pasted output, reached the model provider verbatim. The analyze endpoints already redact known secret values before anything leaves the server; the session path now does the same.
An auto-run session also executed every tool without a pause, including state-changing ones, gated only by the caller's permissions. A tool batch containing a state-changing call now always waits for per-call operator approval: reads run free, writes ask first.