Repository navigation
A patch release on top of v4.0.2 covering multi-tenant route and stream scope isolation, MCP URL path containment and authenticated task actor binding, runtime role-adapter policy enforcement, ACP v1 JSON-RPC support and session journal descriptor containment, task artifact descriptor binding, EdDSA agent identity JWTs, webhook trigger governance, and workflow/CLI lifecycle fixes. Review the upgrade notes below before upgrading if you use authenticated task-server clients, persisted .sdd/security/role_adapter_policy.json files, or .sdd/config/triggers.yaml.
Tenant scope, authenticated actors, and identity signing
- Principal-bound tenant scope across routes and streams: Session-to-tenant and A2A-task-to-tenant ownership are indexed across registries and enforced across session, approval, A2A, task, cost, identity, plan, mission, team, SCIM, and dashboard route handlers as well as SSE and WebSocket subscriber and publisher gates (#8272).
- MCP URL path-segment containment and authenticated actor binding: MCP client calls validate administrative
run_idvalues (^admin-[a-f0-9]{32}$with control-character rejection), MCP TaskstaskIdhandles (tasks/get,tasks/result,tasks/cancel), and tool-level path segments (rejecting.and..dot-segments, query/fragmentserver_urlbases, and verifying canonicalhttpx.URLpaths) before issuing authenticated requests (#8273).POST /tasks/{task_id}/artifactsresolves claim-holder authorization and audit attribution strictly fromSSOAuthMiddleware-bound credentials, forwardingx-bernstein-agent-idfrombernstein_post_artifactonly when no bearer credential is configured for local auth-disabled development. Breaking / migration: On authenticated servers,claimer_idonPOST /tasks/claim-receipt,posteronPOST /tasks/{task_id}/artifacts, andsenderonPOST /tasks/{task_id}/messagesmust match the caller's authenticated principal (agent_identity.id/session_id, SSOuser.id/email, JWTagent_id/sub, or"operator"for the legacy static bearer token), and fleet-shared cluster credentials are refused with HTTP403on per-agent claim-receipt and mailbox endpoints (#8273). - Runtime role-adapter policy enforcement:
AgentSpawnerloads<workdir>/.sdd/security/role_adapter_policy.jsonon runtime dispatch and enforces per-role adapter allow-lists across cached adapter lookups, initial spawns, provider failovers, isolation/bridge/in-process backends, and crash-resume sessions (#6648, #8258, #8271). Behavior change on upgrade: Persisted.sdd/security/role_adapter_policy.jsonfiles written in earlier releases now take effect immediately at runtime (including"*": []default-deny rules), and unreadable, symlinked, non-regular, duplicate-key, deeply nested, invalid JSON/UTF-8, or mistyped policy files fail closed withRolePolicyConfigErroruntil fixed or removed. Operator-configured directory symlinks at<workdir>/.sddremain supported while symlinks beneath.sdd(security/,role_adapter_policy.json) are refused via anchoredO_NOFOLLOWdescriptor walks on POSIX and path-level symlink checks on Windows;bernstein security role-adapter-policy show|set|testshares the same loader and alias checks,SpawnAnalyzertreatsRoleAdapterDeniedas non-transient, router availability is restored on failed spawns, and pre-claimed warm-pool slots are released onSamplingParamsRefusaland non-fallbackBridgeErrordenials. - EdDSA (Ed25519) agent identity JWTs:
AgentIdentityStore.create_identitysigns agent identity tokens with asymmetricEdDSA(Ed25519) instead of symmetricHS256, using an out-of-workdirKMSAdaptersigning key (0600mode enforced; keys under.sdd/refused) and publishing the public key at/.well-known/agent.json/keysunder its matchingkid(#8193, #8197)._authenticate_jwtbinds verification to each MAC-authenticated credential record's storedalgorithm, refusing header mismatches; existing unexpiredHS256tokens continue verifying until expiry whileBERNSTEIN_AUTH_JWT_SECRETlogs a deprecation warning and will be removed one minor release later. - Loopback host allowlist and token-file hardening: Non-loopback
Hostrejections on loopback servers nameBERNSTEIN_ALLOWED_HOSTS(exact lowercase hostnames, without port or wildcards) in the HTTP403detail payload and CLI reference,.sdd/runtime/auth.tokenreuse verifies vialstat/fstatthat the file is regular, owner-only, and UID-matched before reuse (rotating unsafe files), and shadowed/agents/{session_id}/*handlers intask_crudare removed (#8189, #8195).
Descriptor containment for ACP journals, task artifacts, and file locks
- ACP session journal containment, read bounds, and binary appends:
EventJournal,resolve_session_journal_path, andproject_journal_to_acp_updatespin canonical.sdd/runs/<run_id>directory names, traverse.sdd -> runs -> <run_id> -> journal.jsonlviaO_DIRECTORY | O_NOFOLLOW-anchored descriptors on POSIX, and refuse symlinks, Windows directory junctions,FILE_ATTRIBUTE_REPARSE_POINTentries (including OneDrive or storage-deduplication reparse points under.sdd/runs/), hardlinks (st_nlink != 1), and non-regular files withUnsafeJournalError(#8231, #8274). ACPsession/loadprojection (RESOURCE_NOT_FOUNDwhen exceeded) and strictEventJournal.resumeenforce a streaming 64 MiB read ceiling (MAX_JOURNAL_READ_BYTES) while leaving non-ACPEventJournal.resumeunbounded unlessmax_bytesis supplied, and journal appends write unbuffered binary rows (0600mode on open) with canonical LF (\n) line endings across platforms (#8274). - Task artifact descriptor binding:
load_artifact()opens.sdd/outbox/<task-id>/artifact(or the task's declared relativeoutput_path) through a step-by-stepO_NOFOLLOW/O_DIRECTORYdescriptor walk rooted at anO_NOFOLLOW-anchored workdir descriptor, refusing symlinked workdir roots, escaping symlinks, walks exceeding hop/depth/step ceilings, cross-device targets, FIFOs/devices (O_NONBLOCK+fstat), oversized artifacts (max_bytes), mid-read file mutations, andst_nlink > 1hardlinks while preserving within-workdir symlinks and raisingArtifactCompletionErrorwithout leaking target bytes (#8275). - POSIX
filelock4.2.1 regression coverage: Addedtests/unit/security/test_filelock_posix_regression.pyguarding the transitivefilelock >= 4.2.1upgrade (#6788) againstCVE-2026-112940/GHSA-v4x8-3wr5-3wq8(symlink lock refusal, planted SQLite-wal/-journalisolation, and WAL-mode lock database rejection) while keeping Windows advisoriesCVE-2026-112907andCVE-2026-112913covered by the>= 4.2.1pin (#6759, #8228).
ACP v1 bridge, webhook governance, and receipt verification
- ACP v1 JSON-RPC bridge and embedded session runner:
bernstein acp servesupports ACP v1 (protocolVersion: 1) over line-delimited JSON-RPC 2.0 onstdio(diagnostics routed tostderr) and loopback HTTP/SSE (POST /acp), alongside the legacy"2025-04-01"dialect (#8211, #8212, #8213). Implementsinitialize,authenticate,session/new,session/load,session/set_mode, blockingsession/prompt,session/cancel, bidirectionalsession/updateandsession/request_permissionmultiplexing, embedded runner execution (--allow-embedded-httprequired on loopback--http;automode andrequire_auth=Truefail closed; per-IP HTTP session ownership with documented limits), persisted.bernstein/always_allow.yamlrules pinned by.sdd/config/always_allow.manifest.json,session/loadreplay starting inmanualmode (capped at 2,000 updates / 16 MiB),bernstein acp serve --setup, CIACP v1 conformancegating, andpackaging/acp-registry/bernstein/assets. - Trigger governance for Slack Events API and GitHub
workflow_run:POST /webhooks/slack/eventsand GitHubworkflow_run/completeddeliveries onPOST /webhooks/githubpass through.sdd/config/triggers.yamlviaTriggerManager.gate_direct_taskbefore creating tasks (#4545, #8233). Matchingslackandgithub_workflow_runrules enforce filters, tenant-scoped cooldown, and per-delivery deduplication (including built-in bot sendersbernstein[bot]andgithub-actions[bot]) prior to CI log downloads or git blame/diff; absent,triggers: [], or unmatched configs remain pass-throughs, while corrupt, unreadable, quarantined, or0-bytetriggers.yamlfiles fail closed with HTTP503(keeping Slackurl_verificationat200; repairtriggers.yamlwithin Slack's retry window or redeliver missed GitHub webhook events from Recent Deliveries). - Offline tool-call effect and retry receipt verification:
verify-audit-receiptand standalonebernstein-verify-receiptvalidatetoolcall.attestation -> toolcall.enforced_dispatch -> toolcall.effecttriples andToolCallIntent.retry_ofx402 retry links without importingbernstein.*, stream-hashing<intent_sha256>.effectpayloads (16 MiB cap) when--effects-diris passed and reportingeffect unobservedwhen no effect row was recorded (#6270, #8227).
Workflows, runtime lifecycle, CLI, and CI hygiene
- Workflow command tree reaping and pipe draining:
WorkflowRunner._execute_commandruns command nodes in isolated POSIX process groups or supervised Windows Job Objects, drainsstdout/stderrvia non-blocking cancellable readers (4 MiB per-stream cap) before reaping the leader, escalatesSIGTERMtoSIGKILL/TerminateJobObjectwithESRCH/ActiveProcesses == 0confirmation, validatescleanup_confirmedandreap_receiptfail-closed across.node.json/.loop.jsoncheckpoints, skips downstreamalways_runnodes, and refusesbernstein workflow resumewhen cleanup was unconfirmed (#8256, #8257). - Workflow checkpoints, goal binding, UTF-8 errors, and task replay: Command workflows checkpoint each loop iteration while keeping the original iteration limit and halting recovery on uncertain post-dispatch state (#7855, #7882); workflow runs bind their initial goal to the run ID and refuse resume on goal mismatch (#7856, #7883); invalid UTF-8 workflow manifests raise
WorkflowSpecErrornaming the file and byte offset acrossvalidate,run --dry-run, andlist --dir(#7869, #8119);bernstein resumeandbernstein ledger resumeissue deterministicrequest_idvalues tracked in.sdd/runtime/resume/<task-id>.requests.jsonwith worker-confirmedruntime_acknowledgedstatus (#7854, #8196); andTaskStorepersists and fail-closed replaysapproval_spec(#7028, #8199). - Run finalization wait and PID teardown guards:
bernstein run --wait(and--quiet) waits forrun_completedand run-bound.finalizing->.finalizedcompletion (30s post-quiescence grace window, dead-PID short-circuit,EXIT_RUN_UNHEALTHYon unfinalized quiescence) before signallingPOST /shutdown(#6089, #7705).PreviewManagerrecords process start identity via lazypsutiland Linux/proc/<pid>/statstarttimeticks and fails closed before sendingSIGTERMon missingpsutil, invalid/group/own PIDs, or mismatched reused PIDs while auditingpreview.stopand cleaning persisted state (#8235), andbernstein gui_stop_tunnelguards against signalingpid <= 1(#8218). - CLI, verification types, benchmarks, and CI isolation:
bernstein worktrees gcreportsworktree.gchook success only when directory removal succeeds (#7963);bernstein plan lsandbernstein plan showignore directories named*.yaml(#7943, #8113);bernstein doctorpasses--no-synctouv runversion probes (#8243); canonicalReceiptVerification,CheckOutcome, andFailuresResultdataclasses consolidate 11 non-security verification result shapes (#5099, #7689);self-conformance-bench-v1adds five bounded benchmark-envelope verifier probes (#5451, #7714);tests/fixtures/scanners/.gitignoreexcludes vulnerable scanner fixture targets from OSSF Scorecard (#6068, #8226); and PR comment/autosync writes are isolated in.github/workflows/pr-publish.ymlunderenvironment: automation(operator action: moveBERNSTEIN_AUTOSYNC_TOKENfrom repository secrets to theautomationenvironment before enabling the publisher) (#7940).
Upgrading
pipx upgrade bernstein # or: uv tool upgrade bernsteinBefore upgrading:
- On authenticated task servers, ensure clients calling
POST /tasks/claim-receipt,POST /tasks/{task_id}/artifacts, andPOST /tasks/{task_id}/messagessendclaimer_id,poster, andsendermatching their authenticated principal and use per-agent credentials rather than fleet-shared cluster credentials (#8273). - Inspect or remove any legacy
.sdd/security/role_adapter_policy.jsonfile that should not be enforced at runtime (#6648), and verify any.sdd/config/triggers.yamlfile is valid YAML with atriggerskey (#4545).
What's Changed
- fix(security,gui): harden loopback host guard, token reuse, and OpenAPI schema by @chernistry in #8189
- docs(gui): document loopback API bearer reuse, SSE auth, and host guard by @chernistry in #8182
- docs: point the security review and DAG alias at commands that exist by @vaibhav8a in #7061
- fix(routes,docs): remove shadowed task_crud agent routes and document BERNSTEIN_ALLOWED_HOSTS syntax by @chernistry in #8195
- ci(digest): add allowlisted weekly code quality summary section by @chernistry in #8190
- feat(#8193): sign agent identity tokens with EdDSA instead of HS256 by @chernistry in #8197
- fix(resume): deterministic request ids and real runtime acknowledgement by @chernistry in #8196
- fix(tasks): persist and safely replay approval_spec (#7028) by @chernistry in #8199
- fix(planning): plan queries ignore directories named *.yaml (#7943) by @vaibhav8a in #8113
- fix(workflows): report a manifest that is not valid UTF-8 (#7869) by @vaibhav8a in #8119
- docs: point nine source references at the files that exist by @vaibhav8a in #7066
- chore(deps): update gitea/gitea docker tag to v28.4 by @renovate[bot] in #8185
- chore(deps): update dependency vitest to v5.1.1 by @renovate[bot] in #8174
- feat(acp): ACP v1 wire schema, bidirectional transport, and handshake by @chernistry in #8211
- docs: add enforced invariants page by @chernistry in #8214
- chore(deps): hold agent-manifest at 0.12.x in Renovate and Dependabot by @chernistry in #8220
- chore(ci): label crate-ci/typos SHA pins with exact v1.52.0 tag by @chernistry in #8221
- feat(acp): embedded session runner, journal updates, approvals, and session/load by @chernistry in #8213
- docs(ci): document manual merge-queue enqueue for Dependabot PRs (#6845) by @chernistry in #8224
- chore(ci): update reviewed crate-ci/typos pin to v1.52.2 by @chernistry in #8223
- fix(ci): pin Node 24 in self-hosted VPS workflows and cap Renovate by @chernistry in #8219
- fix(ci): ignore scanner fixture targets for Scorecard vulnerabilities scan by @chernistry in #8226
- test(security): add POSIX regression suite and release note for filelock 4.2.1 by @chernistry in #8228
- fix(gui): guard _stop_tunnel against signaling non-process PIDs by @chernistry in #8218
- chore(deps): update dependency pymdown-extensions to v13.1.2 by @renovate[bot] in #8229
- chore(deps): update dependency mkdocs-material to v9.8.2 by @renovate[bot] in #8217
- chore(deps): update dependency backrefs to v8.3.1 by @renovate[bot] in #8216
- docs: regenerate adapter last-green table from canary receipts by @chernistry in #8240
- chore(deps): update dependency pyyaml to v6.0.4 by @renovate[bot] in #8244
- Isolate PR observability and autosync write credentials by @chernistry in #7940
- ci: add verify-cli test suite and standalone wheel smoke job by @chernistry in #8241
- fix(preview): fail-closed PID identity guard using process start time by @chernistry in #8235
- Report worktree removal outcomes to the GC hook by @chernistry in #7963
- fix(acp): refuse hardlinked and non-regular session journals by @chernistry in #8231
- fix(doctor): pass --no-sync to uv run tool version probes by @chernistry in #8243
- feat(security): verify toolcall effect triples and retry_of linkage in offline receipt verifiers by @chernistry in #8227
- fix(security): measure benchmark envelope conformance (#5451) by @chernistry in #7714
- fix(tests): isolate working directory with monkeypatch.chdir by @chernistry in #8236
- docs: regenerate adapter last-green table from canary receipts by @chernistry in #8249
- docs(acp): ACP v1 bridge docs, CI conformance gate, and registry assets by @chernistry in #8212
- Consolidate non-security duplicate verification result shapes by @chernistry in #7689
- fix(tests): wait for initial poll worker in cluster view panel test by @chernistry in #8252
- Preserve command-loop progress when resuming an interrupted workflow by @chernistry in #7882
- fix(cli): wait for journal finalization before completion verdict by @chernistry in #7705
- Keep an interrupted workflow bound to its original goal by @chernistry in #7883
- fix(tests): stop periodic dashboard polls during manual cluster frame tests by @chernistry in #8254
- chore(deps): update dependency watchdog to v7.1.1 by @renovate[bot] in #8247
- chore(deps-dev): bump types-croniter from 6.2.4.20261006 to 6.2.4.20261118 by @dependabot[bot] in #8234
- fix(workflows): reap owned process trees and drain pipes on command timeout (#8256) by @chernistry in #8257
- docs(readme): link Leonard Bernstein recordings on Patefona in epigraph by @chernistry in #8259
- docs(brand): add runs-on-bernstein light/dark badges by @chernistry in #8263
- ci: stop hosted macOS arm64 pool starvation on main CI and nightly by @chernistry in #8266
- fix(ci): resolve main test failures in orphan ratchet, z3 fallback, and trace follow by @chernistry in #8270
- fix(security): enforce persisted role-adapter policy across runtime dispatch (#6648) by @chernistry in #8258
- fix(webhooks): govern Slack events and GitHub workflow_run via triggers.yaml by @chernistry in #8233
- fix(security): honor symlinked .sdd anchor and unify CLI role-adapter policy checks (#6648) by @chernistry in #8271
- fix(security): enforce principal tenant scope across routes and SSE/WS streams by @chernistry in #8272
- fix(mcp,routes): enforce URL segment containment and authenticated actor binding by @chernistry in #8273
- fix(artifacts): bind artifact ingestion to contained file descriptors by @chernistry in #8275
- fix(acp,replay): verify journal descriptors on write and bind run/leaf identity by @chernistry in #8274
- fix(ci): override transitive tar to 8.0.5 in adapter-clis lockfile by @chernistry in #8277
- chore(release): v4.0.3 by @chernistry in #8276
Full Changelog: v4.0.2...v4.0.3