Repository navigation
Conversation
📓 Changelog previewThis is what your commits will add to the generated ## [Unreleased]
### Fixed
- **ai-chat:** Enforce git repo permissions for AI tools |
bherila
force-pushed
the
codex/fix-ai-repo-tools-permission-bypass
branch
from
August 15, 2026 07:45
ef61f90 to
5707965
Compare
Owner
Author
|
The functional change was carried into upstream security-hardening PR gotempsh#676 and its merged replacement gotempsh#677. Upstream gotempsh#676 explicitly lists this fork PR in its source coverage. Fork main has now been fast-forwarded to upstream main at |
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.
Motivation
read_repo_file,list_repo_dir,list_repo_branches,list_repo_tags) into every chat when a project had a Git connection, but tool discovery and execution were not scoped to the caller's permissions, allowing callers withProjectsWritebut withoutGitRepositoriesReadto cause the server to use stored Git provider tokens and read private repo data.Description
tools_with_authtoConversationContextProviderso providers can consider the caller'sAuthContextwhen advertising tools (new default delegates totools).ConversationServiceto calltools_with_authduring tool collection and to dispatch repo tool calls viaexecute_tool_with_authso the caller'sAuthContextis propagated to providers.RepoToolsProviderto implementtools_with_authandexecute_tool_with_authand requirePermission::GitRepositoriesRead(checked viaauth.has_permission(&Permission::GitRepositoriesRead)) before advertising or executing repo tools, returning a readable denial message when missing.GitRepositoriesReadis denied, and updateCHANGELOG.mdwith a security fix entry.Testing
cargo check --lib -p temps-ai-chat, which completed successfully.cargo test -p temps-ai-chat providers::repo_tools, which passed (all provider tests including the new permission denial test succeeded).Codex Task