PermissionRule
public record PermissionRule( @JsonProperty("tool_name") String toolName, @JsonProperty("rule_content") String ruleContent, @JsonProperty("behavior") PermissionBehavior behavior, @JsonProperty("source") String source)
源码Source
io/agentscope/core/permission/PermissionRule.java:33–45承载权限规则数据的记录类型。位于 io.agentscope.core.permission 包。核心成员包括 toolName、ruleContent、behavior、source、PermissionRule。
A single permission rule pinned to a tool name.
ruleContent is interpreted by the owning tool's matchRule method. When it is
null, the rule applies to every invocation of the named tool (tool-name-level rule).
记录组件摘要Record Component Summary
| 组件Component | 类型Type | 说明Description |
|---|---|---|
toolName | String | 执行工具名称相关操作。 the tool this rule targets (never `null`) |
ruleContent | String | 执行规则内容相关操作。 optional tool-specific matcher pattern (nullable) |
behavior | PermissionBehavior | 执行行为相关操作。 the resulting behavior when the rule matches (never `null`) |
source | String | 执行来源相关操作。 where the rule originated (e.g. `"userSettings"`, `"suggested"`) |
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public PermissionRule(String toolName, String ruleContent, PermissionBehavior behavior, String source) | 初始化 `PermissionRule` 实例。 Creates a new instance. |
记录组件详情Record Component Detail
toolName
String toolName执行工具名称相关操作。
the tool this rule targets (never null)
源码Source
io/agentscope/core/permission/PermissionRule.java:33–45ruleContent
String ruleContent执行规则内容相关操作。
optional tool-specific matcher pattern (nullable)
源码Source
io/agentscope/core/permission/PermissionRule.java:33–45behavior
PermissionBehavior behavior执行行为相关操作。
the resulting behavior when the rule matches (never null)
源码Source
io/agentscope/core/permission/PermissionRule.java:33–45source
String source执行来源相关操作。
where the rule originated (e.g. "userSettings", "suggested")
源码Source
io/agentscope/core/permission/PermissionRule.java:33–45构造器详情Constructor Detail
PermissionRule
public PermissionRule(String toolName, String ruleContent, PermissionBehavior behavior, String source)
初始化 PermissionRule 实例。
Creates a new instance.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
toolName | String | 工具名称(类型 `String`)。The tool name. |
ruleContent | String | 规则内容(类型 `String`)。The rule content. |
behavior | PermissionBehavior | 行为(类型 `PermissionBehavior`)。The behavior. |
source | String | 来源(类型 `String`)。The source. |
源码Source
io/agentscope/core/permission/PermissionRule.java:39–44