capabilities
capabilities
¶
RBAC capability system — fine-grained permission model for tool dispatch.
Classes¶
Capability
¶
Bases: str, Enum
Fine-grained capability labels.
CapabilityGrant
dataclass
¶
A single capability grant for an agent.
AgentPolicy
dataclass
¶
AgentPolicy(agent_id: str, grants: List[CapabilityGrant] = list(), deny: List[str] = list())
Policy for a specific agent.
CapabilityPolicy
¶
RBAC capability policy for tool dispatch.
Checks whether an agent has the required capability to invoke a tool. Policy can be loaded from a JSON file or configured programmatically.
Default policy: if no explicit policy exists for an agent, all
capabilities are granted (open by default). Set default_deny=True
to flip to deny-by-default.
Source code in src/openjarvis/security/capabilities.py
Functions¶
grant
¶
Grant a capability to an agent.
Source code in src/openjarvis/security/capabilities.py
deny
¶
Explicitly deny a capability to an agent.
Source code in src/openjarvis/security/capabilities.py
check
¶
Check whether agent_id has capability for resource.
Falls back to the _default wildcard agent's grants only when
agent_id has no explicit policy of its own. This lets a baseline be
granted once via
grant("_default", ...) instead of needing to know every
dynamically-created managed-agent UUID ahead of time while preserving
the invariant that an agent-specific denial always wins.
Source code in src/openjarvis/security/capabilities.py
list_grants
¶
list_grants(agent_id: str) -> List[CapabilityGrant]
list_agents
¶
save
¶
Save policy to a JSON file.
Source code in src/openjarvis/security/capabilities.py
Functions¶
canonical_tool_capabilities
¶
Return the non-bypassable capability floor for tool.
Third-party tools remain governed by their ToolSpec. An in-tree tool that
was newly registered without being inventoried fails closed as
system:admin instead of silently becoming unrestricted.