typeguard 4.6.1
- Source
- https://github.com/agronholm/typeguard
- Artifact scanned
typeguard-4.6.1-py3-none-any.whl- Compared with
typeguard-4.6.0-py3-none-any.whl(0 signals introduced since)- Files
- 14 scanned, 5 skipped (binary, oversized, or unrecognised)
- Signals
- 0 critical · 0 warn · 5 info
- Scan time
- 5.0 s
- LLM review
- Reviewed by claude-haiku-5-5 (Anthropic): 5 of 5 warn and critical signals; 5 demoted to info.
- Disclude version
- 4.3.0
- Scanned (UTC)
- 2026-11-20 01:58
Signals
Ordered by severity, then signals introduced in this release. Hidden characters are shown as ⟨U+…⟩.
-
= =likely benign Compiles an instrumented AST of a decorated function so typeguard can inject runtime type checks.Reasoning
The snippet is typeguard's decorator instrumentation: it compiles an AST it has rewritten to inject type checks into a function, then extracts the target function's code object. The file is a well-known type-checking library, and this is its normal mechanism. The non-literal compile is expected here and shows no obfuscation or hidden payload.
-
# Create a new closure and find values for the new free variables = = = .likely benign Reads caller frame locals to rebuild a closure's free variables for typeguard's instrumented function.Reasoning
The code walks up the call stack to read the caller's local variables so it can resolve free variables for the rebuilt closure. This is standard instrumentation for a decorator that recreates a function. The 'anti-analysis' label comes from the heuristic that a sys.exit/exec/eval appears in the same file. Nothing in the snippet is evasive or malicious, and the file is a legitimate type-checking library.
-
= =likely benign Reads the caller's frame globals and locals to build a type-check memo for annotation resolution.Reasoning
typeguard's check_type-style helpers use sys._getframe(1) to take the caller's globals and locals for resolving forward references in type annotations. This is the documented way to do that, and the snippet has no network, exec, or encoded payload.
-
# supported in all python implementations = = =likely benign Fetches the caller's frame and locals to find the enclosing function for type validation.Reasoning
This is the same caller-frame lookup pattern used by typeguard's runtime checking functions. It resolves the calling function and its locals to validate the enclosing call's types. It is a legitimate use of frame introspection in a type-checking library.
-
# supported in all python implementations = = =likely benign Takes the caller's frame globals and locals to construct a type-check memo.Reasoning
Same pattern: sys._getframe(1) to get the caller's globals and locals for constructing a TypeCheckMemo. This is typical of a runtime type checker and nothing in the snippet suggests malicious intent.
Reproduce This Scan
Run disclude locally to verify. These commands scan the published file; the "new in this release" marks come from comparing it with the previous release's file, which they don't repeat. Add --format sarif for SARIF output. Add --llm (with an API key in the environment) to include the LLM review.
|