Skip to content

[Tool Intelligence Runtime] Route model-facing tool discovery and invocation through the Workspace Capability View #285

Closed

Description

@gaobrian

Priority

P0 — authority boundary and BSH 2.0 runtime alignment.

Current implementation

The repository already has substantial capability-runtime foundations:

  • CapabilityDescriptor and catalogue_from_registry
  • CapabilityTool adapters and NativeToolProvider
  • WorkspaceRuntime with workspace ownership checks, bounded concurrency, invocation deadlines, cancellation and local/remote bindings
  • model proposal parsing and approval in agent::composition
  • find_tool over the Agent's base registry and live overlay

However, the model-facing find_tool path still returns raw tool surface names/descriptions/schemas, and the ReAct engine's reveal_tools adds those definitions directly to the live model context. The source explicitly documents that discovery is not an authorization boundary: deferred tools remain registered and callable.

Problem

Tool Intelligence must not become a second, weaker route around the capability architecture. A model-facing search result must represent a capability that belongs to the current Workspace Capability View, not merely a tool found in a node/agent dispatch registry. Discovery, composition, authorization and invocation need one coherent identity and policy path.

The existing capability runtime should be reused, not duplicated.

Requirement

Integrate find_tool with the approved, task-relevant Workspace Capability View and route selected tool calls through the existing capability invocation contract. Preserve the model-facing tool-name surface as an adapter, while capability IDs and provider bindings remain the authoritative runtime identity.

Acceptance criteria

  • The search catalogue is derived from the current approved Workspace Capability View (including only policy-admitted local and explicitly granted remote capabilities), not from an unrestricted node-global registry.
  • Search results carry a stable capability ID, version and provider/source identity internally; model-facing surface names remain compatible.
  • A discovered definition can be exposed to the model only if its capability is admitted by the current workspace/task view.
  • A direct model call to a capability outside the view is rejected as NotFound/Denied at the authoritative runtime boundary, even if the caller bypasses find_tool or reuses a stale schema.
  • Every invocation carries the correct workspace, principal, task/correlation, deadline, cancellation and delegation context through InvocationContext.
  • Remote capabilities remain remote bindings and always pass caller-side and provider-side authorization; no local fallback or name-shadowing is possible.
  • Revocation, workspace policy changes and composition revision changes take effect at invocation time; stale discovery results are not proof of availability.
  • Preserve schema validation, timeout, cancellation, concurrency and structured capability error semantics through the Agent/ReAct adapter.
  • Add end-to-end tests proving that discovered local and remote tools invoke through the same runtime, while out-of-view, revoked, stale and cross-workspace calls are refused.
  • Keep legacy direct-tool mode available only as an explicit compatibility mode with documented security semantics; it must not silently bypass the capability path when the capability runtime is enabled.

Non-goals

  • Do not create a second authorization engine.
  • Do not make discovery itself grant a capability.
  • Do not expose the node-global registry to the model.

References

  • crates/agent/src/agent/agentic/discovery.rs — current raw-registry discovery
  • crates/react/src/engine/mod.rs — reveal_tools and dynamic context exposure
  • crates/agent/src/capabilities/native.rs — native provider invocation
  • crates/agent/src/composition.rs — proposal/approval/resolution
  • crates/capability/src/workspace.rs — WorkspaceRuntime authority boundary
  • docs/bsh-2.0-architecture-rfc.md — workspace-scoped, task-relevant capability view

Activity

  1. gaobrian commented on Nov 11, 2026

    @gaobrian
    ContributorAuthor

    Implemented in the unified intelligence runtime change: goal fencing and localized round limits, metadata-only Skill indexing, task-scoped Skill runtime with request-scoped instruction composition, dependency/conflict resolution, provenance/trust enforcement, governed federated metadata discovery, an offline activation benchmark, metadata-aware tool retrieval, per-turn schema budgets, and turn-correlated discovery/selection telemetry. See docs/bsh-intelligence-runtime.md for the contracts and coverage. Verified by the agent, react and bsh test suites plus clippy.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions