Skip to content

feat(proxy): authenticate option sets each caller's tenant - #3476

Merged
thymikee merged 11 commits into
mainfrom
feat/proxy-authenticate
Oct 14, 2026
Merged

thymikee merged 11 commits into
mainfrom
feat/proxy-authenticate

Conversation

@V3RON

@V3RON V3RON commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

createDaemonProxy checks every client against one shared clientToken and never sets a tenant, so an embedder serving many callers had to rewrite requests itself, and upload tickets carried the shared token instead of the caller's credential.

New optional authenticate(request) (replaces clientToken; null → the usual 401). The proxy then:

  • stamps the returned tenant on /rpc (meta.tenantId + sessionIsolation: 'tenant', lease tenantId, overriding flags.tenant/flags.sessionIsolation) and the x-agent-device-tenant header elsewhere, overwriting what the client sent;
  • serves request diagnostics only for <tenant>: sessions (the daemon does not partition a declared tenant);
  • puts the caller's own authorization/x-agent-device-token on upload tickets.

Without authenticate, nothing changes. Docs: proxy README, remote-proxy.md. 5 files.

Validation

Commit b342c0b. pnpm check:affected --run: all runnable checks passed (fail-open full set, triggered by untracked local state files).

  • 7 new proxy unit tests; each fails when its stamp, ticket or diagnostics check is removed. 20/20 pass.
  • Built CLI + local daemon + built @agent-device/proxy with authenticate:
    • click @e1 as alice → session alice:default; as bob → bob:default; alice with --tenant bob --session-isolation none → alice:default.
    • bob GET alice's diagnostics → 401 Session is outside this tenant; alice → 200.
    • install … Fake.ipa as alice: PUT /upload/direct/… auth=Bearer alice-key -> alice.
    • unknown key → UNAUTHORIZED.
  • agent-device proxy (clientToken) still works: session list ok, wrong token → 401, session cwd:…:default (no tenant), upload via ticket reaches the install step (DEVICE_NOT_FOUND, empty private sim set).

View guided diff Turn on auto-fix

createDaemonProxy accepts authenticate(request) in place of clientToken. The
proxy sends every forwarded request as the returned tenant with tenant session
isolation, confines request diagnostics to that tenant's sessions, and puts the
caller's own credential on upload tickets.
@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 5.22 MB 5.22 MB +2.2 kB
Package (unpacked) 5.22 MB 5.22 MB +2.2 kB
Package (download) 1.57 MB 1.57 MB +490 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 20.2 ms 19.7 ms -0.5 ms
CLI --help 53.9 ms 54.0 ms +0.1 ms

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://callstack.github.io/agent-device/pr-preview/pr-3476/

Built to branch gh-pages at 2026-10-14 16:19 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@thymikee

Copy link
Copy Markdown
Member

Changes needed. At b342c0b, authenticate does not isolate tenants on every route the proxy forwards, and CI is still pending (Smoke Tests in progress, no failure so far). There are no conflicts. Before merge, the tenant stamp must reach every /rpc method.

With authenticate set, any caller can still install apps into another tenant's session. stampRpcTenant (https://github.com/callstack/agent-device/blob/b342c0b/packages/proxy/src/daemon-proxy.ts#L589) writes the tenant into params.meta, params.tenantId and flags. The daemon mappers for agent_device.install_from_source and agent_device.release_materialized_paths (src/daemon/server/http-rpc-methods.ts, around lines 224-260) build their own meta and never read those fields. So alice can post {method:'agent_device.install_from_source', params:{session:'bob:default', platform:'ios', source:{kind:'url',...}}}. The daemon sees no tenant and no sessionIsolation, so scopeRequestSession (request-admission.ts:37) returns the session unscoped. The install then lands on bob's device and is recorded in bob's session. Retained materializations from this route also have no tenant. The rule to enforce is that every DaemonRequest built from a proxied /rpc call carries the caller's tenant with sessionIsolation: 'tenant'. What enumerates the sites is methodToDaemonRequest and SUPPORTED_RPC_METHODS, not a list of wire fields in the proxy. The best-owned fix is to let the daemon stamp it, because stampAdmittedIdentity already applies an attested tenant to every method. Inside the proxy alone, the minimum is to refuse /rpc methods other than the command and lease methods when authenticate is set. Please add the regression through the real createDaemonHttpServer harness in test/integration/provider-scenarios/remote-proxy-artifact-tenant.test.ts, not the recording stub.

