Skip to content

v0.32.0

Latest

Choose a tag to compare

@carrollco carrollco released this 03 Dec 16:10

In v0.31.0 the Python client read a daemon's answers with the standard library's HTTP reader, which is lenient: a body cut short after a clean close could come back as a result, and an error answer cut short kept its not-dispatched mark in the Python and Go clients, which reads as "safe to send again". The client's asyncio face ran its calls on the event loop's default thread pool, min(32, CPUs + 4) threads shared with the whole application, so past that many calls waited with nothing saying so. And the grant broker checked a JSON body on a route with a raised body limit while streaming it to the API, so a refused body had already reached the API in part, while on ordinary routes it read only a body's first JSON value. In this release the Python client reads every answer through one strict reader built on h11, its first dependency; a cut answer is an error in all three clients and its mark is not believed; the asyncio calls run on a pool of the client's own, 100 threads; and the broker reads every JSON body whole, at most 32 MiB of it, and checks every top-level value before anything reaches the API. It breaks things: the Python client needs h11 and refuses some answers it used to read, the TypeScript client needs Node 22.23.0, 24.17.0, 26.2.0 or later or a fetch of your own, a JSON body over 32 MiB on a raised route is refused, and some JSON bodies that passed before are refused on every route. The protocol (9) and the record version (6) did not change. Read the first section before upgrading.

Version: v0.32.0.

Changes that break an existing setup

The Python client has its first dependency: h11>=0.16.0. h11 is a small HTTP/1.1 library with no dependencies of its own, and the client now reads every answer of a daemon with it (h11 (EXTERNAL · official docs ↗)). pip install plimsoll-client brings it, and so does every framework kit that installs the client. 0.16.0 is the floor because it is the release that fixed h11's one security advisory (CVE-2025-43859) and the floor httpcore (under httpx) already sets, so the client never makes an install beside httpx impossible; there is no ceiling, so a later h11 fix reaches you without a plimsoll release. h11 is loaded at the first call: importing plimsoll_client, the record checks and the answer-key tripwire still need the standard library alone. An install made with pip install --no-deps, or a checkout run with PYTHONPATH, must add h11 itself: without it the package imports, and the first call fails with a TransportError marked not dispatched (reason environment) that names the package to install (Python client).

The Python client refuses answers it used to read. One reader now reads every answer, on h11, under rules narrower than HTTP's: a daemon answers one request per connection, in HTTP/1.1, with a body whose length is stated or sent in chunks. A plimsoll daemon's answers pass unchanged. Refused, by kind, as MalformedResponseError unless the line says otherwise. None of these is marked not dispatched, so each reads "the call may have run":

  • a version other than HTTP/1.1 (an HTTP/1.0 answer was read before);
  • an answer with neither a Content-Length nor Transfer-Encoding: chunked, whose only end is the connection closing, and one with both;
  • Content-Length values that disagree (the first was taken before), or one that is not plain digits (+2 was read to the close);
  • a transfer coding other than exactly chunked (gzip, chunked came back as the raw chunk text), a malformed chunk (the shape of CVE-2025-43859), and trailers after the last chunk;
  • any 1xx answer (a 100 was skipped before, and a 103 was taken for the answer), and status 204, 205 or 304;
  • a Content-Encoding other than identity;
  • a header block or a chunk-size line over 16 KiB;
  • bytes that arrived after the end of the answer, with its last byte;
  • an answer that ends before its stated length or its last chunk: refused as cut short, a TransportError (under Fixes).

Before its first request the client also reads 17 known answers through the installed h11, once per process, and makes no call, marked not dispatched (environment), if any is read otherwise than by the h11 release the client was tested with. What to do: nothing, against a plimsoll daemon. Something between the client and the daemon that answers in HTTP/1.0, ends an answer by closing the connection, or sends 103 Early Hints now fails every call. A stand-in server written for tests must answer in HTTP/1.1 with a Content-Length or in chunks: Python's http.server answers in HTTP/1.0 unless its handler sets protocol_version = "HTTP/1.1" (Python client, "Every answer's framing" and "Limits"). Why: http.client accepted conflicting lengths, a +2 length, a transfer coding it does not decode and the malformed chunk of a known advisory. Measured through the whole transport, 101 of 182 runs of 92 hand-written answers reached a caller as something other than what the HTTP rule each is written from gives; all 182 now give the reader's verdict. No exploit was known, since the peer is the operator's own daemon.

