security(hooks): Wrap hook-injected context in distinct XML tags (#17237)

Co-authored-by: Yuna Seol <yunaseol@google.com>
This commit is contained in:
Yuna Seol
2026-01-21 21:11:45 -05:00
committed by GitHub
parent 75e4f492ab
commit 5debf86854
8 changed files with 136 additions and 12 deletions
+3 -1
View File
@@ -317,7 +317,9 @@ export const AppContainer = (props: AppContainerProps) => {
if (additionalContext && geminiClient) {
await geminiClient.addHistory({
role: 'user',
parts: [{ text: additionalContext }],
parts: [
{ text: `<hook_context>${additionalContext}</hook_context>` },
],
});
}
}