authenticateCaller also does not validate the tenant it gets back (https://github.com/callstack/agent-device/blob/b342c0b/packages/proxy/src/daemon-proxy.ts#L202). It only trims the id. On upload and artifact routes the daemon reads the header through normalizeTenantId (http-authorization.ts:188), which returns undefined for an id outside [a-zA-Z0-9._-]{1,128}. If authenticate returns {tenantId:'alice@example.com'}, uploads are stored with no tenant, and canReadArtifact (artifact-tracking.ts:277) lets every caller read untenanted entries. The /rpc route rejects the same id with INVALID_ARGS, and the daemon's own auth hook rejects it too (http-authorization.ts:119-126). So these routes fail open instead of refusing the request. Please validate the returned id with the daemon's rule and refuse it on failure, as runHttpAuthHook does. Moving normalizeTenantId into contracts would give the proxy and the daemon one shared rule.

Not blocking, take or leave: isRouteWithinTenant copies the diagnostics path parsing and isTenantOwnedSessionName from src/daemon/session-tenant-scope.ts, whose header says that rule is written once on purpose, so it could move into contracts or be owned by the daemon; and the new tenant tests in daemon-proxy.test.ts all use recordingUpstream, so they check the forwarded wire shape and cannot catch the first problem, which one test through createDaemonHttpServer asserting the scoped session per RPC method would cover.

Could the proxy only set x-agent-device-tenant, which buildUpstreamHeaders already stamps? The daemon would treat that header as attested when the request carries the upstream token, through a tenant-trust option or a stock auth hook. Then stampAdmittedIdentity applies tenant and isolation to every method, and authorizeAuxiliaryHttpRequest returns partitioned:true so diagnostics stay guarded. stampRpcTenant and isRouteWithinTenant would go away, and both problems above would disappear because the daemon owns the stamp. This needs a recorded decision (an ADR or a tenant-trust.ts change) that a holder of the upstream daemon token may attest a tenant, plus normalizeTenantId in contracts.

I did not run the tests or the live proxy and daemon scenario. The first problem comes from reading http-rpc-methods.ts, request-admission.ts and session-app-source-deployment.ts at that commit. I did not trace lease heartbeat and release tenant matching, or nested batch step flags beyond batch.ts. I did not verify the live-run results in the PR body.

* origin/main: (83 commits)
  feat(ios): interpret React Native accessibility value semantics (#3589)
  fix(android): reinstall and reselect the test IME helper after it disappears (#3606)
  feat(snapshot): carry provider keyboard observations through acquisition (#3593)
  chore(web): bump managed agent-browser backend to 0.39.0 (#3591)
  fix(fold): report a dispatched pose as unverified when devicectl has no hinge-angle stream (#3587)
  feat(android): expose system-bar membership on snapshot nodes (#3585)
  fix(android): align ADB and Appium field values (#3584)
  test(closure): read committed JSON modules on the merge-base side (#3602)
  fix(ci): preserve manual Android suite timing (#3554)
  refactor(daemon): make the layer folders the declaration (PR 10) (#3520)
  refactor(move): extract the daemon server into @agent-device/daemon (11b) (#3546)
  refactor(daemon): package-local runtime fakes for the remaining daemon ports [11a-4] (#3544)
  refactor(daemon): cut daemon test edges into root data fixtures and fakes [11a-3] (#3517)
  refactor(11a-2): package-local fakes at the daemon ports; root-own command-surface composition tests (#3519)
  test(replay): verify Settings queries and bound scrolling (#3560)
  feat(snapshot): measure Android Appium viewport (#3586)
  fix(ios): verify a fill whose unidentified field moved while it kept focus (#3596)
  refactor(coverage): one fallow config with per-function CRAP ceilings (#3588)
  test: bound CLI promotion cases and align provider budget (#3590)
  fix(metro): report what the dev-server stop proved instead of assuming success (#3575)
  ...
Move normalizeTenantId from the daemon config into @agent-device/contracts/daemon-http so the proxy and the daemon apply one tenant id rule.
… authenticate

With authenticate set, /rpc accepts only the command and lease methods, whose tenant fields the proxy stamps; install_from_source and release_materialized_paths are refused because the daemon builds their requests without those fields. A tenantId outside the daemon's rule now fails the request instead of reaching upload and artifact routes untenanted.
@thymikee

Copy link
Copy Markdown
Member

New head is 26229f8. I merged main in (no conflicts).

  • Fixed: tenant stamp missed install_from_source and release_materialized_paths. With authenticate set, the proxy now accepts only agent_device.command and the agent_device.lease.* methods on /rpc and refuses others with 401. The regression test goes through the real createDaemonHttpServer in remote-proxy-artifact-tenant.test.ts. It sends each method with bob's session and tenant as alice and checks that the daemon sees alice or never sees the call.
  • Fixed: authenticate tenant was not validated. normalizeTenantId now lives in @agent-device/contracts/daemon-http, and the daemon and the proxy both use it. An invalid id fails the request with COMMAND_FAILED (500) before anything reaches the daemon. This adds one proxy unit test and one contracts test.
  • Not changed: isRouteWithinTenant still copies the session-name rule. Letting the daemon trust the proxy's tenant header removes that function, so moving the rule now only adds churn.
  • Not changed: daemon-attested tenant header. It needs a recorded decision that a holder of the upstream token may attest a tenant. This PR keeps the smaller fix that stays inside the proxy. I can open a follow-up issue for it.
  • README: says which /rpc methods authenticate accepts and what happens to an invalid tenant id.

Checks: pnpm typecheck, pnpm lint, pnpm format (no extra changes), pnpm check:layering, pnpm check:daemon-wire-compat (protocol unchanged), and vitest on daemon-proxy.test.ts, daemon-http.test.ts, remote-proxy-artifact-tenant.test.ts, lease-registry-scope.test.ts and request-admission.test.ts. All pass. The new integration test fails when the method refusal is removed.

@thymikee

Copy link
Copy Markdown
Member

This PR is ready. I reviewed 26229f8 as a follow-up to the earlier comment on b342c0b: the proxy now refuses RPC methods that cannot carry a tenant and validates the tenant id, and the integration test in test/integration/provider-scenarios/remote-proxy-artifact-tenant.test.ts covers that refusal. Not blocking, and fine to take or leave: TENANT_STAMPED_RPC_METHODS in packages/proxy/src/daemon-proxy.ts#L233 repeats the daemon method-name tables in packages/daemon/src/server/http/http-rpc-methods.ts, so exporting those sets from @agent-device/contracts/daemon-http next to normalizeTenantId would let both sides share them (drift fails closed today), and the authenticate paragraph in website/docs/docs/remote-proxy.md#L197 could add one sentence on the /rpc method allowlist and the 500 for an invalid tenant id, as the proxy README now does. I read the code and did not run the vitest files or the integration test, and I did not re-run the live proxy and daemon scenarios from the PR body at this head, since the change only adds proxy-side refusal and validation. I also did not trace step-level session overrides in nested batch steps beyond packages/command-registry/src/batch.ts#L322-L336, or lease heartbeat and release tenant matching beyond lease-registry.ts#L160-L215. After the merge of main, every CI lane is queued and none has failed. No conflicts. Before merge, Integration Tests and Typecheck & Package need to go green on 26229f8.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Oct 14, 2026
@thymikee
thymikee marked this pull request as ready for review October 14, 2026 13:26
* origin/main:
  feat(leasing): proxy CLI names each new lease, daemon keeps a caller-chosen lease id (#3479)

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 12 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread packages/proxy/src/daemon-proxy.ts Resolved
Comment thread packages/proxy/src/daemon-proxy.ts Resolved
Comment thread packages/proxy/src/daemon-proxy.ts Resolved
Comment thread packages/proxy/src/daemon-proxy.test.ts Resolved
Comment thread packages/proxy/README.md Resolved
Comment thread packages/proxy/README.md Resolved
Copilot AI balanced review requested due to automatic review settings October 14, 2026 13:33
@thymikee

Copy link
Copy Markdown
Member

New head is 89d24ad. Main is merged in (562e798).

  • Docs: added the tenant id rule and the /rpc method restriction (only agent_device.command and agent_device.lease.*, others get 401; invalid tenant id fails with 500) to the authenticate paragraph in website/docs/docs/remote-proxy.md, matching the proxy README.
  • Merge: resolved a conflict in packages/contracts/src/daemon-http.test.ts, keeping both the normalizeTenantId and buildDaemonHttpLeaseHeaders tests.

Gates: pnpm format, pnpm lint, pnpm typecheck, and targeted tests for packages/proxy, daemon-http, lease-id and daemon-client-rpc, and daemon resources (281 passed).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Upload-ticket rewriting can expose the upstream daemon token, and tenant-session authorization duplicates its canonical rule.

2 open findings
What changed in this PR

Adds per-caller authentication and tenant isolation to the embeddable daemon proxy.

Changes:

  • Adds authenticate(request) and tenant stamping for supported RPC and auxiliary routes.
  • Propagates caller credentials into upload tickets and restricts diagnostics by tenant.
  • Centralizes tenant-ID normalization and expands documentation and tests.
File Description
website/​docs/​docs/​remote-proxy.md Documents authenticated tenant behavior.
test/​integration/​provider-scenarios/​remote-proxy-artifact-tenant.test.ts Adds tenant RPC integration coverage.
packages/​proxy/​src/​index.ts Exports the authentication type.
packages/​proxy/​src/​daemon-proxy.ts Implements authentication, tenant stamping, and ticket rewriting.
packages/​proxy/​src/​daemon-proxy.test.ts Tests authenticated proxy behavior.
packages/​proxy/​README.md Documents the new API and options.
packages/​daemon/​src/​sessions/​request-admission.ts Uses shared tenant normalization.
packages/​daemon/​src/​server/​http/​http-authorization.ts Uses shared tenant normalization.
packages/​daemon/​src/​resources/​lease-registry-scope.ts Uses shared tenant normalization.
packages/​daemon/​src/​core/​config.ts Removes the local normalizer.
packages/​contracts/​src/​daemon-http.ts Defines shared tenant normalization.
packages/​contracts/​src/​daemon-http.test.ts Tests tenant-ID normalization.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/proxy/src/daemon-proxy.ts Resolved
Comment thread packages/proxy/src/daemon-proxy.ts Resolved
@thymikee

Copy link
Copy Markdown
Member

The daemon token leak raised in the open review thread is still present at 89d24ad. My earlier clean review of 26229f8 missed it. The rest of the change looks sound, and the PR now has a defect to fix before merge.

In authenticate mode, rewriteUploadPreflightResponse copies the daemon's ticket headers and only overwrites the client headers that are present. The daemon sets both authorization and x-agent-device-token to its own token (upload-http.ts:291-295). A caller that sends only authorization, as in the README example, gets the daemon token back in x-agent-device-token. A caller that authenticates by cookie or x-api-key gets both. Any tenant can then read the daemon token and skip the proxy and its tenant stamping. The rule is that a ticket the proxy returns never carries an upstream credential. Please remove every header name that buildDaemonHttpAuthHeaders produces from the upstream ticket in both modes, then add the client credential. clientToken mode is already fine.

The ticket test at daemon-proxy.test.ts:357 cannot catch this. Its upstream double returns only x-extra, which the real daemon never does. Please build the fixture headers with the daemon's header builder holding a known token. Add a case where the client sends only x-agent-device-token and one where it sends neither header. Assert in each case that the daemon token appears nowhere in the response.

Not blocking, and you can take or leave these: readClientAuthHeaders forwards only authorization and x-agent-device-token, so a gateway that authenticates by cookie passes preflight but gets a 401 on PUT /upload/direct. One README sentence saying uploads need one of those two headers would cover it.

I did not run the proxy tests or a live proxy with authenticate. I found the leak by reading the daemon's ticket construction together with the proxy rewrite. The PR's live run logged only the PUT header, so it does not confirm or rule out the leak.

The open threads on the preflight leak (cubic P0, Copilot), the lost authenticate credential on direct upload, the authorization-only ticket test and the session-name helper duplication still apply. Two lower-priority threads on hyphenated alias docs and /health wording also still apply. The install-from-source thread does not apply: the refusal is deliberate and documented, and shipped clients send that call as agent_device.command, so remote install still works. Please resolve it.

The Smoke Tests job failed in the Linux desktop apt-get step after a 6 minute timeout, before any repo code ran. This PR does not touch that route, so the failure looks unrelated. The second Smoke Tests job is still queued. There are no conflicts. Before merge, the daemon headers must come out of the tickets and the ticket test must use the real daemon headers.

@thymikee thymikee removed the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Oct 14, 2026
* origin/main:
  fix(daemon): end the session and clear its claim when its lease ends (#3480)
Strip every daemon auth header from the upstream ticket in all modes, then add
the caller's own credential. In authenticate mode the ticket carries the client
headers authenticate read, so cookie or API-key callers pass the direct upload.
Share isTenantOwnedSessionName through contracts/daemon-http, and build the
daemon's ticket headers with buildDaemonHttpAuthHeaders.
Copilot AI balanced review requested due to automatic review settings October 14, 2026 15:25
@thymikee

Copy link
Copy Markdown
Member

New head is c52ab82. Main is merged in.

  • Daemon token leak in upload tickets (P0): the proxy removes every buildDaemonHttpAuthHeaders header name from the upstream ticket in both modes, then adds the caller's own credential. The daemon's upload-http.ts now builds its ticket headers with the same function, so the strip list cannot drift. Ticket tests build the upstream ticket with that builder and assert the daemon token appears nowhere for authorization, x-agent-device-token, cookie and x-api-key callers. They fail on 89d24ad.
  • Credentials for the direct upload: in authenticate mode the ticket carries the client headers authenticate read by name (headers.get/has), minus framing headers. A test sends the ticket back on PUT /upload/direct and checks it passes authenticate as the same tenant. JSDoc and README describe this.
  • Tenant-session predicate: isTenantOwnedSessionName moved to @agent-device/contracts/daemon-http. The daemon and the proxy both use it.
  • README: names the hyphenated RPC aliases, and says GET /health is not authenticated and carries no tenant.
  • install_from_source thread: not changed. The refusal is intended, and clients send these calls through agent_device.command.

Gates: proxy, contracts daemon-http, daemon server/sessions/core and the remote-proxy integration tests; pnpm typecheck; pnpm lint; pnpm format; pnpm check:layering; eager-closure budget tests. All pass.

Smoke on 89d24ad failed in the Linux "Install Linux desktop dependencies" step, before any repo code ran. It was not the Android emulator timeout. Main's recent Linux runs are green or cancelled. New runs are on c52ab82.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 8 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Upload tickets can expose sensitive headers read by the authenticator, including HttpOnly cookies or ingress-only credentials.

1 open finding
2 resolved since last review

🧠 Review effort: Balanced

Comment thread packages/proxy/src/daemon-proxy.ts Resolved
…ck the moved tenant rule

buildUploadTicketAuthHeaders is listed daemon RPC wire surface released in
v0.21.27. Replacing it with buildDaemonHttpAuthHeaders removed that declaration,
and the released-surface gate treats any removal as bump-only. The wire output
did not change, so restore the released declaration rather than bump the
protocol.

isTenantOwnedSessionName moved unchanged into contracts/daemon-http. Point the
manifest and its ledger key at the new path; the gate records it as a move.
Copilot AI balanced review requested due to automatic review settings October 14, 2026 15:49
authenticate now returns { tenantId, uploadHeaders? }. uploadHeaders default
to the client's own authorization and x-agent-device-token headers. The
ticket the proxy returns is the upstream content-type plus those headers, so
no daemon credential can reach a client whatever the daemon's ticket holds.
This replaces the header-read recording and the name-based strip list.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Tenant normalization is missing from wire-compat coverage, and the website documents an incomplete RPC method vocabulary.

1 open finding
Previously missed (2)

In code that hasn't changed since last review

Medium severity Include normalizeTenantId in the protocol acknowledgement ledger

test/​wire-compat/​surface.ts:169

normalizeTenantId now defines the tenant syntax shared by the proxy and daemon, but this authentication wire-surface group does not digest it. A later syntax change could therefore bypass the ledger/protocol acknowledgement even though mixed proxy/daemon versions would disagree about request admission. Add it beside isTenantOwnedSessionName and update the ledger entry.

Low severity Document agent-device RPC aliases as supported spellings

website/​docs/​docs/​remote-proxy.md:200

This states that only the underscore RPC spellings are accepted, but the implementation also accepts the agent-device.* aliases and the package README documents them. Include both forms so the website does not incorrectly describe supported clients as rejected.

🧠 Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 14, 2026 15:59
@thymikee

Copy link
Copy Markdown
Member

New head: bea3137.

5528c82 fixed the wire-compat failure. It restores the released buildUploadTicketAuthHeaders declaration in the daemon and moves the isTenantOwnedSessionName ledger key to its new home in contracts.

bea3137 changes how upload tickets get their credential. authenticate now returns { tenantId, uploadHeaders? }. When uploadHeaders is not set, it defaults to the client's own authorization and x-agent-device-token headers. The ticket the proxy returns is the upstream content-type plus those headers, and nothing else from the daemon ticket. So the daemon token cannot reach a client by construction, whatever headers the daemon puts on its ticket. This also removes the header-read recording and the Request.headers override, which answers the Copilot thread about header serialization. Tests cover a daemon ticket that carries the token under extra header names, custom uploadHeaders (cookie, x-api-key), and an authenticate that never reads headers.

The cubic thread about the install refusal does not apply. The refusal is deliberate and documented. Shipped clients send install through agent_device.command, which the proxy accepts.

Checks run: typecheck, lint, format, vitest for packages/proxy, packages/contracts/src/daemon-http.test.ts, test/integration/provider-scenarios/remote-proxy-artifact-tenant.test.ts and the daemon upload tests, test/wire-compat, check:daemon-wire-compat, and check:layering. All pass.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 5 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread packages/proxy/src/daemon-proxy.ts Resolved
@thymikee

Copy link
Copy Markdown
Member

This is ready for review at bea3137. authenticate now returns the tenant and optional upload headers, and the proxy builds each upload ticket from the daemon ticket's content-type plus those headers, so the daemon token cannot reach a client. The header-recording code and the name-based strip list are gone, and the earlier asks are met.

One hardening note from this review is fixed in 54523d5: when the proxy cannot rewrite a ticket URL to its own origin, the ticket now carries only content-type, so a ticket naming another origin never gets the caller's credential. The proxy tests cover it.

Open threads: the cubic thread on the tenant-stamped RPC refusal (#3476 (comment)) does not apply, because the refusal is documented and shipped clients install through agent_device.command. The Copilot thread on header-read recording (#3476 (comment)) no longer applies, because that code was removed. The other eight threads are fixed at this head and can be resolved.

CI is still running on the new head, with no failures so far. There are no conflicts. I did not run a live proxy with authenticate; this path is HTTP-only and the ticket guarantee is covered by unit tests against the real daemon header builder.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Oct 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Non-rewritable upload tickets can disclose caller credentials to an external upload URL.

1 open finding
1 resolved since last review
Previously missed (1)

In code that hasn't changed since last review

Low severity Update PR description for current head and file count

packages/​proxy/​README.md:93

The PR description is stale: it reports 5 files and validation at b342c0b, while this reviewed head contains 15 changed files and several later fixes. Update the touched-file count and record validation for the current head so the stated checks cover the code being reviewed.

🧠 Review effort: Balanced

Comment thread packages/proxy/src/daemon-proxy.ts Resolved
Copilot AI balanced review requested due to automatic review settings October 14, 2026 16:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The security-sensitive authentication boundary needs final human review, and the recorded full validation predates the follow-up fixes.

0 open findings

1 resolved since last review

🧠 Review effort: Balanced

@thymikee
thymikee merged commit 368e7d5 into main Oct 14, 2026
21 of 23 checks passed
@thymikee
thymikee deleted the feat/proxy-authenticate branch October 14, 2026 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants