fix: harden agent gateway authorization scopes

This commit is contained in:
Peter Steinberger
2026-02-19 14:37:56 +01:00
parent 165c18819e
commit a40c10d3e2
19 changed files with 319 additions and 111 deletions

View File

@@ -61,6 +61,8 @@ export function createOpenClawTools(options?: {
requireExplicitMessageTarget?: boolean;
/** If true, omit the message tool from the tool list. */
disableMessageTool?: boolean;
/** Whether the requesting sender is an owner. */
senderIsOwner?: boolean;
}): AnyAgentTool[] {
const workspaceDir = resolveWorkspaceRoot(options?.workspaceDir);
const imageTool = options?.agentDir?.trim()
@@ -109,6 +111,7 @@ export function createOpenClawTools(options?: {
}),
createCronTool({
agentSessionKey: options?.agentSessionKey,
senderIsOwner: options?.senderIsOwner,
}),
...(messageTool ? [messageTool] : []),
createTtsTool({
@@ -118,6 +121,7 @@ export function createOpenClawTools(options?: {
createGatewayTool({
agentSessionKey: options?.agentSessionKey,
config: options?.config,
senderIsOwner: options?.senderIsOwner,
}),
createAgentsListTool({
agentSessionKey: options?.agentSessionKey,