Skip to content

ADR-0005: Security Broker integration

Status: Accepted — 2026-09-23. The project owner approved this decision. Acceptance establishes the architectural contract; it does not establish a completed implementation or successful execution of outstanding checks.

Accepted refinement — 2026-09-24: the same broker boundary serves CLI and machine callers, with trusted task authority and separate actor/subject bindings under ADR-0013/0014. This does not change the original acceptance date or complete the outstanding integration checks.

English | Русский

ADR-0002 places access checks in the core and lets the CLI owner register trusted services. ADR-0003 preserves that boundary in process IPC. Security Broker provides a common integration point for identity, permissions and extension discovery before any extension code runs.

A company must be able to connect its identity gateway and permission service without maintaining a separate Rukh client for every vendor. Existing proprietary services must also fit this boundary. Extension authors declare required actions, query permitted actions and request protected operations through the core. The extension loader obtains the permitted set of broker-dependent extensions through the same integration; its complete contract is a separate architecture topic.

This ADR defines the integration point, protocol profiles and custom integration path. It does not classify extensions by authorization frequency, connectivity or synchronization strategy. Decision freshness, storage, renewal and revocation policy, the detailed credential-storage contract, the KCL schema and the loader’s implementation are separate decisions.

The related decisions now define the core composition boundary, credential/session lifecycle and authorization validity and revocation. These separate accepted decisions define the related contracts; references do not establish implementation.

  • One trusted integration used by discovery and execution.
  • Standard connections configured without vendor-specific SDKs; custom adapters only where the published protocols do not cover the organization service.
  • Separate declared requirements, available facilities and granted permissions.
  • A permitted extension list without launching its code or preparing its runtime.
  • Preserve core-owned identity, restricted scope and the existing failure rules.
OptionBenefitLimitation
Each extension connects to a brokerIndependent integrationsDuplicates identity and permission handling; cannot govern discovery before startup
Integrate permissions only in the loaderOne filtered catalogDoes not cover command permissions or protected core operations
A client for each identity or permission productDirect access to vendor featuresRepeated maintenance and product-specific behavior in the CLI
A shared boundary with protocol clients and replaceable adaptersConsistent identity and decisions; standard integrations use configurationRequires an explicit mapping between identity, organization permissions and extension metadata

Security Broker composes identity, authorization and permitted-extension discovery behind one core boundary. Standard integrations use OIDC/OAuth and AuthZEN protocol clients; an owner-supplied adapter can replace any required part. The broker supplies access information and decisions; the core applies them. Command extensions use the core contract.

The name denotes a responsibility, not a required standalone server. The three roles can use different services, or one organization gateway can implement them together. The broker does not become the installer, executor or implementation of every protected operation.

Rukh also supports an explicitly selected local policy and a static catalog without organizational sign-in or external services. ADR-0009 defines this baseline and catalogs, groups and rules maintained as code. Identity is required only when the selected rules or protected resource require a verified subject. An unauthenticated/local context never impersonates an organizational identity.

Built-in declaration providers and remote integrations use the same discovery and access contracts. A broker configuration may select local rule evaluation as its authoritative provider; it need not call a remote permission server. A binding that requires a particular external authority remains mandatory. Selecting the public baseline or changing configuration cannot remove it, and an unavailable provider never triggers a permissive local fallback. Owners add identity, catalog and permission services independently, without changing extension code.

RoleResponsibilityIntegration
Identity providerAuthenticate a user or an explicitly supported service identity; return a verified identity and protected credential referencesOIDC client, domain authentication adapter or custom identity adapter
Authorization providerDecide an action on a resource for the bound context; supply permitted-action informationBuilt-in local rules, AuthZEN client or custom permission adapter
Extension discovery providerProduce permitted, bounded extension references tied to trusted catalog metadataStatic catalog with local rules, AuthZEN resource search with a catalog mapping, or custom discovery adapter

These are logical interfaces behind Security Broker, not three mandatory processes or complete SDK APIs. Choosing a different identity gateway need not replace authorization or discovery. One organization-specific adapter may implement several roles, but it still preserves their separate meanings. A successful login is not permission to install an extension or execute a command.

The owner defines a trusted identity mapping between the roles. OIDC identity uses the issuer and subject together, not email or display name. Directory identities likewise retain their authority and stable identifier. Any translation into an existing permission service’s user IDs is explicit; matching two accounts by a display attribute is insufficient. OIDC identity rules.

