typing.cast() masks unverified bool values in Google's ADK Python SDK
In Google's adk-python SDK, a tool call's human-confirmation flag is returned via typing.cast(bool, ...), which performs no actual type conversion at runtime and simply returns its argument unchanged. If the awaited expression resolves to None, the caller receives None, causing the confirmation step to be silently skipped. This mirrors a coercion bug previously filed against openai-agents-python as issue #4845, though the mechanism here is declaration rather than explicit conversion. The author also noted self-reported errors in their scanning tool, including incorrect line numbers and a mislabelled signal count, highlighting how a correct result with a flawed cause can go undetected. The issue reflects a gap in static-analysis tooling, as cast() over an already-verified value is legitimate, making it difficult to distinguish safe uses from potentially unsafe ones automatically.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in