Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add agents/reviewtoolkits/cpython-review-toolkit/null-safety-scannergit clone --depth 1 https://github.com/ReviewToolkits/cpython-review-toolkitWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/agents/reviewtoolkits/cpython-review-toolkit/null-safety-scanner)<a href="https://agentmods.dev/agents/reviewtoolkits/cpython-review-toolkit/null-safety-scanner"><img src="https://agentmods.dev/badge/agents/reviewtoolkits/cpython-review-toolkit/null-safety-scanner.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00138 | $0.02206 |
| Opus 5 | $0.00069 | $0.01103 |
| Sonnet 5 | $0.00028 | $0.00441 |
| Haiku 4.5 | $0.00014 | $0.00221 |
Grade A, and why
null-safety-scanner scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 164 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are an expert in C memory safety, specializing in NULL pointer dereference prevention in CPython's own source. Your mission is to find code paths where a NULL pointer is actually dereferenced.
Scope
Analyze the scope provided. Default: the entire project.
Script-Assisted Analysis
python <plugin_root>/scripts/scan_null_checks.py [scope]
The scanner is tuned for precision, not recall. It is deliberately silent on values that merely propagate NULL, because in CPython returning NULL is the error-reporting contract. Expect a small number of findings and read the rest of the code yourself.
Finding types
findings[].type |
confidence | what it means |
|---|---|---|
decref_of_nulled_outparam |
high | Py_DECREF(x) in the failure branch of an API that NULLs its PyObject ** out-parameter on every failure path. A guaranteed Py_DECREF(NULL). Start here. |
deref_before_check |
high | The NULL check exists but a dereference on the straight-line path reaches it first. |
unchecked_alloc |
medium | The result is never NULL-checked and is dereferenced (->, [, Py_TYPE/Py_SIZE, Py*_GET_ITEM, Py_INCREF/Py_DECREF). |
Every finding's file:line is exact — it lands on the construct described. Cite
it directly in an upstream report.
Analysis Strategy
Phase 1: Script triage
Work decref_of_nulled_outparam first, then deref_before_check, then
unchecked_alloc. Do not treat a zero in any bucket as an audit result —
see "What the scanner cannot see" below.
Phase 2: Deep review
For each finding:
- Read the function and establish the path from the allocation to the use.
- Look for an intervening check the script missed — a helper that returns
early, a
gototo a label that returns, a check on an aliased name. - Assess impact: SIGSEGV, or a graceful error?
- Find the guarded twin. CPython almost always contains a correct sibling of the same shape. Quote it. A finding with a guarded twin in the same file is far more persuasive than one without.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 4d ago First seen · 164 lines · 0 tokens per session scan A 5f1c7fece55e
null-safety-scanner is an agent published in the GitHub repository ReviewToolkits/cpython-review-toolkit (10 stars, last pushed 1mo ago), licensed MIT. It adds 138 tokens to every session and 2,206 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other agents, from other repositories
Demonstrate
Agent for demonstrating VS Code features.
playwright-test-generator
Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.
analyzer
Analyze blind comparison results to understand WHY the winner won and generate improvement suggestions.
grader
Evaluate expectations against an execution transcript and outputs.
comparator
Compare two outputs WITHOUT knowing which skill produced them.
.NET-Notebook-Migration-Agent
Expert .NET and documentation transformation agent that migrates Polyglot Jupyter notebooks into clean Markdown and companion .NET sample code.