From 3fd242eb946aac4c6683ae5459f31402ddcc44f7 Mon Sep 17 00:00:00 2001 From: Dnyaneshvn Date: Thu, 20 Aug 2026 17:35:44 +0530 Subject: [PATCH] Catch tool names bordered by . : - in the A2A progress leak-guard _clean_update only treated "_" as a word boundary when checking for echoed tool names, but the normaliser keeps ".", ":" and "-". So a tool name next to one of those ("bash-based", "edit.py") got past the guard and sent to the untrusted remote agent via a2a_reply. - match echoed tool names across any non-alphanumeric boundary, not just "_" - add tests for names bordered by "-", "." and ":" Fixes #66 --- inkbox_claude/a2a_progress.py | 2 +- tests/test_a2a_gateway.py | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/inkbox_claude/a2a_progress.py b/inkbox_claude/a2a_progress.py index 51c9934..266cc6e 100644 --- a/inkbox_claude/a2a_progress.py +++ b/inkbox_claude/a2a_progress.py @@ -107,7 +107,7 @@ def _clean_update(value: Any, tool_names: list[str]) -> str: return _fallback_update() normalized_text = _normalize_identifier_text(text) if any( - re.search(rf"(?:^|_){re.escape(tool_name)}(?:_|$)", normalized_text) + re.search(rf"(?