The TypeScript client needs Node 22.23.0 or later on 22, 24.17.0 or later on 24, or 26.2.0 or later, unless you pass your own fetch. The package's engines is now ^22.23.0 || ^24.17.0 || >=26.2.0; it was >=22.18. Node's own fetch in earlier releases (the undici it bundles, before 6.26.0, 7.26.0 and 8.3.0) reads a chunked answer that ends before its last chunk as whole when the answer says it will close the connection (nodejs/undici#5273 (EXTERNAL · source repo ↗)). The client sees no chunked framing through fetch, so on those releases it could not tell a cut answer from a whole one, and believed a mark that nothing ran on an answer it never fully got: 5 of the 23 shared cut answers on Node 22.18.0 and 22.22.3. Now, on such a Node, new PlimsollClient(...) without a fetch option throws a PlimsollError with code failed_precondition, sends nothing, and says which Node and undici it found and what to do. A CodeSandboxes given a function that builds the client throws it at the first call. The client decides by the undici version Node states (process.versions.undici), or by Node's own version when there is none. It does not check outside Node (no process.versions.node, or Bun or Deno), and it does not check a fetch you pass. What to do: upgrade Node; or, to stay on your Node, pass the undici package's fetch (6.26.0, 7.26.0, 8.3.0 or later) as the fetch option (TypeScript client). npm warns about an install outside engines and goes ahead unless engine-strict is set, so the error at construction is what stops an affected Node.

Grant broker: a JSON body over 32 MiB on a route with a raised limit is refused with 413. A grant profile can raise a route's body limit for uploads (route_max_request_bytes). Until this release a JSON body on such a route was passed through to the API as it arrived, whatever its size up to the route's limit. Now a body sent as JSON is read whole on every route, at most 32 MiB of it: one over 32 MiB is refused with 413 and X-Should-Retry: false, before a byte is read when its length is declared and at the byte past 32 MiB when it is not, and is never passed on unread. Why 32 MiB: it is the largest JSON request three cloud platforms take for a chat completion (20, 30 and 32 MB). What to do: send a larger file as multipart on a route that takes it (route_content_types); bodies that are not JSON are still passed through as before (capability grants).

Grant broker: a JSON body on a raised route is read whole before it is sent, and that changes four things.

  • It is charged to the run's max_request_bytes before a byte is read: its declared length, or, when it declares none (sent in chunks), the lower of 32 MiB and the route's limit until it has arrived. A body with no declared length is therefore refused with 413, "host api request bytes for this run are exhausted", when less than that is left of the run's total, even if the body itself is small. Declare the length to avoid it.
  • It must arrive whole within the call's limit of 60 seconds, or the call is refused with 408. A slow upload of JSON that took longer used to pass while it kept arriving.
  • A run checks one JSON body over 1 MiB at a time; another waits for it. Reading JSON costs the daemon about 8 times the body while it checks one.
  • It is sent to the API with its length, a body that arrived in chunks too.

Grant broker: JSON bodies that passed a first-value check are refused on every route. On routes at the default 1 MiB limit the broker read only a body's first JSON value and ignored the rest. It now reads every top-level value, as the streaming check on raised routes already did. Refused with 400: text after a value ({"a":1} x, {"a":1}}, {"a":1},{"b":2}), two values with nothing between them ({}{}), and white space JSON does not allow (a body of a no-break space). Refused with 403: a later value whose top-level object names _method. Still sent: several values separated by white space (JSON Lines, one value per line), and a body of only white space or only a byte order mark, which holds no value. What to do: send one JSON value, or values separated by white space.

Grant broker: 400, not 403, for a body that names _method and is also not JSON. The broker checks whether each value is JSON before it reads that value's keys, so a body that is both is refused with 400 on every route. On a raised route it answered 403 or 400, whichever the streaming check met first; routes at the default limit already answered 400. A guest that tells the two apart by status sees the change. Measured over 2,000,154 bodies against the check it replaces: no body passes that was refused or is refused that passed, and 64,872 refused with 403 before are refused with 400 now.

New

plimsoll_client.aio.set_max_threads(n) and plimsoll_client.aio.shutdown_threads(), with DEFAULT_MAX_THREADS (100). The asyncio faces now run their calls on a thread pool of the client's own (under Changed). set_max_threads(n) sets how many calls run at once in the process; call it before the first call, since once the pool has threads a different limit raises RuntimeError until shutdown_threads(). A value that is not a positive integer raises ValueError. shutdown_threads() ends the pool's threads and returns once none is left: it waits for the calls running and the calls waiting, so call it once your calls have returned, not from the event loop's own thread while calls are in flight. A later call starts the pool again (Python client).

Changed

  • The Python client's asyncio calls run on a pool of the client's own, 100 threads. AsyncClient, AsyncSession and the framework adapters' async paths (OpenAI Agents sandbox, Agent Framework, the Anthropic worker, verifiers, PydanticAI) ran each blocking call through asyncio.to_thread, the event loop's default executor: min(32, CPUs + 4) threads shared with everything in the process, so the client's calls waited behind the application's thread work, held it up in turn, and past that number waited with nothing saying so (28 of 100 calls awaited together were in flight on a 24-processor machine). Now one pool serves the process and every event loop in it, its threads named plimsoll-client_N. Why 100: a thread holds one connection to the daemon, and 100 is the number of connections httpx and aiohttp each hold at once by default. A call past the limit waits for a free thread, in order, with nothing raised; its request_timeout starts when its thread does, and cancelling it while it waits sends nothing. The context variables of the caller reach the thread, as with asyncio.to_thread.
  • asyncio.run no longer waits at its end for a client call still in its thread. asyncio.run waits for its loop's default executor as it closes, and the client's calls are no longer on it. A call still running in a thread when asyncio.run returns (one whose request was already sent when its task was cancelled, or a session open finishing after a cancel) goes on, and the interpreter waits for it at exit; idle threads stay for the next call and end at exit. Call shutdown_threads() to wait for them sooner.
  • A forked child starts a thread pool of its own at its first call, and fresh locks for the h11 check and the name lookup, so a fork while another thread is in a call does not leave the child's calls waiting for that thread (the synchronous client too; under Fixes).
  • The Python client no longer raises the http.client.connect audit event, since it no longer uses http.client; the standard library's socket.connect and socket.getaddrinfo events still fire for each call. An audit hook that watched for http.client.connect must watch those.
  • A request the Python client cannot write (a host that no Host field can hold) is refused before any name lookup or connect, marked not dispatched (environment); it failed at the lookup before, with the same mark. The request the client writes is otherwise byte for byte the one it wrote, now in one write instead of two.
  • No public name of the Python client changes apart from the three in plimsoll_client.aio under New: no class, function, signature, field or error class is removed or renamed, and the not-dispatched mark means what it meant. The calls the Google ADK adapter uses are unchanged.
  • Grant broker: a refused JSON body never reaches the API, on any route. On a raised route a refused body used to be refused while its request was under way: the API had received the request's headers and the pieces before the refused one, the call spent its route_max_calls and wrote a call row. Now every JSON body is checked before the request is built, so the API receives nothing of a refused one, not even its headers; the call counts as denied, spends no route_max_calls, writes no call row and keeps none of the run's max_request_bytes. Under Security fixes too.
  • Operators: a run that sends large JSON holds more memory in the daemon. On a profile that raises a route, a run can hold its JSON bodies in flight, never more than its max_request_bytes and at most 16 calls of 32 MiB, each half again while its buffer grows, plus one check of up to 256 MiB: about 640 MiB with the default total of 256 MiB, 1 GiB at most, times the runs in flight. On routes at the default 1 MiB limit a run holds at most 24 MiB of bodies, and 128 MiB more if all 16 are checked at once. The daemon's resident memory can stand at up to about twice these figures, since Go's garbage collector lets the heap grow past what is live before it reclaims. Size the daemon's memory for it, or lower max_request_bytes on profiles that raise a route (limitations).

Fixes

  • Python client: an answer cut short came back as a result. A body shorter than its stated Content-Length after a clean close was handed over as the result when what arrived happened to parse, and the close after a chunked body's last chunk was taken for the empty line that ends it; with the daemon silent there, the caller got the result or a timeout by a race. Every answer that ends before its stated length or its last chunk is now a TransportError with no not-dispatched mark, at once when the peer has closed, and a timeout at the deadline when it stays silent. Affected: released versions.

  • A not-dispatched mark is no longer believed on a cut answer, in all three clients. The mark says nothing ran, so a caller may send the call again; an error answer whose body ended before its framing said it would is not the answer the daemon wrote, and the call may have run. Every official client now returns such an answer as an error with no mark (code unavailable, or the caller's own cancellation or deadline when that ended the read), whatever the Plimsoll-Not-Dispatched header or the part of the body that arrived says (run results). The three clients answer 23 shared cut-answer cases, and the same answers whole keep their mark.

    • Python: an error answer cut short kept the mark its header or its details stated. Affected: released versions.
    • Go: a cut error answer kept its header's mark, since connect-go reads a failed read of an error body as a body that is not a Connect error and keeps the status. The client now reads an error answer's body to its end before believing anything it says. An error answer over the 32 MiB response cap is resource_exhausted with no mark. And a 200 whose body read failed is never a success, should a caller's own HTTP client drop the failure (data_loss). Affected: released versions.
    • TypeScript: Node's own fetch fails the read of a cut body from Node 22.23.0, 24.17.0 and 26.2.0, and the client now refuses an earlier Node's own fetch (under Changes that break an existing setup); on Node 22.18.0 to 22.22.x, 24 before 24.17.0 and 26 before 26.2.0 it believed the mark on a cut chunked answer that said it would close. A fetch the caller passes in may end a body without an error, so the client now holds a single digits-only Content-Length to the bytes read, on an answer with no content coding. A chunked body such a fetch ends short without an error stays undetectable (Known limits). Affected: released versions, on those Node releases or with a caller's own fetch.
  • Grant broker: a call refused before it reached the API kept its body's bytes charged. When a route's route_max_calls was spent, a credential could not be renewed or the grant ended, a body the broker had read whole stayed charged to the run's max_request_bytes, so a run could spend its own total with calls that never reached the API. A body now counts once its request goes to the API. Affected: released versions, for bodies within the default limit.

  • Python client: a child process forked while another thread was in a call could wait forever. A child forked while another thread held the name lookup's lock waited for it on its first call, before the call's deadline existed, and started with the parent's count of abandoned lookups, whose threads it does not have. The child now gets fresh locks and a count of none. Affected: released versions, for a fork in that short window.

Security fixes

Released versions are affected unless a line says otherwise.

  • On a raised route, the API could act on a JSON body the broker refused. The broker refused a passed-through body while its request was under way, after the request's headers went (an API's handler runs on them) and after the pieces before the refused one (a JSON decoder returns at the first value's closing brace). The capability grants page stated this as a limit. A refused JSON body now never reaches the API (under Changed).
  • On routes at the default limit, a JSON body's later top-level values were not checked for _method. A body such as {"a":1} {"_method":"DELETE"} reached the API, although the page said a body naming _method is refused. No framework is known to take _method from a second value, so this was an open door rather than a known way past the check. Every top-level value is now read (the breaking section).

Found and fixed before release, so no released version is affected (each with a test that fails on the code before its fix):

  • The broker's new whole-body check, as first written, built a JSON decoder for every top-level object: 32 MiB of {} took 1.93 seconds and allocated 9.93 GB. It now reads a body with two decoders, each once: 0.50 seconds and 4.9 KB for the same body. A call waiting for the run's one large check also kept waiting after its own context or the run's grant ended, and its check ran later; it is now answered 503 at once.
  • A JSON body on a raised route whose last read ended after the 60-second limit was accepted, because that read reported the end of the body; the limit is now checked on that read too (408).
  • For JSON over 1 MiB on a raised route, the whole-body path kept a refused call's charge, where the streaming path it replaced settled it on close (the Fixes line above covers the rest).
  • The broker's body buffer grew as Go's append does, so a body of 32 MiB cost 3 times its size to read; it now doubles to the limit, 2 times in all.
  • The Python client's refusal of an answer h11 rejects quoted h11's words and the bytes h11 quoted after them, which a responder could fill with the token it was sent; the refusal now keeps h11's words for what it refused and none of the answer's bytes.
  • A failed h11 check raised one stored exception again at every call, and a raised exception keeps the frames it passed through, so each failed call's request stayed alive for the life of the process; it now raises a fresh copy. A child forked while another thread ran the h11 check waited forever on its lock; it now gets a fresh one.

Mixed versions

  • The protocol number stays 9 and the record version 6. A v0.32.0 daemon serves v0.31.0 clients, and a v0.32.0 client talks to a v0.31.0 daemon. Every daemon change is in the grant broker, which serves calls from inside the sandbox, so what a client is answered is unchanged. The Python client's stricter reader passes a plimsoll daemon's answers: it was run against a v0.31.0 daemon on docker (describe, a snippet, a project, a session with file calls, refusals and the largest answer that daemon gives), and the v0.31.0 Python client against this release's daemon the same way, every answer read as a result or the daemon's own refusal.
  • A verifier of either release checks the other's records: no digest changed.
  • The helper's file contract stays 9 and docker/ did not change, so v0.31.0's images serve this release: no make docker-images is needed.
  • The framework kits and the TypeScript client carry the same version as the client, as before; each kit that installs plimsoll-client 0.32.0 brings h11 with it.

Pages that now say what they did not

  • Capability grants: a JSON body read whole on every route, the 32 MiB ceiling and why, the charge before the read, the 60-second limit, one large check at a time, every top-level value read, the 400 for a body both not JSON and naming _method, a refused body that reaches nothing, and a refused call that gives its bytes back.
  • Limitations: the ceiling, and the most memory a run's JSON bodies can hold in the daemon.
  • Run results: an error answer cut short is believed in nothing.
  • Python client: its one dependency, the thread pool and its limit, shutdown and fork, every answer's framing, the HTTP/1.1 limit and test stand-ins.
  • Releasing: the h11 pin and the weekly h11 job. Google ADK: the base client's one package. The integrations and dependencies trainers name h11.

For contributors

  • The Python suite runs in tmp/py-client, a virtual environment make py-client builds from clients/python/gate-requirements.txt, which pins h11 0.16.0 with its hashes; the first build downloads it.
  • make audit runs make py-vuln, which asks the package index for advisories against the releases that file pins, so the gate now reads the network.
  • The weekly newest-frameworks.yml workflow gains an h11 job: the raw-answer cases, through the reader and through the transport, on the newest h11 release, failing when that is not the pinned one. make py-newest-h11 py-newest-h11-suite py-newest-h11-locked is the same run by hand, in a throwaway container or machine.
  • clients/python/tests/data/raw_answers.json holds 92 raw-answer cases, each with the HTTP rule its verdict is written from; eight state why h11's reading differs from the grammar's.
  • The TypeScript suites run in CI on Node 22.23.5 (the Makefile's NODE_VERSION, which was 22.18.0). PLIMSOLL_TS_CALLER_FETCH=1 go test ./clients/typescript/ runs them with the undici package's fetch given to every client built without one; undici is a dev dependency for that and is not installed with the package.
  • The shared client cases gain 23 cut answers, served by a daemon stand-in that cuts them (internal/clientsuite/cut.go); the Python client's refusal of a whole chunked answer with a trailer is a stated design difference.
  • TestJSONCheckKeepsTheScannersVerdicts holds the broker's JSON rule to the removed streaming check's verdicts on 20,145 bodies.
  • Session registry tests: the idle timer behind a test seam, tombstone removal, many sessions due at once, and a docker test of the daemon's idle suspend against a real pause. No behavior change.
  • CI's actions/setup-go moved from 7.0.0 to 7.1.0, pinned by commit.

Not in this release

  • A native asyncio client: the asyncio faces still run the blocking client in threads.
  • One loop for the daemon's session idle handling in place of a timer per session.
  • Sessions, and so file calls, for agent-sandbox, WSL containers and Docker Cloud: every call there still gets a fresh sandbox.
  • Grants on Docker Cloud.
  • plimsoll's other checks on evaluations (beyond the answer-key tripwire and its canary run).

Known limits

  • Isolation tiers are configuration and provider evidence plus the behavioral startup smoke test, not runtime or hardware proof. No hosted provider was run live for this release. CI runs the docker suite under runc and gVisor and no hosted provider.
  • The Python client was run with h11 on Python 3.12 only, in the local test run and in CI; it supports Python 3.10 and later.
  • Something between a Python client and its daemon that answers in HTTP/1.0, ends answers by closing, or sends 103 Early Hints fails every call. None is known.
  • A chunked answer that a caller's own fetch ends short without an error is not detected by the TypeScript client; such a fetch must fail the read, as Node's does from 22.23.0, 24.17.0 and 26.2.0.
  • The TypeScript client refuses Node's own fetch on Node 22 before 22.23.0, 24 before 24.17.0, 26 before 26.2.0, and on Node 23, 25 and releases before 22; there it runs only with a fetch you pass, such as undici's. Its suites ran on Node 22.23.5 and 26.3.1 with Node's own fetch, and on 22.18.0 with undici 7.30.2's passed in; not on Node 24, Bun or Deno, whose fetch is not checked.
  • A JSON body over 32 MiB cannot go through a grant; a larger file goes as multipart on a route that takes it.
  • Under gVisor on a slow machine, the Agent Framework file store can take longer than the framework's 10-second limit to list a folder tree of 60,000 files: 6.7 to 16.9 seconds on GitHub's runners, 9.3 to 10 seconds on a laptop. This release does not change that path. The release commit's gVisor CI run is red on this test alone.
  • Reading JSON whole costs the daemon memory per run, bounded as stated under Changed and in limitations.
  • Form and multipart bodies are still forwarded unread, so on an API that honors method override such a body can make a granted method run as another on the same path (limitations).

A signed record protects recorded statements from unnoticed changes. It does not prove that code is correct or safe. Isolation tiers describe configuration and provider evidence plus startup checks, not hardware proof.