Skip to content

fix(github-actions): prevent prompt injection in issue labeling#3741

Merged
alan-agius4 merged 2 commits into
angular:mainfrom
josephperrott:fix/prompt-injection
Jun 5, 2026
Merged

fix(github-actions): prevent prompt injection in issue labeling#3741
alan-agius4 merged 2 commits into
angular:mainfrom
josephperrott:fix/prompt-injection

Conversation

@josephperrott
Copy link
Copy Markdown
Member

This PR mitigates a Prompt Injection vulnerability in the issue labeling workflow by separating the user-controlled issue title and body from the Gemini system instructions.

@josephperrott josephperrott requested a review from alan-agius4 June 5, 2026 00:23
@josephperrott josephperrott added the action: merge The PR is ready for merge by the caretaker label Jun 5, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the Gemini model prompt in issue-labeling.ts by separating the system instructions from the user content (issue title and body) and utilizing the systemInstruction configuration parameter. The feedback suggests using optional chaining and nullish coalescing (?. and ?? '') instead of non-null assertions (!) to robustly handle cases where the issue title or body might be null or undefined.

Comment thread github-actions/labeling/issue/lib/issue-labeling.ts
@alan-agius4 alan-agius4 merged commit f38af6a into angular:main Jun 5, 2026
16 checks passed
@alan-agius4
Copy link
Copy Markdown
Contributor

This PR was merged into the repository. The changes were merged into the following branches:

@josephperrott josephperrott deleted the fix/prompt-injection branch June 5, 2026 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants