PyPI / google-genai / 2.31.0

google-genai 2.31.0

Source
https://github.com/googleapis/python-genai
Tag scanned
v2.31.0
Compared with
v2.30.1 (0 signals introduced since)
Files
612 scanned, 42 skipped (binary, oversized, or unrecognised)
Signals
0 critical · 0 warn · 21 info
Scan time
12.1 s
LLM review
Reviewed by claude-haiku-5-5 (Anthropic): 16 of 16 warn and critical signals; 16 demoted to info.
Disclude version
4.0.0
Scanned (UTC)
2026-10-15 16:41

Signals

Ordered by severity, then signals introduced in this release. Hidden characters are shown as ⟨U+…⟩.

  1. line length 1504 characters (raw pass, confidence 0.50)

    const stopwords = new Set(["a", "about", "above", "after", "again", "against", "all", "am", "an", "and", "any", "are", "aren't", "as", "at", "be", "because", "been", "before", "being", "below", "between", "both", "but", "by", "can't", "cannot", "could", "couldn't", "did", "didn't", "do", "does", "doesn't", "doing", "do
  2. info warn → info by review long-line docs/_static/language_data.js:11:1

    line length 4031 characters (raw pass, confidence 0.65)

    BaseStemmer=function(){this.current="",this.cursor=0,this.limit=0,this.limit_backward=0,this.bra=0,this.ket=0,this.setCurrent=function(t){this.current=t,this.cursor=0,this.limit=this.current.length,this.limit_backward=0,this.bra=this.cursor,this.ket=this.limit},this.getCurrent=function(){return this.current},this.copy_
    likely benign LLM, confidence 0.95 Minified Snowball stemmer language data in docs static files.
    Reasoning

    Long line in a minified Snowball stemmer data file under docs static assets; minification produces long lines with no malicious content shown.

  3. info warn → info by review long-line docs/_static/language_data.js:12:1

    line length 7732 characters (raw pass, confidence 0.65)

    var EnglishStemmer=function(){var a=new BaseStemmer,c=[["arsen",-1,-1],["commun",-1,-1],["emerg",-1,-1],["gener",-1,-1],["later",-1,-1],["organ",-1,-1],["past",-1,-1],["univers",-1,-1]],o=[["'",-1,1],["'s'",0,1],["'s",-1,1]],u=[["ied",-1,2],["s",-1,3],["ies",1,2],["sses",1,1],["ss",1,-1],["us",1,-1]],t=[["succ",-1,1],[
    likely benign LLM, confidence 0.95 Minified English stemmer tables bundled with Sphinx docs.
    Reasoning

    Minified stemmer algorithm tables, a standard Sphinx-bundled JS file; long line is typical of minification.

  4. info identifier-low-length docs/_static/scripts/furo.js:1:1

    324 of 705 non-conventional identifiers are single-character (46%) (token pass, confidence 0.50)

  5. info warn → info by review long-line docs/_static/scripts/furo.js:2:1

    line length 5126 characters (raw pass, confidence 0.65)

    (()=>{var t={856:function(t,e,n){var o,r;r=void 0!==n.g?n.g:"undefined"!=typeof window?window:this,o=function(){return function(t){"use strict";var e={navClass:"active",contentClass:"active",nested:!1,nestedClass:"active",offset:0,reflow:!1,events:!0},n=function(t,e,n){if(n.settings.events){var o=new CustomEvent(t,{bub
    likely benign LLM, confidence 0.95 Minified Furo documentation theme script.
    Reasoning

    Minified Furo theme JavaScript for Sphinx docs; navigation and event code, no suspicious behavior shown.

  6. info warn → info by review dynamic-attribute google/genai/__init__.py:51:5

    reach-by-name through `globals` (ast pass, confidence 0.60)

        module = importlib.import_module(f'.{name}', __name__)
        globals()[name] = module
        return module
      raise AttributeError(f'module {__name__!r} has no attribute {name!r}')
    likely benign LLM, confidence 0.90 Lazy submodule import via module-level __getattr__ caching into globals.
    Reasoning

    Standard lazy-loading module __getattr__ pattern using importlib with a module-local name; common and legitimate in the google-genai SDK.

  7. info warn → info by review frame-introspection google/genai/_replay_api_client.py:211:19

    `inspect.currentframe` — call-stack frame introspection (ast pass, confidence 0.70)

      """Prints the current file path and line number."""
      current_frame = inspect.currentframe()
      if (
          current_frame is not None
    likely benign LLM, confidence 0.90 Helper printing the caller's file path and line number via inspect.currentframe.
    Reasoning

    Frame introspection used to print the current file and line in a replay client helper; a debugging/logging utility, not malicious.

  8. info warn → info by review frame-introspection google/genai/tests/common/test_common.py:53:17

    `inspect.currentframe` — call-stack frame introspection (ast pass, confidence 0.70)

      with warnings.catch_warnings(record=True) as captured_warnings:
        call_line = inspect.currentframe().f_lineno + 1
        func()
    likely benign LLM, confidence 0.92 Test code using currentframe to record the call line for warning assertions.
    Reasoning

    Test helper capturing the call line to assert warning locations; ordinary test utility.

  9. info warn → info by review encoding-hex google/genai/tests/models/test_compute_tokens.py:84:69

    16 consecutive `\xNN` escapes (entropy 3.8 bits/byte) (raw pass, confidence 0.65)

            decoded_tokens
            == b'\xe8\xbf\x99\xe6\x98\xaf\xe4\xb8\x80\xe6\x9d\xa1unicode\xe6\xb5\x8b\xe8\xaf\x95\xf0\x9f\xa4\xaa\xe2\x9d\xa4\xe2\x98\x85'
        )
        assert decoded_tokens.decode('utf-8') == _UNICODE_STRING
    likely benign LLM, confidence 0.93 UTF-8 byte literal used as expected output in a tokenizer unicode test.
    Reasoning

    Hex escapes encode UTF-8 test strings (Chinese text, emoji) for a tokenizer unicode round-trip test; expected test data.

  10. info warn → info by review payload-bytes-literal google/genai/tests/transformers/test_bytes.py:8:5

    concatenated bytes literal contains 35 `\xNN` escapes (92% of content) — binary payload shape (ast pass, confidence 0.85)

    _RAW_BYTES = (
        b'\xfb\xf6\x9bq\xd7\x9f\x82\x18\xa3\x92Y\xa7\xa2\x9a\xab\xb2\xdb\xaf\xc3\x1c\xb3\x00\x10\x83\x10Q\x87'
        b' \x92\x8b0\xd3\x8fA\x14\x93QU\x97a\x9d5\xdb~9\xeb\xbf='
    )
    likely benign LLM, confidence 0.85 Random binary test fixture bytes for transformer tests.
    Reasoning

    Binary bytes fixture for testing bytes transformers in the SDK tests; the payload is test data and is not executed or decoded into anything dangerous.

  11. info warn → info by review payload-bytes-literal google/genai/tests/types/test_bytes_internal.py:36:5

    concatenated bytes literal contains 35 `\xNN` escapes (92% of content) — binary payload shape (ast pass, confidence 0.85)

    _RAW_BYTES = (
        b'\xfb\xf6\x9bq\xd7\x9f\x82\x18\xa3\x92Y\xa7\xa2\x9a\xab\xb2\xdb\xaf\xc3\x1c\xb3\x00\x10\x83\x10Q\x87'
        b' \x92\x8b0\xd3\x8fA\x14\x93QU\x97a\x9d5\xdb~9\xeb\xbf='
    )
    likely benign LLM, confidence 0.85 Binary test fixture for internal bytes type tests.
    Reasoning

    Same binary test fixture as in other test files, used to exercise bytes handling; no execution path.

  12. info warn → info by review payload-bytes-literal google/genai/tests/types/test_bytes_type.py:30:5

    concatenated bytes literal contains 35 `\xNN` escapes (92% of content) — binary payload shape (ast pass, confidence 0.85)

    _RAW_BYTES = (
        b'\xfb\xf6\x9bq\xd7\x9f\x82\x18\xa3\x92Y\xa7\xa2\x9a\xab\xb2\xdb\xaf\xc3\x1c\xb3\x00\x10\x83\x10Q\x87'
        b' \x92\x8b0\xd3\x8fA\x14\x93QU\x97a\x9d5\xdb~9\xeb\xbf='
    )
    likely benign LLM, confidence 0.85 Binary test fixture for bytes type tests.
    Reasoning

    Binary test fixture for bytes type tests; benign test data with no execution.

  13. info warn → info by review dynamic-attribute google/genai/types.py:83:7

    reach-by-name through `globals` (ast pass, confidence 0.60)

        except ImportError:
          globals()[name] = None
          return None
        globals()[name] = ClientSession
    likely benign LLM, confidence 0.90 Lazy optional import of MCP ClientSession cached into module globals.
    Reasoning

    Lazy optional-import pattern for MCP types that caches None or the imported class into globals; standard optional dependency handling.

  14. info warn → info by review dynamic-attribute google/genai/types.py:85:5

    reach-by-name through `globals` (ast pass, confidence 0.60)

          return None
        globals()[name] = ClientSession
        return ClientSession
      if name == 'McpCallToolResult':
    likely benign LLM, confidence 0.90 Lazy optional import of ClientSession via globals assignment.
    Reasoning

    Same lazy optional-dependency pattern returning ClientSession; no dynamic code execution or obfuscation.

  15. info warn → info by review dynamic-attribute google/genai/types.py:91:7

    reach-by-name through `globals` (ast pass, confidence 0.60)

        except ImportError:
          globals()[name] = None
          return None
        globals()[name] = CallToolResult
    likely benign LLM, confidence 0.90 Lazy optional import of CallToolResult cached into globals.
    Reasoning

    Lazy optional-import of MCP CallToolResult with globals caching; standard pattern.

  16. info warn → info by review dynamic-attribute google/genai/types.py:93:5

    reach-by-name through `globals` (ast pass, confidence 0.60)

          return None
        globals()[name] = CallToolResult
        return CallToolResult
      if name == 'mcp_types':
    likely benign LLM, confidence 0.90 Lazy import of CallToolResult via module globals.
    Reasoning

    Same lazy import pattern for CallToolResult; benign module attribute resolution.

  17. info warn → info by review dynamic-attribute google/genai/types.py:99:7

    reach-by-name through `globals` (ast pass, confidence 0.60)

        except ImportError:
          globals()[name] = None
          return None
        globals()[name] = mcp_types
    likely benign LLM, confidence 0.90 Caches an optional mcp_types module (or None on ImportError) into module globals inside a lazy __getattr__ helper.
    Reasoning

    The snippet is a lazy-import pattern inside a module-level __getattr__: when the optional mcp import fails, the name is cached as None in globals(), and on success the imported module is cached the same way. The raw attribute name is only used as a cache key, and the fallback raises AttributeError as normal. This is a common idiom for deferred optional dependencies, not obfuscation or a hidden execution path.

  18. info warn → info by review dynamic-attribute google/genai/types.py:101:5

    reach-by-name through `globals` (ast pass, confidence 0.60)

          return None
        globals()[name] = mcp_types
        return mcp_types
      raise AttributeError(f'module {__name__!r} has no attribute {name!r}')
    likely benign LLM, confidence 0.90 Returns and caches the lazily imported mcp_types module, otherwise raising AttributeError for unknown attributes.
    Reasoning

    This is the same lazy-import function as the previous finding. It caches the successfully imported mcp_types module in globals() and returns it, then raises AttributeError for unknown names. The dynamic globals write is limited to a known optional module and does not execute attacker-controlled input.

  19. info high-complexity google/genai/types.py:829:6

    compression ratio 0.881 is >2σ above file mean 0.682 (raw pass, confidence 0.50)

      REGEX_CONTAINS = 'REGEX_CONTAINS'
      """Equivalent to [GoogleSQL](https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#regexp_contains) `REGEX_CONTAINS(target, expression)`."""
      PARTIAL_MATCH = 'PARTIAL_MATCH'
  20. info high-complexity google/genai/types.py:15191:22

    compression ratio 0.824 is >2σ above file mean 0.682 (raw pass, confidence 0.50)

          default=None,
          description="""Required. BigQuery URI to a table, up to 2000 characters long. Accepted forms: * BigQuery path. For example: `bq://projectId.bqDatasetId.bqTableId`.""",
      )
  21. info high-complexity google/genai/types.py:15202:6

    compression ratio 0.824 is >2σ above file mean 0.682 (raw pass, confidence 0.50)

      input_uri: Optional[str]
      """Required. BigQuery URI to a table, up to 2000 characters long. Accepted forms: * BigQuery path. For example: `bq://projectId.bqDatasetId.bqTableId`."""

Reproduce This Scan

Run disclude locally to verify. Add --format sarif for SARIF output. Add --llm (with an API key in the environment) to include the LLM review.

cargo install disclude --version 4.0.0
git clone https://github.com/googleapis/python-genai python-genai && cd python-genai
git checkout v2.31.0
disclude scan --severity info --diff v2.30.1 .