Skip to content

feat(sealing): browser-sealed check secrets for private agents - #834

Merged
fclairamb merged 27 commits into
mainfrom
claude/private-agent-secrets-d22c9e
Nov 10, 2026
Merged

fclairamb merged 27 commits into
mainfrom
claude/private-agent-secrets-d22c9e

Conversation

@fclairamb

@fclairamb fclairamb commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

Check secrets can now be encrypted in the browser, so a check that runs only on private agents never sends its passwords to the SolidPing server. Server-side encryption stays available, chosen per check.

Spec: specs/done/2026/11/2026-11-08-01-browser-sealed-check-secrets.md (phases 1 and 2).

What changed

  • Browser mode per check. dash0 seals the secrets with typage ([email protected], lazy loaded, CSP unchanged) to the region's recipients and sends sealedSecrets. The server checks regions, keys, ciphertext shape and fingerprints (409 SEALING_RECIPIENTS_CHANGED with the current list, dash0 re-seals once) and stores origin: browser.
  • Org setting security.browser_sealing.mode: optional (default) or required (400 SECRETS_MUST_BE_SEALED). The settings card lists the checks that don't comply.
  • Shared region key, opt-in per private region: generated in dash0 and shown once. Agents load it from SP_AGENT_REGION_KEYS / SP_AGENT_REGION_KEYS_FILE and advertise region-key-<fp>. A region can run several agents without re-sealing.
  • Claim filter: an org agent no longer claims a sealed job it can't open. Before, it claimed and failed it.
  • dash0: encryption choice in the check form, lock badge, Replace button, Re-seal page, region key mode select, both agent fingerprints on the agents page, design reference entry, en/fr/de/es.
  • API: GET /orgs/:org/sealing-recipients, GET /orgs/:org/sealing/noncompliant-checks, GET /orgs/:org/sealing/reseal-checks, PUT|DELETE /private-regions/:slug/region-key. MCP create_check / update_check accept sealedSecrets.
  • Docs: new page features/browser-sealed-secrets.
  • Batch gate fix: organization-settings.spec.ts waited too little for the settings refetch (race older than this branch).

Behaviour changes

  • On server-sealed-only checks, a PATCH with partial plaintext secrets now gets 400 VALIDATION_ERROR instead of silently dropping the missing keys.
  • The capability is spelled region-key-<fp> (the capability validator allows only [a-z0-9-]), not region-key:<fp> as the spec said.

Follow-up

Phase 3 (peer re-wrap, solidping seal, solidping agent region-key generate, sealedSecrets in config-as-code) is filed as specs/todos/2026-11-10-03-sealed-secrets-peer-rewrap-and-cli.md on the batch PR #835.

Tests

make build-backend lint-back test green, non-short Postgres for checkjobsvc, agentws, handlers/checks green, full Playwright suite 1008 passed / 0 failed / 15 skipped on a side-car.

🤖 Generated with Claude Code

fclairamb and others added 26 commits November 8, 2026 00:51
Feasibility study and design, pending review. Seal check secrets in
dash0 with age for the org's private agents, so the server never
receives them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Per-check choice, optional org-wide required mode, no paid-tier
entitlement.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A region seals either to each agent's key (default) or to one region
key held by all its agents, so several agents need no re-seal.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ackend)

sealedSecrets on check create/PATCH, GET /orgs/:org/sealing-recipients,
origin on sealed envelopes, org setting security.browser_sealing.mode
(optional/required), claim filter on sealed fingerprints, shared region
keys (sealing.region_keys, PUT/DELETE /private-regions/:slug/region-key),
agent SP_AGENT_REGION_KEYS(_FILE) with multi-identity unseal and
region-key-<fp> claim capabilities.

Spec: specs/todos/2026-11-08-01-browser-sealed-check-secrets.md

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…settings

Check form: per-check encryption choice (browser pre-selected when every
region is private), sealing on submit with one retry on
SEALING_RECIPIENTS_CHANGED, lock badge with recipients. Private locations:
shared region key generation/rotation (secret shown once, only age1...
sent), agent sealing fingerprints. Settings: check secret encryption mode
and the checks to fix. /sealing-recipients now also returns the org mode.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…up spec

Phase 3 (peer re-wrap, solidping seal, region-key generate, sealedSecrets
in config-as-code) is filed as specs/todos/2026-11-10-03.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e agents

Scoped gate: go build, golangci-lint --new-from-rev on changed packages,
go test -short on changed packages and importers, make build-dash0,
dash0 unit tests, lint:e2e, typecheck:e2e, make build-docs.
E2E spec authored, not run (Playwright browsers not installed locally).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ion, region key mode select, Re-seal page

- Replace opens every secret input of a browser-sealed check at once; they stay closed until then.
- Picking a shared region in browser mode empties the secret inputs.
- A required org disables shared regions once a secret is typed, and closes the secret inputs while a shared region is picked.
- The region key mode is a select (key per agent / shared region key).
- New Re-seal page (private locations) lists needsReseal checks, each opening its form in Replace mode (GET /orgs/:org/sealing/reseal-checks).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e-seal list tests; regions checked first

- TestBrowserSealing_Postgres runs every browser-sealing scenario on one embedded Postgres (port 15742), a fresh org per case.
- Bulk region change: a browser-sealed check is a rejected item with its reason, the others move.
- ListResealChecks lists needsReseal checks once a new agent joins.
- sealedSecrets: the private-region rule runs before the shape and ciphertext checks, on create and PATCH (spec section 4 order).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Rebuild the edit URL from the detail path (it may carry a query string) and wait for the form before opening the authentication section.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Changelog entry (release-please owns CHANGELOG.md; this is the prose for the release PR pass, per wiki/conventions/changelog.md):

* **sealing:** check passwords for private locations can now be encrypted in your browser, for keys that only your own agents hold. SolidPing stores ciphertext it cannot open: the plaintext never reaches the server, not even in request bodies or logs. Pick "Encrypted in my browser" above a check's secret inputs when every region of the check is one of your private locations; "Encrypted by SolidPing" stays the default for everything else. Available on every plan.
* **sealing:** an organization can require browser encryption (Settings, Security: "Browser only"). The API then refuses plaintext check secrets (`SECRETS_MUST_BE_SEALED`), the check form disables shared regions once a secret is typed, and the settings page lists the checks still to fix.
* **private locations:** a private location can use one shared region key instead of a key per agent (`SP_AGENT_REGION_KEYS`), so adding or replacing an agent needs no re-seal. The key is generated in the browser and shown once; only its public half reaches the server.
* **private locations:** a new Re-seal page lists the checks whose sealed secrets no longer match their agents, each opening its form ready to type the secrets again.
* **api:** `GET /orgs/:org/sealing-recipients` and a `sealedSecrets` field on check create and update let scripts and the MCP tools seal with the age CLI. Notification integration tokens are not covered: SolidPing still reads them to send alerts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
While the secret inputs are locked, the form drops every declared secret
key (and HTTP username/password), not only those holding a value. An add
then remove of a secret header row used to send secretHeaders: {}, which
the server reads as a clear and drops the sealed blob. The secret-header
key input, add and remove buttons are now locked like the other secret
inputs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@codecov

codecov Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.18681% with 86 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.28%. Comparing base (cf8fffc) to head (90e9f26).

Files with missing lines Patch % Lines
server/internal/handlers/checks/browser_sealing.go 90.04% 22 Missing ⚠️
server/internal/handlers/agents/region_keys.go 84.26% 14 Missing ⚠️
server/internal/handlers/auth/handler.go 12.50% 7 Missing ⚠️
server/internal/sealing/sealing.go 91.25% 7 Missing ⚠️
server/internal/crypto/credentials/sealing.go 89.28% 6 Missing ⚠️
server/internal/agentmode/agentmode.go 79.16% 5 Missing ⚠️
server/internal/config/config.go 37.50% 5 Missing ⚠️
...nternal/handlers/checks/browser_sealing_handler.go 92.00% 4 Missing ⚠️
server/internal/handlers/agents/handler.go 72.72% 3 Missing ⚠️
server/internal/handlers/agents/service.go 91.89% 3 Missing ⚠️
... and 5 more
Additional details and impacted files
@@           Coverage Diff            @@
##             main     #834    +/-   ##
========================================
  Coverage   89.27%   89.28%            
========================================
  Files        1337     1341     +4     
  Lines      136774   137436   +662     
========================================
+ Hits       122104   122703   +599     
- Misses      14661    14724    +63     
  Partials        9        9            
Files with missing lines Coverage Δ
server/internal/app/server.go 92.30% <100.00%> (+0.03%) ⬆️
server/internal/checkworker/backend/ws.go 83.11% <100.00%> (+0.50%) ⬆️
server/internal/checkworker/backend/ws_tunnel.go 78.00% <100.00%> (ø)
server/internal/config/envvars.go 100.00% <100.00%> (ø)
server/internal/handlers/agentws/handler.go 84.07% <100.00%> (+0.15%) ⬆️
server/internal/handlers/checks/bulk_update.go 95.07% <100.00%> (+0.14%) ⬆️
server/internal/handlers/checks/plan.go 89.91% <100.00%> (+0.08%) ⬆️
server/internal/handlers/auth/service.go 89.91% <94.11%> (+0.02%) ⬆️
server/internal/checkworker/checkjobsvc/service.go 87.15% <90.47%> (-0.38%) ⬇️
server/internal/handlers/checks/handler.go 92.45% <66.66%> (-0.54%) ⬇️
... and 12 more

... and 17 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@fclairamb
fclairamb merged commit 00c376c into main Nov 10, 2026
36 checks passed
@fclairamb
fclairamb deleted the claude/private-agent-secrets-d22c9e branch November 10, 2026 18:43
fclairamb added a commit that referenced this pull request Nov 10, 2026
…#835)

<!-- claude-projects-attribution: {"github_login":"fclairamb"} -->
_Requested by **Florent** · [project
thread](https://claude.ai/code/project/chan_017KXjWWmGcmwS6Uy2DzmGVM?thread=cmsg_017KXjWWmGcmwS6Uy2DzmGVMGNbToAtd2GyCHTQRrkwNNj)_

## What changed
- Sealed secrets: peer re-wrap (an online agent re-seals a check's blob
for the current recipients; admin-only `POST/GET
/orgs/:org/sealing/rewrap`, "Re-seal for the current agents" button in
dash0), `solidping seal`, `solidping agent region-key generate`, "Paste
a public key" in dash0, and `sealedSecrets` in config-as-code
import/apply (`SEALING_RECIPIENTS_CHANGED` item error).
- Agent-side opt-out of the re-wrap (spec `2026-11-10-04`):
`SP_AGENT_REWRAP_ENABLED=false` keeps the `rewrap` executor and
capability off, so a compromised server cannot get secrets re-sealed to
a key of its choice. When online key holders do not run the re-wrap, the
outcome is `rewrap_not_offered` (en/fr/de/es) instead of
`no_online_recipient`. The agent logs the fingerprints it sealed to.
Default stays on.
- New migration `033_v0_47_0` (`worker_tasks.target_worker_uid`).
Re-seal needs agents built from this version.
- Batch gate: envcheck exception for `SP_SERVER_URL`; e2e cleanup of
private regions in `browser-sealed-secrets.spec.ts`.

⚠️ This branch includes a merge of open PR #834
(`claude/private-agent-secrets-d22c9e`), a prerequisite (phases 1–2):
this PR carries its ~5,500-line diff until #834 is merged. Merge #834
first.

## Decided by autopilot
- No open questions in the spec; the "payload size" to-verify item was
answered: no chunking needed (one task per check, <100 KiB).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01XE5BqoV7qsQrWXgxE3x1Xw

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
fclairamb added a commit that referenced this pull request Nov 10, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.47.0](v0.46.0...v0.47.0)
(2026-11-10)


### Features

* **sealing:** browser-sealed check secrets for private agents
([#834](#834))
([00c376c](00c376c))
* **sealing:** peer re-wrap, solidping seal and sealed config-as-code
([#835](#835))
([91c656a](91c656a))


### Bug Fixes

* **ci:** leave the tag on HEAD out of the upgrade matrix
([#830](#830))
([d333957](d333957))
* **deps:** update github.com/dop251/goja digest to a443384
([#836](#836))
([bbfb783](bbfb783))
* **deps:** update module github.com/posthog/posthog-go to v1.42.2
([#837](#837))
([cf8fffc](cf8fffc))
* **security:** trusted service binary and data folder paths, skip
deleted orgs' SLO burn policies
([#833](#833))
([5315038](5315038))
* **status:** mobile header truncation and dotted response-time chart
([#831](#831))
([0c974de](0c974de))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: Claude Sonnet 5.5 <[email protected]>
fclairamb added a commit that referenced this pull request Nov 11, 2026
…aps, drop deleted regions' keys, TLS-only agent server URL (#840)

Security scan of 2026-11-11 on the browser-sealed check secrets (#834,
#835): all four findings are implemented.

## What changed

- **AJ1 (Medium)**: a sealed blob is bound to the check's type and
target fields (`_binding`, shared Go/TS digest fixture). The agent
refuses a retargeted check or a blob overriding a public field. The
server answers 409 `SEALED_TARGET_CHANGED` on PATCH, apply and import.
dash0 reopens the secret inputs on a target edit. Legacy unbound blobs
are accepted with a warning and listed on the Re-seal page.
- **AJ2 (Medium)**: peer re-wrap now needs a possession challenge, only
secret-field keys in a sealed plaintext, and a confirmation by a second
recipient (`rewrap_verify`); without a second agent online the blob is
stored flagged `unconfirmed`. Duplicate agent keys are refused at
enrollment. Retired region keys are kept (public part only).
- **AJ3 (Low)**: deleting a private region removes its shared region
key; orphaned keys are no longer returned.
- **AJ4 (Low)**: an agent refuses a non-TLS server URL outside loopback
unless `SP_AGENT_ALLOW_INSECURE_SERVER=true`, which also turns re-wrap
off by default.
- Batch gate fix: the duplicate-key check still sees keys of deleted
regions.

**Breaking**: `solidping seal` now requires `--type` and
`--config-json`; agents older than 0.48 are not picked for re-wrap; an
`http://` agent URL to a non-loopback host no longer starts; editing a
target field of a sealed check requires the secrets again.
`client_generated.go` not regenerated (per-batch convention).

## Decided by autopilot

- Spec 01, unbound legacy blobs: accept with a warning and list them on
the Re-seal page; refuse them in the next minor (recommended answer).

Gate: build, lint, `make test`, dash0 typecheck/lint, Playwright 1011
passed / 0 failed / 15 skipped (SQLite side-car).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant