uninit-dealloc-and-init-bypass

uninit-dealloc-and-init-bypass is an agent for coding agents from ReviewToolkits/cpython-review-toolkit. It costs 0 tokens per session (5,018 once invoked), scanned A, original, MIT.

An agent report about checks for uninitialized objects being freed and object initialization being bypassed in selected CPython modules. CPython is the main implementation of Python.

In plain words
What is it for?
Use it when reviewing modules such as asyncio, elementtree, pickle, csv, datetime, zoneinfo, regular expressions, HMAC, and related code for these two bug patterns.
Why use it?
It records confirmed problems and test evidence so maintainers can investigate crashes caused by invalid object state.

Agent

Install

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.

agentmods
npx agentmods add agents/reviewtoolkits/cpython-review-toolkit/uninit-dealloc-and-init-bypass
Clone the repo
git clone --depth 1 https://github.com/ReviewToolkits/cpython-review-toolkit

Wrote 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.

agentmods badge for uninit-dealloc-and-init-bypass

README.md
[![agentmods](https://agentmods.dev/badge/agents/reviewtoolkits/cpython-review-toolkit/uninit-dealloc-and-init-bypass.svg)](https://agentmods.dev/agents/reviewtoolkits/cpython-review-toolkit/uninit-dealloc-and-init-bypass)
Your own site
<a href="https://agentmods.dev/agents/reviewtoolkits/cpython-review-toolkit/uninit-dealloc-and-init-bypass"><img src="https://agentmods.dev/badge/agents/reviewtoolkits/cpython-review-toolkit/uninit-dealloc-and-init-bypass.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 5,018 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.05018
Opus 5 $0.00000 $0.02509
Sonnet 5 $0.00000 $0.01004
Haiku 4.5 $0.00000 $0.00502

Measured 5d ago against content hash 5b79ef53d29a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

uninit-dealloc-and-init-bypass 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 5d 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.

reports/modules-sample-informed-v1/agents/uninit-dealloc-and-init-bypass.md · 307 lines

How it starts

The opening of the file, as written. The whole thing — 307 lines — stays where its author put it; the contents beside it link to each section on GitHub.

uninit-dealloc + init-bypass — Modules/ sample (informed)

Toolkit v0.8.0. Target /home/danzin/projects/cpython @ 4f3be1b5777 (3.16.0a0). Builds used: /home/danzin/projects/python_build_matrix/builds/{debug,release}-{gil,ft}-nojit[-asan] @ a1d580430c8. Every file cited below is byte-identical between a1d580430c8 and 4f3be1b5777 (git diff --quiet on _elementtree.c, _pickle.c, _csv.c, _datetimemodule.c, _zoneinfo.c, _sre/sre.c, hmacmodule.c, _asynciomodule.c).

Scanner volume

scanner raw (sample) confirmed dismissed precision
scan_uninit_dealloc 1 1 0 100%
scan_init_bypass 0 n/a — denominator 2, see below

Hand-audit added 1 FIX outside the sample (_asynciomodule.c), found by chasing the init-bypass recall gap rather than by either scanner.


Findings

FIX

1. Modules/_asynciomodule.c:2788 · _asyncio_Task_get_context_implnew, reproduced SIGSEGV
static PyObject *
_asyncio_Task_get_context_impl(TaskObj *self)
{
    return Py_NewRef(self->task_context);
}

Task_slots (:2936) wires {Py_tp_init, _asyncio_Task___init__} with {Py_tp_new, PyType_GenericNew}. PyType_GenericNew allocates a zeroed instance and never runs tp_init, so Task.__new__(Task) yields task_context == NULL; task_context is written only in _asyncio_Task___init__ (:2324 / :2329). Py_NewRef(NULL) dereferences ob_refcnt.

Guarded twin — literally the two neighbouring functions. _asyncio_Task_get_coro_impl (:2774) and _asyncio_Task_get_name_impl (:2808) both open with if (self->task_<x>) { ... } Py_RETURN_NONE;. Wider family: 16 sites use ENSURE_FUTURE_ALIVE(state, self) / future_ensure_alive() (:401, :412), which raises RuntimeError("Future object is not initialized.") — that is why every other Task/Future method in the sweep below returned an exception instead of crashing. get_context is the single hole.

Read the full file on GitHub · 307 lines

Changes

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.

  1. 5d ago First seen · 307 lines · 0 tokens per session scan A 5b79ef53d29a

Subscribe to this mod's changes

uninit-dealloc-and-init-bypass is an agent published in the GitHub repository ReviewToolkits/cpython-review-toolkit (10 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 5,018 tokens. 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.