Connectors become a per-coworker allowlist (OPE-93)

Sessions expose declared-and-connected only; 'all' is builtin-only; legacy true
migrates to the recommended refs, else nothing. Consent lists real names and
per-connector caps force re-consent when an update widens the grant.
This commit is contained in:
Rohit C Prasad
2026-08-15 10:34:43 -07:00
committed by Rohit P
parent 5f2eeca1c8
commit 4ed112b8eb
12 changed files with 191 additions and 19 deletions
+6
View File
@@ -282,6 +282,12 @@ def build_engine(
registry.register(request_tool_tool())
if agent.connectors:
enabled_connectors, enabled_tools = _enabled_connector_tools(secrets)
# Least-privilege grant (OPE-93): a persona with an allowlist gets ONLY the
# connectors it declared — an undeclared connector's tools never enter the
# session, no matter what the user has connected. True = general personas
# (Cowork) that legitimately drive whatever is connected.
if agent.connectors is not True:
enabled_connectors = enabled_connectors & set(agent.connectors)
# Per-session connection hierarchy (UI-REFRESH §4.3): when the caller supplies the session's
# effective connector set, intersect it so only effective-enabled connectors expose tools.
# Default None preserves CLI / direct callers (no per-session restriction).