ParticipantWhat they add or select
CLI owner / integration developerRegisters supported protocol clients and any custom adapters, and defines trusted connection profiles and identity/action mappings
CLI userChooses an owner-approved profile and signs in if its rules require identity; adds a profile only within owner-defined configuration rules
Extension authorDeclares an access domain, command requirements and requested operations in extension metadata; calls the core’s published operations

Adding a standards-compatible gateway is a configuration task. The owner or authorized user creates a connection profile using registered protocol implementations. New adapter code is added as a trusted library dependency and registered when building the branded CLI. Profile settings do not load arbitrary code. A command extension cannot install a broker adapter, replace a permission rule or redirect checks to its own server.

The owner binds a stable access domain to one broker configuration and one authoritative authorization provider. The domain distinguishes organizations or permission namespaces; it is not an endpoint URL supplied by an extension. The configuration selects identity, authorization and discovery implementations independently, with explicit identity mappings between them. It does not combine arbitrary providers’ allows.

Connection profile containsPurpose
Access domain, registered implementation IDs and their contract versionsSelect known responsibilities and compatibility
Trusted identity issuer, application client_id, permitted sign-in flows, scopes and redirect settingsConfigure the generic identity client
Local rule source or authorization service with expected API audience and protected credential referencesSelect authoritative evaluation; remote credentials are needed only for a selected service that requires them
Approved catalogs, publisher namespaces and identity/action/resource mappingsConnect permission data to real extensions and protected operations
Endpoint and certificate trust policy, including an approved corporate CA where neededValidate connections; metadata discovery cannot disable TLS verification or expand trusted destinations

This table defines meaning, not a configuration syntax. Only settings required by selected implementations apply; a local catalog does not require an OIDC client or service endpoint. The user selects an allowed profile and, when needed, an account; changing the profile does not change owner policy. Implementation facilities and mapping conflicts are checked before use. The authenticated subject and the integration’s own service identity remain distinct: service credentials must not replace the user’s identity when evaluating that user’s access. Active invocations retain their bound domain and subject; selecting another account does not rebind them.

The view shows responsibilities, not process boundaries. Both the loader and execution checks consume the same broker contract.

Accepted Security Broker integration boundary
Accepted Security Broker integration boundaryThe CLI owner configures Security Broker from identity, authorization and discovery implementations. The loader and core access checks share that boundary. Extensions cannot select providers. Protected core services remain separate.CLI ownerSecurity BrokerCommand extensionCore access checksExtension loaderOIDC, domain or customidentityLocal rules, AuthZEN orcustom permissionsCatalog and permissionmappingTrusted core serviceRegisters and configuresDeclared core requestsPermitted extension discoveryAction queries and decisionsIdentity when requiredAccess decisionsPermitted referencesAuthorized operationAccepted Security Broker integration boundaryThe CLI owner configures Security Broker from identity, authorization and discovery implementations. The loader and core access checks share that boundary. Extensions cannot select providers. Protected core services remain separate.CLI ownerSecurity BrokerCommand extensionCore access checksExtension loaderOIDC, domain or customidentityLocal rules, AuthZEN orcustom permissionsCatalog and permissionmappingTrusted core serviceRegisters and configuresDeclared core requestsPermitted extension discoveryAction queries and decisionsIdentity when requiredAccess decisionsPermitted referencesAuthorized operation

Select protocols by responsibility, not by product name. Keycloak supports standard OIDC integrations, so a Keycloak-specific SDK or Admin API is not required for sign-in. Application registration at the identity provider, including client_id and allowed redirects, is still necessary; standard clients remove vendor code, not this administrative configuration. Keycloak protocol support, native application registration.

Integration needSelected pathBoundary
Interactive user sign-inOIDC with Authorization Code and PKCE (S256), using the external system browser and a registered native-app redirectThe CLI is a public client; no embedded shared client secret, password grant or embedded login page
Sign-in without a browser on the CLI hostOAuth Device Authorization Grant when the configured provider supports itUse the provider’s approved verification URI; complete identity through its supported OIDC profile or a trusted identity adapter, not by treating any access token as proof of identity
An OIDC-capable corporate gatewayThe same protocol client with another trusted issuer/profileNo product-specific user/group management API required
A directory or a gateway without OIDCFederation through an organization-approved OIDC gateway, or a registered domain/custom identity adapterThe selected connection declares platform and authentication requirements
A standard permission APIAuthZEN Authorization API 1.0 for access evaluation and supported search facilitiesIdentity mapping and the application’s action/resource vocabulary remain owner configuration
An organization-specific APICustom adapter for the affected role, or a server-side bridge exposing the selected standardsThe core and command extensions retain the same contract

For browser sign-in, use a short-lived loopback listener bound to the local interface with request correlation; close it on completion, cancellation or timeout. Validate the approved issuer/metadata, callback state, PKCE binding, and the ID token’s signature, issuer, audience, nonce and validity. A token’s claims are accepted only after validation. Discovery supplies endpoint/key metadata for a trusted issuer; it does not select a new trusted authority. Native-app OAuth, OIDC validation, OIDC Discovery.

Device sign-in observes the server’s polling interval, pending/slow-down responses, expiry and cancellation. It is a declared option, not an automatic downgrade after another flow fails. An API access token is intended for its target service; an ID token is not an API credential. Device Authorization Grant, OAuth security guidance.

The sequence shows the OIDC profile. Identity validation precedes access decisions; it does not itself return a list of allowed commands. An error or cancellation at any step ends the exchange and releases temporary resources; subsequent arrows are not performed after that failure.

Accepted protocol-based sign-in
Accepted protocol-based sign-inThe core uses an approved profile and a generic OIDC client. Sign-in occurs in the external browser with the identity provider. Only validated identity is bound to the access domain. Failure or cancellation creates no access context.Trusted identity providerSystem browserCore and OIDC clientUserTrusted identity providerSystem browserCore and OIDC clientUseralt[Valid response and sign-in still active][Failure, invalid identity or cancellation]Select approved profile and sign inValidated discovery for configured issuerProvider metadata and supported facilitiesAuthorization Code request with PKCE and correlationUser authenticationRedirect with authorization codeCorrelated local callbackCode exchange with PKCE verifierToken response or errorValidate and bind issuer, subject and access domainSigned in, permissions checked separatelyClose listener and discard incomplete contextDefined sign-in errorAccepted protocol-based sign-inThe core uses an approved profile and a generic OIDC client. Sign-in occurs in the external browser with the identity provider. Only validated identity is bound to the access domain. Failure or cancellation creates no access context.Trusted identity providerSystem browserCore and OIDC clientUserTrusted identity providerSystem browserCore and OIDC clientUseralt[Valid response and sign-in still active][Failure, invalid identity or cancellation]Select approved profile and sign inValidated discovery for configured issuerProvider metadata and supported facilitiesAuthorization Code request with PKCE and correlationUser authenticationRedirect with authorization codeCorrelated local callbackCode exchange with PKCE verifierToken response or errorValidate and bind issuer, subject and access domainSigned in, permissions checked separatelyClose listener and discard incomplete contextDefined sign-in error

Active Directory and organization gateways

Section titled “Active Directory and organization gateways”

Active Directory is a directory/service family, not an alternative protocol to OIDC. When the organization exposes identity through an OIDC-capable federation service, the CLI uses the standard OIDC profile. AD FS is one such integration route when its deployed configuration supports the required flow. It does not imply that AD DS itself exposes an OIDC endpoint. AD FS OIDC concepts.

For direct domain integration, an owner-registered adapter uses platform authentication facilities, such as Kerberos through Windows SSPI or an appropriate GSSAPI implementation. The profile binds the intended service identity and allowed authentication mechanism; the adapter verifies the established context, rather than trusting an environment variable or supplied username. If Kerberos is required, Negotiate must not silently fall back to NTLM. Availability is declared per adapter/platform, not promised for every CLI build. Windows SSPI and Negotiate.

LDAP directory data can supply verified attributes or group membership through an approved, protected directory connection. Membership is input to the owner’s explicit permission mapping, not a universal command grant. Missing required attributes do not mean unrestricted access. A SAML-only organization can keep SAML behind its identity bridge; command extensions do not parse SAML assertions or directory responses.

Custom services without the selected protocols

Section titled “Custom services without the selected protocols”

An organization is not required to replace its existing identity or permission system. Two integration paths preserve the same core boundary:

PathWhat the organization suppliesWhat changes in the CLI
Protocol bridgeA trusted service translating its existing APIs to OIDC for identity and/or AuthZEN for permissions, with the required catalog mappingApproved connection settings; existing protocol implementations are reused
Library adapterA trusted implementation of only the missing identity, authorization or discovery role, using the organization’s own API or libraryOwner registers the dependency and builds the CLI; unaffected standard roles are reused

For example, OIDC sign-in can be combined with an existing internal permission API and an approved package catalog. Only the permission mapping needs custom code. A fully custom gateway can implement all three roles. Neither case requires changing extension code or a broker-specific client in each extension.

A custom identity adapter is not required to issue OIDC tokens or JWTs. It validates the organization’s own authentication evidence and returns the common authority/subject binding with protected references to any credentials. It preserves the separation of user identity from API authority and cannot silently downgrade the configured authentication requirements.

The adapter must authenticate its service connection, validate responses, bind identity to a trusted authority, map actions/resources without enlarging scope, preserve errors, cancellation and required audit, and keep credentials in core-owned protected storage. It returns typed data and restricted credential handles, not arbitrary claims declared trustworthy by the caller. Missing facilities are explicit. Configuration may select approved mappings; it is not a general-purpose script or unrestricted HTTP proxy supplied by an extension.

An adapter cannot claim OIDC/AuthZEN conformance merely because it returns similar JSON. The chosen protocol implementation must meet that protocol’s requirements; proprietary mappings are declared as custom. Product-specific extensions are confined to the adapter and do not become mandatory fields in the common extension contract.

Permissions and extension discovery through protocols

Section titled “Permissions and extension discovery through protocols”

AuthZEN separates evaluation of subject / action / resource / context from searches for permitted resources or actions. Rukh maps its trusted context into that model. OIDC login, OAuth scopes and directory groups do not automatically define Rukh’s per-command rights. The owner supplies that mapping explicitly. AuthZEN Authorization API 1.0.

The adapter declares supported evaluation/search facilities. A bounded action query may be implemented by evaluating its known candidates when search is unavailable; an incomplete scan cannot masquerade as a complete permitted-extension catalog. Discovery combines the approved catalog universe with permission evaluation or maps authorized search results back to verified catalog entries. AuthZEN does not supply package metadata, release verification or a Rukh extension catalog format.

The broker’s own connection authentication is separate from the subject whose rights are evaluated. Only the trusted integration supplies that subject to a service that accepts the configured mapping; extension messages cannot impersonate it. Tokens are used only for approved recipients and purposes, never forwarded to an arbitrary endpoint from metadata. Obtaining downstream credentials is a distinct scoped core service, not an implicit consequence of login or an allow response.

These are normative logical request and result types for the selected adapter contract, not an HTTP or extension IPC format. A library binding may rename methods but must preserve these fields and outcomes. The adapter contract is distinct from the extension-facing service contract of ADR-0002. Protocol clients translate their remote responses into these types; a remote service need not implement Rukh-specific fields itself.

ResponsibilityCore-supplied inputResult
Bind access contextApproved profile and trusted identity contextDomain and subject binding, supported contract and facilities; or an explicit connection/identity error
Discover permitted extensionsAccess context, bounded query and continuation within that queryA page of permitted extension references and safe display metadata, with explicit continuation/completeness; or an error
Inspect permitted actionsAccess context and a bounded set of declared action/resource candidatesPer-candidate information about permission, without performing an action or issuing a reusable grant
Decide a protected actionTrusted subject and domain, canonical extension/release, command and invocation kind where applicable, action, resource and relevant validated inputsAllow, deny or indeterminate, bound to that request and any enforceable scope restrictions

Every request carries a core-generated requestId, an owning activityId, accessDomain, profileRevision, configRevision, a trusted principalBinding, a deadline and the operation-specific data. configRevision is the exact ownerConfigRevision from ADR-0007/0009, not another independently changing identifier. profileRevision identifies the active profile record from which the request was admitted. These revisions fix client configuration; they do not pretend that a remote directory or policy service has stopped changing.

Binding/resultRequired fields and meaning
Principal bindingkind: local / user / service; an opaque core-owned bindingId; for verified identities, an authority-qualified stable subject, the validating identity-provider registration and its authentication context. A local context has no fabricated verified subject.
Access contextAccess domain, principal binding, selected provider registrations and versions, and the applicable configuration revision. Binding proves neither a permission nor that all future requests will succeed.
DecisionrequestId, configRevision, effect: allow / deny / indeterminate, a bounded reasonCode, and any restrictions. It is tied to the core’s exact action/resource and validated inputs; it cannot substitute them. A provider’s own policyRevision and decision reference are optional diagnostics and must be marked unavailable when the provider supplies none.
Action inspectionOne result per requested candidate ID, each with the decision meaning above. No omission is interpreted as an allow. This response is advisory; it is not a reusable credential or a token for a subsequent operation.
DiscoveryrequestId, configRevision, consistency, bounded entries, exhausted, and optional continuation and source revision. The pagination rules below define their meaning.
FailureA typed code with safe diagnostics and request correlation. It is distinct from deny; neither failure nor indeterminate dispatches a protected operation.

The core alone constructs principalBinding. For OIDC, authority and subject are the validated issuer and sub; for domain/custom adapters, the registration declares the issuer/realm and stable subject syntax. Subject IDs remain exact, case-sensitive strings unless that registered authority defines and validates a canonical representation. Email, display names and an unqualified username cannot be identity keys. User and service subjects with the same text remain different principal kinds. Signing in again, signing out or changing account creates or invalidates a binding; an earlier cursor or response cannot attach to a new binding merely because the displayed username matches.

An invocation pins its identity, authority and service implementations under ADR-0002. Before each new protected request, the core captures the applicable current policy revision through ADR-0007’s active profile record and intersects it with the invocation’s original restrictions. A compatible policy-only update may narrow or allow actions still inside those original restrictions; it cannot add undeclared operations, change the subject, or replace the pinned authority/implementation. If a configuration migration no longer admits those bindings, the request fails with context_invalidated; a fresh invocation may use the new configuration. Old allows are never carried into a different authority. This rule defines context selection, not a mandatory network call or a decision-cache lifetime.

The default limits below bound the integration itself. Owners may configure other finite limits within an implementation’s supported range; neither a command nor a remote response can increase them. The effective deadline is always the earlier of this limit and the owning activity’s remaining budget.

LimitDefault
Access binding without interactive sign-in, decision or action inspection10 seconds per request
Explicit sign-in activity5 minutes total; provider expiry and cancellation can end it sooner
Action inspection100 candidates; each has a distinct ID and known action/resource schema
Discovery page50 entries requested by default, at most 200; at most 1 MiB of decoded UTF-8 JSON
One discovery traversal10,000 returned entries, 60 seconds total and at most 200 pages; reaching a limit is reported, never marked as a complete snapshot
Other normalized requests/resultsAt most 256 KiB of decoded UTF-8 JSON each
CursorAt most 4 KiB; expires after 5 minutes or earlier context/query expiry
Human-readable reasonAt most 256 UTF-8 bytes for a code and 2 KiB for a safe explanation; no tokens or raw remote responses

Size checks apply to decoded content, not only compressed transfer size. Remote transport clients also bound headers, decompression and redirects under their approved connection profile. Unknown required result fields, duplicate JSON keys, inconsistent correlations and unenforceable restrictions are invalid_response. Optional provider metadata is admitted only through a declared, bounded extension point; an adapter cannot mark an unknown security requirement optional.

The core checks request/response contracts and retains its own policy. Effective access cannot exceed the intersection of owner policy, the subject’s permissions, trusted extension scope, the selected command’s declaration and invocation restrictions. An adapter’s allow cannot override those limits. Unsupported mandatory restrictions, an unrelated response or indeterminate authorization cannot become an allow.

Operations and permission actions are different: an operation provides a facility; an action expresses authority over a resource. A trusted registration maps the operation and its validated inputs to the relevant action and actual target. Arbitrary extension-supplied action names, URLs or resource labels cannot authorize a different operation. Stable namespaces and mappings prevent one publisher from reusing another’s authority; exact identifier syntax belongs to the descriptor contract.

All calls are bounded and cancellable by their owning core activity. A loader request has its own activity context, not a fabricated extension invocation. Invoked extensions retain ADR-0002/0004 admission and finalization rules. Broker responses never execute a command, install an extension or dispatch a protected operation by themselves.

The KCL schema must represent the following meaning; its syntax is a separate contract:

DeclarationMeaning
Access domain and broker dependencyWhich owner-bound authority is required; neither field grants access or chooses an adapter implementation
Canonical command and invocation kindThe identity and separate execute / describe scope already established by ADR-0002
Requested operations and actionsKnown contracts, resource constraints and required/optional use; mandatory support and mandatory pre-launch access remain different requirements

Publishing a declaration does not create permissions in the organization’s service. The owner or a delegated administrator makes its action/resource vocabulary known to the integration and binds the publisher’s namespace. Unrecognized mandatory requirements remain unsupported. Introducing a new protected facility requires a trusted service registration; declaring it in an extension is insufficient.

An extension can submit a bounded list of its declared action/resource candidates to the core and obtain the permitted subset or a defined error. The query itself is subject to scope and disclosure rules. It cannot enumerate other users, arbitrary permissions or hidden extensions. This is useful for choosing available behavior or asking the core to present suitable UI; it grants no right to act. It can also ask the core to perform a declared operation. The core derives the real action and resource again at that operation’s access check and calls the registered service only if allowed.

An action query is optional, not a required preliminary step for every operation. Checks at the core boundary do not prescribe a remote broker request on every call. Rules for decision validity and synchronization are a separate decision; the extension cannot choose that policy or bypass a check.

The sequence separates information from enforcement. Broker interaction is logical and does not imply a network round trip for each arrow.

Accepted action query and protected operation
Accepted action query and protected operationAn extension may query declared action candidates through the core. That response is advisory. A later operation uses a separate core access check, trusted context and registered action mapping; denial, unavailable authorization or finalization prevents dispatch.Core serviceSecurity Broker boundaryRukh coreExtensionCore serviceSecurity Broker boundaryRukh coreExtensionopt[Need permitted-action information]alt[Allowed, required audit satisfied and invocation active][No valid permission or invocation closing]Declared action/resource candidatesCheck scope and permitted disclosureInspect candidates in trusted contextPer-candidate results or errorScoped information, not a grantDeclared operation and inputsValidate and derive action and actual resourceDecide within trusted access contextAllow, deny or indeterminatePerform scoped operationResult or operation errorOperation responseDefined error without dispatchAccepted action query and protected operationAn extension may query declared action candidates through the core. That response is advisory. A later operation uses a separate core access check, trusted context and registered action mapping; denial, unavailable authorization or finalization prevents dispatch.Core serviceSecurity Broker boundaryRukh coreExtensionCore serviceSecurity Broker boundaryRukh coreExtensionopt[Need permitted-action information]alt[Allowed, required audit satisfied and invocation active][No valid permission or invocation closing]Declared action/resource candidatesCheck scope and permitted disclosureInspect candidates in trusted contextPer-candidate results or errorScoped information, not a grantDeclared operation and inputsValidate and derive action and actual resourceDecide within trusted access contextAllow, deny or indeterminatePerform scoped operationResult or operation errorOperation responseDefined error without dispatch

For broker-dependent extensions, the loader obtains the permitted extension set through Security Broker. The adapter must provide that discovery facility even if the organization’s permission API alone has no catalog search. It may combine an approved catalog with permission information internally; the loader must not replace a missing broker result with the unfiltered catalog.

A discovery entry must identify the authoritative namespace and extension, its access domain, any release restrictions, and an approved catalog reference sufficient for the loader to resolve it. Safe display metadata is optional. The precise release/catalog format belongs to the loader’s separate contract. A bare name or arbitrary download URL is not a trusted installation target. The adapter has no unrestricted network authority merely because it returns a source reference.

The loader applies source trust, release integrity, compatibility and owner policy in addition to broker eligibility. It obtains artifacts through its own approved source integrations. Security Broker is part of the loading path through this contract, while downloading, verification, installation, update and activation remain loader responsibilities.

This sequence describes the boundary the loader must preserve, without deciding its storage or source protocols.

Accepted permitted extension discovery for the loader
Accepted permitted extension discovery for the loaderThe loader requests permitted extensions through Security Broker, resolves references only through approved sources and applies its own checks. Missing broker information is an error, not a full catalog. No extension code or runtime is needed for discovery.Approved sourceSecurity Broker boundaryExtension loaderApproved sourceSecurity Broker boundaryExtension loaderalt[Valid page for this context][Missing, invalid or unavailable result]Permitted extensions for trusted access contextExtension references, restrictions, continuationResolve approved references to metadataDescriptors and release identityCheck identity, trust and compatibilityPresent eligible entries with completenessDiscovery errorReport error without broadening the listAccepted permitted extension discovery for the loaderThe loader requests permitted extensions through Security Broker, resolves references only through approved sources and applies its own checks. Missing broker information is an error, not a full catalog. No extension code or runtime is needed for discovery.Approved sourceSecurity Broker boundaryExtension loaderApproved sourceSecurity Broker boundaryExtension loaderalt[Valid page for this context][Missing, invalid or unavailable result]Permitted extensions for trusted access contextExtension references, restrictions, continuationResolve approved references to metadataDescriptors and release identityCheck identity, trust and compatibilityPresent eligible entries with completenessDiscovery errorReport error without broadening the list

Discovery does not prepare environments, load executable integration code from a package or run extension handlers. It is available before an extension is installed. Installation of the broker adapter itself cannot depend on discovery through that same unconfigured adapter.

The required access domain is bound by owner policy and verified source metadata, not solely by a package’s claim. An extension declaration may add requirements; omitting or changing them cannot remove the owner’s broker requirement. The loader preserves that binding when resolving the same extension through another source or updating its release.

Permission to see an extension does not permit every command or operation it contains, nor does it prove the selected release is trusted or installable. Installation and activation keep their own checks; execution keeps ADR-0002 checks. An already installed copy cannot bypass its broker dependency. Conflicting identities, a changed domain or an unapproved source cannot be silently treated as the same authorized release.

