Skip to content

fix(amazonq): require exact approval for sensitive paths - #2952

Open
hezelin-work wants to merge 1 commit into
Amazon-Q-Developer:feature/security-fixesfrom
hezelin-work:fix/file-tools-sensitive-approval
Open

hezelin-work wants to merge 1 commit into
Amazon-Q-Developer:feature/security-fixesfrom
hezelin-work:fix/file-tools-sensitive-approval

Conversation

@hezelin-work

@hezelin-work hezelin-work commented Oct 20, 2026 •

Copy link
Copy Markdown

Problem

Path approvals for file tools and shell commands applied more broadly than intended.

Solution

Require a separate approval for credential and system paths, including the working directory and path arguments of shell commands, and for files that share their data with another name on disk. Record an approval only after the tool succeeds, and for a shell command only when the prompt was about running outside the workspace.

Behavior change: the agent may ask again before it uses a credential file or folder, or a file with another name on disk, in a folder the user already approved, including for shell commands. A prompt that covers several files now shows the warning for each of them.

Testing: added unit tests.

License

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

@codecov-commenter

codecov-commenter commented Oct 23, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 92.59259% with 18 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...nguage-server/agenticChat/agenticChatController.ts 72.34% 12 Missing and 1 partial ⚠️
...c/language-server/agenticChat/tools/executeBash.ts 97.24% 3 Missing ⚠️
...rc/language-server/agenticChat/tools/toolShared.ts 97.33% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@hezelin-work
hezelin-work force-pushed the fix/file-tools-sensitive-approval branch 5 times, most recently from 74fba47 to dd58237 Compare October 23, 2026 12:31
- Credential and system paths need their own approval, not a parent
  directory's. This also applies to the executeBash working directory and
  to arguments that the shell can expand to hidden names.
- Keep executeBash file checks for approved paths.
- Record an approved path after the tool succeeds, and for executeBash
  only when the command exits normally.
@hezelin-work
hezelin-work force-pushed the fix/file-tools-sensitive-approval branch from dd58237 to 5ad4093 Compare October 23, 2026 12:42
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