Repository navigation
Closed
Labels
Description
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_toolsenum and description channels filtered) - not activatable (reset execution-side gate)
- not loadable (hard gate at the convergence point of both
load_skill_through_pathpaths) - not executable (
ToolExecutorphysical 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
eachcall()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) wherenull= 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
xzxiaoshan commentedon Sep 29, 2026
已经在实施编码中。
feat(core): per-user capability surface with grant trimming for tools…