Skip to content

[Feature]: per-user dynamic agent capability boundary (capability grant layer) #3298

Closed

Description

@xzxiaoshan

Background & Problem

In enterprise deployments an agent serves many users with different permissions, while it is
assembled at build time with the full capability set (all skills / tool groups / tools).
Without trimming the runtime surface to each user's actual grants, unauthorized calls (reading
restricted data, executing restricted operations) are an unacceptable security and audit risk —
one that prompt-level soft constraints or model "self-restraint" cannot address.

The framework today only has activation (activatedGroups, a session-level switch); an
authorization boundary is missing.

Goals

Trim capabilities per request, per user's actual grants, so that a cut capability
does not exist for the model:

  • absent from tool schemas (invisible)
  • not enumerable (both the reset_equipped_tools enum and description channels filtered)
  • not activatable (reset execution-side gate)
  • not loadable (hard gate at the convergence point of both load_skill_through_path paths)
  • not executable (ToolExecutor physical gate)

Design Summary

① Max set      build-time assembly, shared and immutable
② grant        per-user trimming (composed at read time; no copies, no shared-state mutation)
③ activation   session-level toggling (existing framework feature, unchanged)

Visible capability = (grant query passes) AND (activation currently on) — independent conditions
  • CapabilityResolver (user-implemented functional interface): computed server-side at
    each call() entry from (userId[, agentId]); null → ALLOW_ALL; throwing → DENY_ALL
    (fail-closed) with an ERROR log.
  • CapabilitySurface (immutable grant-set record): three whitelist dimensions (skills /
    tool groups / tools) where null = unrestricted and empty = deny all; every grant decision
    lives in its query methods, and gates only pass mechanical lookups (the tool's groups) — a
    single decision point.
  • Carriage: the surface travels on the RuntimeContext, frozen per request, never
    persisted; sub-agents without their own resolver reuse the parent instance (zero
    re-computation), while self-configured ones write into a derived copy (no parent pollution).
  • Five checkpoints: schema synthesis, reset enumeration/activation, skill visibility
    (read-time), plus tool execution and skill loading (physical gates).

Activity

  1. self-assigned this
    on Sep 26, 2026
  2. added
    enhancement
    on Sep 26, 2026
  3. added
    area/core/tool
    on Sep 26, 2026
  4. xzxiaoshan commented on Sep 29, 2026

    @xzxiaoshan
    CollaboratorAuthor

    已经在实施编码中。

  5. added a commit that references this issue on Nov 12, 2026
    5e1a102
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/core/toolenhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions