Skip to content

1.12.0

Latest

Choose a tag to compare

@cryxnet cryxnet released this 03 Dec 10:48
950a4ae

Fixes from a maintenance review and a security review of every module: the agent and its guardrails and approvals, the MCP server and client, MCPcast, the engine and prompts, memory and caches, observability, and the runtime.

Upgrading from 1.11

  • JWT tokens need exp with AsymmetricJWTAuth and JwksAuth, as with JWTAuth.
  • auth=True without an AuthMiddleware now refuses calls instead of serving them: add AuthMiddleware(...) to a server built with require_auth=True.
  • An MCPcast plan from a URL needs MCPCAST_ALLOW_REMOTE_PLAN=1; a local plan file works as before.
  • The Prometheus endpoint listens on 127.0.0.1: set prometheus_host="0.0.0.0" for a scraper on another host.
  • In a graph with a HumanNode or GuardNode, model routing (route, goto, skip_to) is limited to the node's declared successors.
  • Cross-agent context arrives as a user message marked untrusted, not a system message.
  • Depends() providers run after authentication and guards, not before.
  • Redaction replaces any value under keys such as token, secret or private_key, whatever its type.

Security

  • auth=True was not enforced without an AuthMiddleware in the call's chain -- authentication only happened inside AuthMiddleware, so MCPServer(require_auth=True) with no AuthMiddleware served every tool and resource to anyone; mount() copied a child's auth=True definitions without its AuthMiddleware; and a router included while the server was running got neither its middleware nor its tools' declared limits. An auth=True definition with no identity guard is now refused when the request has no client id, mount() carries the child's AuthMiddleware, and a tool registered while serving gets its own chain.
  • A caller's token could reach a server set to forward_caller_token=False -- forwarding was decided per tool name when tools were discovered, and a server that re-listed its tools could take over a name another server owned. Forwarding is now decided for the server each call goes to, and a re-listed server never takes another server's tool.
  • Values after a JSON escape were not redacted -- a tool that returns a dict is sent as JSON, where \n4111… follows an n and the patterns' word boundary never matched, so card numbers, SSNs, IBANs and tokens in such a result reached the model. Zero-width characters and full-width digits inside a value hid it too. The regex heads now read a view of the text that undoes both.
  • Only a private key's header line was redacted, and PKCS#8, encrypted and PGP keys were not detected. The whole block of any kind is redacted.
  • The input guardrail checked only the last message and could not rewrite ("user", text) pairs, so a secret or a blocked value in an earlier message of the input reached the model. Every user message is checked. astream() now also runs the guards of a Prompt used as instructions.
  • A webhook approval answer of "approved": "false" approved the call -- any non-empty string did. Only JSON true approves.
  • Tools held by a custom graph node skipped the approval gate and the tool-result scan -- PromptNode("act", tools=[...]) in a graph passed as agent_pattern kept its own tool objects. They are wrapped like the agent's tools.
  • load_graph resolved promptise.* references by walking attributes -- promptise.prompts.template:subprocess.os.system gave os.system without allow_imports. Such a reference must name something Promptise defines.
  • Model output could route a run past a HumanNode or GuardNode -- {"route": "wire_money"} or the skip_to action jumped to any node. In a graph with either node the model can only pick a declared successor. SubgraphNode now runs with the parent engine's hooks.
  • With a ContextEngine, a line of user text starting with System: became a system message -- history was passed as text and parsed back line by line. Lines after a message's first are now marked as continuations.
  • Stored memory could leave the memory fence -- sanitize_memory_content stripped each marker once, so nesting one inside another rebuilt it.
  • Semantic cache partitions collided -- : and / in an untenanted user id became _, so google:123 and google_123 shared cached answers. Ids are percent-encoded.
  • An expired in-memory session came back with no owner, so any user could open it. RedisConversationStore treated user_id="" as "all sessions".
  • Redaction missed structured secrets -- a credential key's value was only replaced when it was a string, and keys such as aws_secret_access_key, token, secret or private_key were unknown, so tool arguments reached reports, logs, OTLP and webhooks. Trace files are now created 0600, and webhook URLs are no longer logged.
  • Terminal injection -- ConsoleTransporter, the CLI's tool table and answers, and the runtime dashboard printed text from tools, MCP servers, the model and agent state with its control characters and as Rich markup. It is now printed as plain text.
  • load_url expanded ${ENV_VAR} in a file another host wrote, and its address check missed shared-NAT and multicast ranges. Remote files get no expansion; the request is pinned to the checked public address, without redirects, capped at 1 MB.
  • A spec URL that answered with an MCPcast plan replaced the safety profile, auth mode and base URL -- a plan from a URL now needs MCPCAST_ALLOW_REMOTE_PLAN=1. A POST whose summary started with a query word was classified read, and the evaluation transport matched the decoded path, so a gated call could go live.
  • OpenAPIProvider had no size limits -- $ref inlining grew exponentially, spec downloads and responses were unbounded, and a path value of .. reached another endpoint. A resource template's {param} was percent-decoded after matching, so ..%2Fsecret gave the handler ../secret.
  • Runtime: spawn_process accepted any name -- billing/agent took over the journal of billing_agent, and a NUL byte made inherited blocking hooks fail open. An agent could connect an MCP server under a configured server's name. With concurrency > 1 a new run reset the per-run budget counters of a running one. A secret copied into state was written to disk by a checkpoint after stop().
  • A remote event could claim a trusted trigger's id -- POST /processes/{name}/event on the distributed transport copied trigger_id from the body, and an event from a trusted trigger is handled as the user's own request. Remote events now get a remote: id.
  • Context compaction put older tool results into a system message, unfenced -- a result could give orders with system authority and add rows for calls that never ran. Results are now fenced as data and kept to one line each.
  • Sandbox output was held in host memory without a limit, and a cancelled command kept running. Output is streamed and cut off at 4 MB per stream, read_file refuses files over 4 MB, and a cancelled call kills its command.
  • MCPQueue had no limit on waiting jobs -- one anonymous caller could fill memory and fail the readiness check. New max_pending (10,000) and max_pending_per_client (1,000); the cleanup sweep now reaches every expired job.
  • The runtime journal file was world-readable; it and its directory are now owner-only.
  • promptise validate and promptise agent printed a file's keys with their control characters, and stats tables kept control characters in tool and model names. A cross-agent tree may load at most 64 files.
  • ValidateNode without an output_schema passed on "passes": "false" -- any non-empty string counted as a pass, so a validator used as a gate failed open. Only true passes.
  • An MCP server tool named request_more_tools hid the semantic-selection fallback; the name is now reserved. The MCP server's terminal dashboard printed a token's subject as Rich markup with its control characters, and the cluster health check could give a node its neighbour's result when a node was removed during the check.
  • Depends() providers ran before authentication -- a provider (a database connection, an API client) ran for every call, also one then refused by AuthMiddleware, a rate limit or a guard, and a provider that raised hid the refusal from the audit log. Providers now run when the call reaches the tool; Promptise's own request objects are still set up first.
  • A code-action program could have its answer replaced -- the last RESULT: line wins, so a printed tool result carrying its own RESULT: line became the answer. Each run now uses a marker with a random suffix that only the model sees.
  • Cloud metadata credential requests went through HTTP_PROXY (Entra, GCP), MCPClient.fetch_token put the token response in its error, and paginated */list requests had no end.
  • AsymmetricJWTAuth and JwksAuth accepted a token without exp -- PyJWT checks exp only when the claim is there, so an IdP or signing service that left it out issued a credential that never expired. Both now require exp, like JWTAuth always has.
  • A zstd or brotli response could take gigabytes before MCPcast's size caps refused it -- httpx decodes a whole network read before the size check runs, and one zstd read can inflate to gigabytes (a 2 KB body reached over 250 MB in a test). The spec download, the generated upstream client and the wizard probe now ask for gzip or deflate only and refuse any other Content-Encoding unread. Projects generated from now on carry the check in their own upstream.py.
  • Inlining a spec's $refs had no size limit -- MCPCAST_MAX_SPEC_NODES checked the spec as parsed, but each reference is copied when it is inlined, so a 64 KB spec whose references fan out grew past a gigabyte. Inlining now counts against the same budget. Stripe's spec inlines to about 524,000 nodes and GitHub's to about 171,000, inside the default 2,000,000.
  • The model could raise sandbox_exec's timeout without limit -- the tool's timeout argument replaced SandboxConfig.timeout, so a command could run for days. It can now only shorten the configured timeout.
  • register_batch_tool: a batch could call the batch tool -- each level of nesting multiplied one request's work by up to twice max_parallel. A nested batch call is now refused. Declared rate_limit and max_concurrent already held across batches on a running server; a test now covers that.

Changed

  • Cross-agent context is a user message marked as untrusted, not a system message: the calling model writes it. Broadcast runs each peer once.
  • content_filter and length guards check structured output (a Pydantic model, dict or content blocks) through the text in it.
  • Injection models: any label that is not a known benign one blocks -- JAILBREAK or MALICIOUS never did. NER findings no longer carry the matched text in logs, events or the notice the model reads.
  • WebhookTransporter uses one delivery thread and a bounded queue; dropped batches are counted in dropped.
  • The Prometheus endpoint listens on 127.0.0.1 by default (prometheus_host, new): it has no authentication. Set prometheus_host="0.0.0.0" for a scraper on another host.
  • MCPcast's evaluation sends only GET and HEAD requests to the live API; a POST the classifier calls a search is answered by a mock.
  • OpenAPIProvider(max_response_bytes=...), default 10 MB.

Fixed

  • JWTAuth answered some malformed tokens with INTERNAL_ERROR -- a header or payload that is valid JSON but not an object, or a non-numeric exp or nbf, raised inside the provider and logged a stack trace. These are now authentication errors.
  • A roles claim given as a string was split into letters -- "roles": "admin" became the roles a, d, m, i, n. Roles are now read from a list or a space-separated string, the way scope already was.
  • The code-action tool bridge kept running after a failed or cancelled run -- it polled the cleaned-up sandbox every 30 ms indefinitely. It now stops with the run.
  • A malformed tool request from a code-action program stopped the bridge -- a request file that was not a JSON object, or had a non-string tool name, crashed the bridge, so the program's later tool calls waited until exec_timeout. It is now answered as a call to an unknown tool.
  • MCPcast sent boolean and array path parameters as Python text -- True and ['a', 'b'] went into the URL. They are now true/false and comma-separated, OpenAPI's default style.
  • MCPcast with PyYAML 6.0.4 reported a deeply nested spec with a different message -- 6.0.4 stops deep nesting in its scanner. The spec was still refused; the message is now the same "nested too deeply" on every PyYAML version.