anthropic-sdk-python v2.9.0
- Source
- github.com
- Author
- anthropic-sdks-releaser[bot]Top Viber
- Date

Context
Version 2.9.0 of Anthropic's Python SDK is mostly about its toolset, the ready-made bash, read, write, edit, glob and grep tools a developer runs on their own machine when Claude does work there, as in a self-hosted setup for Claude Managed Agents (release notes). The toolset's documentation states its trust model: the file tools stay inside a working directory plus any allowed roots and are safe without a , while bash can do anything and should run inside one. Several fixes in this release close ways around that boundary, and others stop tools from running for a session that has already ended.
The grep tool runs ripgrep (`rg`) when it is installed, so the release narrows which `rg` it will start. It now passes over an `rg` that resolves to anywhere inside the working directory or an allowed root, whatever the letter case of the names, since those are the directories the agent's own write tool can put files in. It no longer runs an `rg` found through a relative or empty PATH entry or, on Windows, in the current directory, and on Windows it looks only for `rg.exe`, so a file named `rg.cmd`, `rg.bat` or `rg.com` is no longer run. It also ignores ripgrep configuration files, whose options apply to every search; the test for that change sets a configuration adding `--follow`, which would let grep follow a symbolic link out of the working directory, and checks that a secret file on the other side is no longer found. And `rg` no longer receives the process's `ANTHROPIC_*` environment variables. The toolset's code explains why bash already withheld them: a prompt-injected command that prints the API key would otherwise put the credential straight into the session transcript.
The built-in search that grep uses when ripgrep is missing gets two limits. It reads only regular files, because a named pipe or device in the directory could block the search, and the event loop with it, forever, and it stops after 30 seconds of CPU time. Symbolic links are handled more strictly too: listings of /memories leave out links that point outside it, and memory files are read only through the path that was checked.
The session fixes matter to anyone running the SDK's worker for Managed Agents sessions. The EnvironmentWorker now force-stops a terminated session's work right after retrieving the session, before downloading skills or memory stores, and the release notes add that the API reports an archived session as terminated. The session tool runner no longer runs the tool calls of a terminated session thread; a call whose tool was already running when the thread ended is reported with `posted=False` and its result is not posted. A failed download also leaves the existing skill directory in place. Beyond the toolset, Anthropic deprecated seven old beta header values, which the API still accepts but a later SDK release removes. The TypeScript SDK's 1.9.0 carries the same API changes and similar toolset fixes.
- The agent toolset's grep tool now looks for ripgrep only in absolute PATH entries, so it never runs an rg from a relative or empty entry, or from the current directory on Windows, where only rg.exe is accepted.
- grep also passes over any rg that resolves inside workdir or allowed_roots, the directories the file tools can write, and uses the next rg or its built-in search. rg no longer receives the process's ANTHROPIC_* variables.
- The built-in search now reads only regular files, skipping FIFOs and devices that could block it and the event loop forever, and it stops after 30 seconds of CPU time when ripgrep is not installed.
- Seven old beta header values, including prompt-caching-2024-07-31 and -counting-2024-11-01, are deprecated. files-api-2025-04-14 and skills-2025-10-02 select beta response shapes, so their migration guides come before removal.
- AI agent — An AI system that doesn't just answer once but works toward a goal in a loop — taking actions, reading the results, and deciding what to do next.
- sandbox — An isolated environment where AI-generated code or agent actions run without being able to touch anything real.
- agent skill — A reusable instruction file that teaches an agent how to do one job well — the procedure, the tools, and what counts as done.
- token — The chunk of text a model reads and writes in — roughly three-quarters of a word — and the unit AI usage is billed in.
Checking sign-in…
Loading comments…




