This commit is contained in:
Slipstream 2025-04-30 10:31:05 -06:00
parent 8ca43b225d
commit 5cad3d181b
Signed by: slipstream
GPG Key ID: 13E498CE010AC6FD
2 changed files with 7 additions and 3 deletions

View File

@ -792,7 +792,7 @@ def create_tools_list():
tool_declarations.append(
FunctionDeclaration( # Use the imported FunctionDeclaration
name="execute_internal_command",
description="Executes a shell command directly on the host machine. WARNING: This tool is intended ONLY for internal Gurt operations and MUST NOT be used to execute arbitrary commands requested by users due to significant security risks. Use with extreme caution.",
description="Executes a shell command directly on the host machine. WARNING: This tool is intended ONLY for internal Gurt operations and MUST NOT be used to execute arbitrary commands requested by users due to significant security risks. Use with extreme caution. Only user_id 452666956353503252 is authorized.",
parameters={
"type": "object",
"properties": {
@ -803,9 +803,13 @@ def create_tools_list():
"timeout_seconds": {
"type": "integer",
"description": "Optional timeout in seconds for the command (default 60)."
},
"user_id": {
"type": "string",
"description": "The Discord user ID of the user requesting execution."
}
},
"required": ["command"]
"required": ["command", "user_id"]
}
)
)

View File

@ -831,7 +831,7 @@ async def execute_internal_command(cog: commands.Cog, command: str, timeout_seco
Only user ID 452666956353503252 is allowed to execute this command.
"""
if user_id != "452666956353503252":
return {"error": "You are not authorized to execute internal commands.", "status": "unauthorized"}
return {"error": "The requesting user is not authorized to execute commands.", "status": "unauthorized"}
print(f"--- INTERNAL EXECUTION (UNSAFE): Running command: {command} ---")
try:
process = await asyncio.create_subprocess_shell(