Expand description
Role-based access control for tool execution.
Why: tcode exposes tools over multiple surfaces; RBAC gates execution on a
stable tier ladder without per-deployment code branches.
What: ServiceTier, UserIdentity, filter_tools_for_user,
can_access_tier.
Test: rbac::tests::*.
Role-based access control for tool execution in tcode.
Why: tcode exposes tools over multiple transports (CLI, API, TUI). Some
tools (memory writes, shell exec) are unsafe for arbitrary callers while
still being essential for the trusted operator. RBAC gates tool execution
on a small, totally-ordered tier ladder so the same agent definition can be
safely exposed across transports without per-deployment code branches.
What: Defines ServiceTier (re-exported from tools::traits),
UserIdentity (the per-request principal), and filter_tools_for_user.
Test: See unit tests below — covers default identity, every tier × restriction
combination, and the filter helper.
Re-exports§
pub use crate::tools::traits::ServiceTier;
Structs§
- User
Identity - Per-request principal carried from transport into tool dispatch.
Functions§
- filter_
tools_ for_ user - Filter a list of tools to those callable by
user.