Skip to content

feat(agentic chat): add permission check for all tools and add UI permission cards #1078

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 23, 2025

Conversation

ashishrp-aws
Copy link
Contributor

Problem

User permissions check for reading files/list directory outside of workspace is not setup.

Solution

  • add permission check for fsRead and listDirectory tools
  • Adds permission cards for allowing access

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ashishrp-aws ashishrp-aws requested a review from a team as a code owner April 23, 2025 00:44
const document = await this.#triggerContext.getTextDocument(input.path)
this.#triggerContext
.getToolUseLookup()
.set(toolUse.toolUseId, { ...toolUse, oldContent: document?.getText() })
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we taking a snapshot before showing the "allow writing outside workspace" message? Could this snapshot then be outdated by the time the file is actually modified?

Copy link
Contributor Author

@ashishrp-aws ashishrp-aws Apr 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was existing context used by writing code diffs. But yeah it is a possibility, in case of text changes during this period, tool use fails and model retries with updated file information

@ashishrp-aws ashishrp-aws merged commit 6194a75 into aws:main Apr 23, 2025
6 checks passed
volodkevych added a commit that referenced this pull request Apr 23, 2025
@ashishrp-aws ashishrp-aws deleted the permission-check-tools-ui branch May 5, 2025 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants