Repository navigation
feat(mothership): sign the private memory scope for the memory sidecar - #10185
myxamediyar wants to merge 8 commits into
Conversation
read_scope returns an attestation while memory is enabled and MOTHERSHIP_MEMORY_SIGNING_KEY is set: a one-minute EdDSA JWT over the user, organization, workspace, space and chat it just authorized, which the mothership memory sidecar verifies with Sim's public key instead of trusting the worker that forwards it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MOTHERSHIP_MEMORY_SIGNING_KEY is set only for a Mothership whose memory service lists its public key; a Sim on the hosted endpoint leaves it unset. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
[Medium impact] No new blocking issues found; the signature must not be treated as proof of the worker's acting identity without run grants. SummaryAdds optional, short-lived signatures over the private-memory scope returned by Sim.
The earlier worker-identity concern was acknowledged and deferred by myxamediyar to PR #10192: run grants must bind worker calls to a user and chat. This PR checks that memory requests carry the IDs Sim returned; it does not establish that binding itself. No new actionable issues found. Reviews (2) · Last reviewed commit: "chore(mothership): merge staging into th..." · Reviewed by Greptile |
There was a problem hiding this comment.
All reported issues were addressed across 6 files
This PR changes authentication, authorization, or input validation. Ultrareviews find 2.4x more serious bugs than standard reviews. Comment @cubic-dev-ai ultrareview to run one.
Turn on auto-fix | Re-trigger cubic
…anch Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s check The signature lets the memory service check that a request carries exactly the ids Sim returned for the call. It does not on its own stop a worker that names another chat when it asks for a scope; run grants on the worker routes cover that separately.
|
@cubic-dev-ai review this PR |
@myxamediyar I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
No issues found across 6 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Tip: Get a Slack DM when cubic finishes reviewing your PRs. Connect Slack
Turn on auto-fix | Re-trigger cubic
|
Closing: the memory scope will not be signed for now. Sim's existing per-call scope check stays the authority, so no Sim change is needed. |
Summary
attestation.ts: an EdDSA JWT over those ids (subthe user,org,ws,space,chat), issuersim, audiencemothership-memory, valid one minute, signed withMOTHERSHIP_MEMORY_SIGNING_KEY(Ed25519, PKCS#8 PEM, newlines as\n)read-scope.tsreturns it asattestationonly while memory is enabled and a key is set; without a key nothing changesattestation;.env.exampledocuments the key, which a self-hosted Sim on the hosted endpoint leaves unsetlib/auth/internal.ts, whose shared secret also authorizes Sim's internal APIMOTHERSHIP_REQUIRE_RUN_GRANTset, the scope route serves only the user and chat a grant names, so the signature then speaks for Sim end to end. A memory service should require this signature only from a Sim that requires run grantsCompanion: simstudioai/mothership#977
Type of Change
Testing
read-scope.test.ts: the scope is signed for the memory service only, for one minute, with the ids it returns; nothing is signed while memory is off or no key is setlib/mothershipandlib/core/configsuites pass (3262 tests);bun run lint:check,bun run type-checkandbun run check:auditspassChecklist
test-auditauthoring gate)