ADR-0089: A connected app's tools, narrowed per workspace¶
Status: Accepted Date: 2026-10-23 Deciders: Alex Nodeland Amends: ADR-0085, whose tools were the operator's alone; beside ADR-0087
Context¶
ADR-0085 offers a connected app's read and edit tools wherever the app is switched on, and its code and network tools only where the operator allows each by name. The owner decided (2026-10-22) that a workspace may narrow these by tool, as a setting tenants and workspaces may only narrow (lattice ADR-0030). For that to mean anything, the operator also needs a way to withhold read and edit tools.
Decision¶
- The operator's layer is
Connection(offer=..., allow=...).offernames thereadandedittools the operator offers; every one by default. Naming any other tool is refused as the connection is made.allownames thecodeandnetworktools, as before.- Together they are the most any workspace offers.
- Each app has a
Subsetsetting,connect-tools:<app>, declared in lattice-core and settable down to the workspace.- Its universe is every tool the vetted entry names, other than
hosttools. lattice-core holds it asCONNECTED_TOOLS, since it can't import artifactr. - An artifactr test holds the two lists equal. When it fails, its message names the file to edit.
- Its default is the whole universe, so nothing changes until someone narrows it.
- Its universe is every tool the vetted entry names, other than
Connection(workspace_tools=tools_setting(grants, app))reads it.- The tools a workspace offers are the operator's
offerandallow, intersected with the setting. - The setting is read with no cache at each listing, and again at each call: a tool narrowed out between the two is refused at the call. The check is made as the call starts, not atomically with it: a narrowing that lands while a call is already under way doesn't stop that call, and stops the next.
- The app's switches (
connect:<app>,connect-code:<app>) and the person's action still gate as before. The setting only ever removes more.
- The tools a workspace offers are the operator's
- It fails closed. A setting that can't be read, or isn't names, offers no tools, at the listing and at the call alike.
- Wiring it is the application's. For the setting to narrow from the operator's layer, the operator's value in grantr's
operator_settingsis the same list asofferandallowtogether. Otherwise it narrows from the registry's default, and the intersection withofferandallowstill holds.
Consequences¶
- Easier: a workspace offers FreeCAD's reads without
create_object, or a code tool without the others, with no deploy. - Harder: a tool vetted later is added in two places, which the test enforces.
- Follow-ups: the admin page's checkboxes for these settings, with a way in for a workspace's admins (#627).