Repository navigation
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
expwithAsymmetricJWTAuthandJwksAuth, as withJWTAuth. auth=Truewithout anAuthMiddlewarenow refuses calls instead of serving them: addAuthMiddleware(...)to a server built withrequire_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: setprometheus_host="0.0.0.0"for a scraper on another host. - In a graph with a
HumanNodeorGuardNode, model routing (route,goto,skip_to) is limited to the node's declared successors. - Cross-agent
contextarrives 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,secretorprivate_key, whatever its type.
Security
auth=Truewas not enforced without anAuthMiddlewarein the call's chain -- authentication only happened insideAuthMiddleware, soMCPServer(require_auth=True)with noAuthMiddlewareserved every tool and resource to anyone;mount()copied a child'sauth=Truedefinitions without itsAuthMiddleware; and a router included while the server was running got neither its middleware nor its tools' declared limits. Anauth=Truedefinition with no identity guard is now refused when the request has no client id,mount()carries the child'sAuthMiddleware, 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 annand 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 JSONtrueapproves. - Tools held by a custom graph node skipped the approval gate and the tool-result scan --
PromptNode("act", tools=[...])in a graph passed asagent_patternkept its own tool objects. They are wrapped like the agent's tools. load_graphresolvedpromptise.*references by walking attributes --promptise.prompts.template:subprocess.os.systemgaveos.systemwithoutallow_imports. Such a reference must name something Promptise defines.- Model output could route a run past a
HumanNodeorGuardNode--{"route": "wire_money"}or theskip_toaction jumped to any node. In a graph with either node the model can only pick a declared successor.SubgraphNodenow runs with the parent engine's hooks. - With a
ContextEngine, a line of user text starting withSystem: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_contentstripped each marker once, so nesting one inside another rebuilt it. - Semantic cache partitions collided --
:and/in an untenanted user id became_, sogoogle:123andgoogle_123shared cached answers. Ids are percent-encoded. - An expired in-memory session came back with no owner, so any user could open it.
RedisConversationStoretreateduser_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,secretorprivate_keywere unknown, so tool arguments reached reports, logs, OTLP and webhooks. Trace files are now created0600, 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_urlexpanded${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. APOSTwhose summary started with a query word was classifiedread, and the evaluation transport matched the decoded path, so a gated call could go live. OpenAPIProviderhad no size limits --$refinlining 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..%2Fsecretgave the handler../secret.- Runtime:
spawn_processaccepted any name --billing/agenttook over the journal ofbilling_agent, and a NUL byte made inherited blocking hooks fail open. An agent could connect an MCP server under a configured server's name. Withconcurrency > 1a new run reset the per-run budget counters of a running one. A secret copied into state was written to disk by a checkpoint afterstop(). - A remote event could claim a trusted trigger's id --
POST /processes/{name}/eventon the distributed transport copiedtrigger_idfrom the body, and an event from a trusted trigger is handled as the user's own request. Remote events now get aremote: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_filerefuses files over 4 MB, and a cancelled call kills its command. MCPQueuehad no limit on waiting jobs -- one anonymous caller could fill memory and fail the readiness check. Newmax_pending(10,000) andmax_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 validateandpromptise agentprinted 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.ValidateNodewithout anoutput_schemapassed on"passes": "false"-- any non-empty string counted as a pass, so a validator used as a gate failed open. Onlytruepasses.- An MCP server tool named
request_more_toolshid 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 byAuthMiddleware, 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 ownRESULT: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_tokenput the token response in its error, and paginated*/listrequests had no end. AsymmetricJWTAuthandJwksAuthaccepted a token withoutexp-- PyJWT checksexponly when the claim is there, so an IdP or signing service that left it out issued a credential that never expired. Both now requireexp, likeJWTAuthalways 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-Encodingunread. Projects generated from now on carry the check in their ownupstream.py. - Inlining a spec's
$refs had no size limit --MCPCAST_MAX_SPEC_NODESchecked 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'stimeoutargument replacedSandboxConfig.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 twicemax_parallel. A nested batch call is now refused. Declaredrate_limitandmax_concurrentalready held across batches on a running server; a test now covers that.
Changed
- Cross-agent
contextis a user message marked as untrusted, not a system message: the calling model writes it. Broadcast runs each peer once. content_filterandlengthguards 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 --
JAILBREAKorMALICIOUSnever did. NER findings no longer carry the matched text in logs, events or the notice the model reads. WebhookTransporteruses one delivery thread and a bounded queue; dropped batches are counted indropped.- The Prometheus endpoint listens on
127.0.0.1by default (prometheus_host, new): it has no authentication. Setprometheus_host="0.0.0.0"for a scraper on another host. - MCPcast's evaluation sends only
GETandHEADrequests to the live API; aPOSTthe classifier calls a search is answered by a mock. OpenAPIProvider(max_response_bytes=...), default 10 MB.
Fixed
JWTAuthanswered some malformed tokens withINTERNAL_ERROR-- a header or payload that is valid JSON but not an object, or a non-numericexpornbf, raised inside the provider and logged a stack trace. These are now authentication errors.- A
rolesclaim given as a string was split into letters --"roles": "admin"became the rolesa,d,m,i,n. Roles are now read from a list or a space-separated string, the wayscopealready 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 --
Trueand['a', 'b']went into the URL. They are nowtrue/falseand 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.