Skip to content

fix(lease): check the request platform against the lease backend #4234

Open

Description

@kacper-mikolajczak

Purpose

Make lease admission check that a request's platform matches the lease backend. Today a web request runs under a lease for another platform.

Current behavior

Under --session-isolation tenant, every request that is not lease-exempt needs a lease. No lease backend maps to web, and admission never compares the request's platform with the lease backend; only macos-app leases confine the platform. So a tenant can allocate an ios-simulator lease and run open --platform web under it:

agent_device.lease.allocate  { tenant: t1, runId: r1 }           # no backend given: ios-simulator
agent-device open https://example.com --platform web \
  --session-isolation tenant --tenant t1 --run-id r1 --lease-id <id>   # admitted

This predates #4191. That PR's tenant live run uses an ios-simulator lease for this reason.

Required behavior

Choose one, then implement it:

  • (a) Add a web lease backend, and refuse a request whose platform does not match its lease backend with a typed reason (for example LEASE_SCOPE_MISMATCH).
  • (b) Refuse web requests under tenant isolation with a typed reason until a web lease backend exists.

Completion conditions

  • A router test: open --platform web under an ios-simulator lease is refused with the typed reason.
  • Under (a): a web open under a web lease is admitted, and ADR 0007 lists the backend.

Dependencies

None. Related: #4190, #4191.

Activity

  1. added
    bug
    on Nov 6, 2026
  2. thymikee commented on Nov 6, 2026

    @thymikee
    Member

    Triage: bug; this needs a maintainer decision between your options (a) and (b). Main confirms the gap: LEASE_BACKENDS has no web entry, the macOS app lease is the only platform check at admission, and ADR 0037 lists this under open gaps. Once an option is chosen, this becomes ready for an agent with your completion conditions.

  3. thymikee commented on Nov 22, 2026

    @thymikee
    Member

    ADR 0040 alignment (ADR)

    Decision: lease target policy: Carry this case into the single descriptor and lease admission decision using the verified lease and the requested or resolved target, before any resource effect. #4942 already compares supplied lease labels. Add route proof for the actual execution backend, including nested requests and creation. Decide the released tenant-web behavior explicitly before changing it: add a web-compatible lease policy or retire the existing pairing with the applicable compatibility decision. Link that decision to #4965 and #4971.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions