AS AgentScopeAPI 手册 / API Reference

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
toolNameString
执行工具名称相关操作。
the tool this rule targets (never `null`)
ruleContentString
执行规则内容相关操作。
optional tool-specific matcher pattern (nullable)
behaviorPermissionBehavior
执行行为相关操作。
the resulting behavior when the rule matches (never `null`)
sourceString
执行来源相关操作。
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–45

ruleContent

String ruleContent

执行规则内容相关操作。

optional tool-specific matcher pattern (nullable)

源码Source io/agentscope/core/permission/PermissionRule.java:33–45

behavior

PermissionBehavior behavior

执行行为相关操作。

the resulting behavior when the rule matches (never null)

源码Source io/agentscope/core/permission/PermissionRule.java:33–45

source

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
toolNameString工具名称(类型 `String`)。The tool name.
ruleContentString规则内容(类型 `String`)。The rule content.
behaviorPermissionBehavior行为(类型 `PermissionBehavior`)。The behavior.
sourceString来源(类型 `String`)。The source.
源码Source io/agentscope/core/permission/PermissionRule.java:39–44
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.