An empty successful result means no matching permitted entries for that query under its declared consistency. A partial result stays partial; an error is not an empty successful catalog. Every connection profile declares the discovery modes it permits, and every response names the selected mode. The default is snapshot; permitting live is an explicit owner choice, not recovery from a snapshot failure.

ModeRequired guarantee
snapshotThe traversal fixes the catalog contents and all permission inputs used to filter that traversal. All pages refer to those same revisions and principal binding. The local catalog/group/rule provider implements this baseline from one immutable configuration version. A remote adapter advertises it only if its sources can retain the required revisions, or it has safely materialized a bounded result.
liveClient configRevision, domain, principal binding and normalized query remain fixed, but the configured external source may change between pages. The adapter declares that additions, removals or permission changes may affect the traversal. exhausted: true means the source ended this traversal, not that it returned one complete snapshot at a moment in time.

An unchanged catalog digest alone does not establish a snapshot if its authorization results come from a changing service. Conversely, snapshot consistency of discovery is not a permission to install or execute later: those actions retain their own checks. A profile requiring a snapshot receives snapshot_unavailable when the provider cannot preserve it; the adapter must not switch to live or silently restart halfway through a result.

Materialization is a storage technique, not a stronger consistency guarantee. It qualifies as a snapshot only when the collected catalog and permission inputs share retained revisions or a coherent snapshot provided by their source. Caching the output of sequential evaluations against changing live policy cannot turn it into snapshot.

For snapshot results, entries are ordered by canonical extension identity and exact release identity where releases are enumerated; a canonical entry appears once. A live provider reports its ordering and stable entry key, and the adapter deduplicates identical keys within the bounded traversal. Repeated keys with conflicting data fail with invalid_response. Live mode makes no promise to include records added behind an already consumed cursor.

exhausted: true forbids a continuation token. exhausted: false requires a usable continuation or a typed incomplete-result error; the adapter cannot simply omit the rest. An empty intermediate page is valid only with progress toward a distinct continuation. A repeated cursor without progress is invalid_response. Entries already displayed before a later error remain explicitly incomplete; the error never converts them into a complete snapshot or triggers installation.

Continuation is opaque and bound to accessDomain, principalBinding.bindingId, configRevision, provider registration, selected consistency, normalized query, ordering and page-size limit. Snapshot continuation also binds all source revisions. The core/adapter validates this binding through protected local state or authenticated cursor contents; it never trusts editable cursor fields as authority. A remote provider cursor stays inside that binding. Cursors carry no general API credentials and never grant an operation.

Configuration change, invalidated identity or provider replacement makes an old traversal unusable; it returns context_invalidated. Expiry returns cursor_expired; a malformed or unrelated cursor returns invalid_cursor. A caller can explicitly start a new read-only traversal, without merging its pages into the previous result. There is no automatic retry of installation or another external action. A provider unable to retain a snapshot within its bounded resources returns limit_exceeded or snapshot_unavailable; completeness cannot be inferred from a truncated page.

ConditionRequired behavior
No required broker binding, unsupported facility or unknown mandatory actionExplicitly unavailable/unsupported; no replacement by permissive local policy
Access deniedNo protected dispatch; expose only a safe explanation
Authorization indeterminate or invalid responseNo allow; preserve the distinction from a policy denial
Identity/domain mismatch or attempted context substitutionReject the request or response; never apply it to another account, extension or invocation
Cancellation, deadline or finalizationStop admitting new actions; ignore late permission results for dispatch and retain the existing final outcome rules

The adapter failure vocabulary is invalid_request, invalid_response, authentication_required, context_invalidated, unsupported, unavailable, deadline_exceeded, cancelled, limit_exceeded, invalid_cursor, cursor_expired and snapshot_unavailable. Authentication required is an explicit result; it does not secretly start a browser or substitute a local subject. For an invocation, these are operation failures mapped through ADR-0002, not new final-outcome codes. Required pre-launch checks and required audit retain their existing stronger consequences. Provider diagnostics preserve the distinction between policy denial and failure to establish a decision, while remaining safe to disclose.

Local authorization for CLI features outside a broker dependency remains possible under ADR-0002. It is not a fallback when a required broker integration fails. Selecting another profile cannot strip a verified broker requirement. Composition of several independent decision authorities is outside this ADR; there is no implicit “any broker allows” rule.

The core records decisions and observed outcomes using trusted context and the audit requirements of ADR-0002. Extension logs cannot replace that evidence. General sign-in and registry credentials are not returned to extensions. Credential issuance or a protected corporate action, when needed, uses a separately registered, scoped core service; an allow result is neither a credential nor proof that the action happened.

As in ADR-0001, an ordinary child process is not a sandbox. This boundary controls the loader and core-mediated actions. External services must enforce their own rights; the integration does not prevent an extension from using OS access it already has. No cancellation or lost response authorizes automatic repetition of an external action.

Refinement: task-bound callers and enforceable policy — 2026-09-24

Section titled “Refinement: task-bound callers and enforceable policy — 2026-09-24”

The command model and MCP adapter expose the same registered operations; MCP is an entry point, not a second broker or a grant source. The core constructs both the subject’s existing principalBinding and the requesting participant’s actorBinding under ADR-0014. Trusted launch, transport and issuer context establish the actor binding. A client name, MCP clientInfo, model text or extension-supplied user ID cannot establish it. The service account authenticating the broker connection remains a third, separate role.

For a task-bound request, trusted broker context additionally retains taskId, taskAuthorityRef, taskEpoch, actorBinding and the validated task restrictions. Task purpose text is diagnostic, not a natural-language policy. The core resolves authority from an approved preset, an authorized human grant or a registered authority independently of the requesting agent. Local preset issuance does not require OIDC, JWT or a remote broker. No provider allow can widen current owner/subject rights, any ancestor task scope, the current task, extension/command limits or the pinned invocation restrictions.

An adapter sends only the trusted context its selected permission contract requires; a provider unable to evaluate a required restriction returns unsupported or an unusable decision, not an unrestricted allow. Source, destination and combined-action rules can be enforced only where registered operations or the selected execution profile provide that control. ADR-0015 distinguishes explicit exposure of trusted native code from stronger confinement. A machine preset is not evidence of a sandbox.

Decision validity still follows ADR-0012. Task and actor bindings are rechecked at final admission with the shared reservation from ADR-0014 and effect commitment from ADR-0016. Earlier discovery, an advisory query, a valid API credential or a logged allow cannot bypass those checks or repeat an uncertain effect. No remote system is required merely to apply the local baseline.

Additional implementation checks remain unrun: exercise the same operation through CLI and MCP, spoof actor/task fields, substitute a subject with provider-service credentials, revoke an ancestor during a pending decision, and request a restriction the selected native boundary cannot enforce. Each must preserve the existing typed failures and invocation outcomes.

  • Standards-compatible gateways use connection profiles instead of vendor-specific clients. Application registration and permission mappings are still organization responsibilities.
  • Identity, authorization and discovery can be replaced independently. A custom service fits through a focused adapter or a protocol bridge, without changing command extensions.
  • The loader receives a permission-aware discovery source, while retaining its own artifact trust and lifecycle responsibilities.
  • A generic permission API may need an additional catalog mapping in the adapter. This is explicit integration work, not a capability assumed of every external broker.
  • KCL declarations, loader formats, detailed credential storage and decision-validity policy have separate contracts. The protocol choices here do not select connectivity or synchronization policies or assert completed implementations.

The project owner accepted this decision on 2026-09-23. The following list remains required implementation verification, not a claim that these checks passed at acceptance.

For implementation verification, review the boundary and exercise a small reference integration:

  1. Use one OIDC implementation with two independently configured providers. Check issuer/subject binding, callback/token validation, required PKCE, profile isolation and device-flow capability checks without vendor SDKs.
  2. Combine standard sign-in with a custom permission API, then exercise a fully custom identity integration and a supported domain adapter. Preserve caller identity separately from service credentials; reject spoofed attributes, unsupported mechanisms and conflicting mappings.
  3. Discover permitted extensions before installation without package execution. Exercise snapshot and explicitly configured live providers, revision/account changes, cursor expiry, duplicate entries and traversal limits. Distinguish empty, partial and failed results; reject wrong-context pages and unapproved sources. A permission API without search must not silently lose or broaden catalog semantics or downgrade required consistency.
  4. Query declared actions and request an operation through the same core boundary. Advisory results, undeclared actions and substituted resources cannot bypass the operation check. Denial, cancellation and required-audit failure cause no broader access, late dispatch or repeated action.
  5. Exercise a static catalog with explicit local policy, then add verified identity and replace evaluation with a service provider. Preserve extension contracts and mandatory authority bindings; missing remote decisions never enable the public baseline.

These checks have not been run for ADR-0005. The ADR-0002/0003 broker stubs do not establish protocol interoperability, domain support or this registration/discovery contract. The owner accepted the architecture on 2026-09-23; these checks remain implementation obligations.

Diagram

Drag to move · + / − to zoom · 0 to fit · Esc to closeDrag to move and pinch to zoom

100%