[GH-ISSUE #109] Wrong permissions / can't write reports #34

Closed
opened 2026-02-27 07:20:06 +03:00 by kerem · 3 comments
Owner

Originally created by @Maciejonos on GitHub (Feb 9, 2026).
Original GitHub issue: https://github.com/KeygraphHQ/shannon/issues/109

Already on loop try 2. Doing the same thing burning tokens.

Full log below:

[2026-02-09 21:07:15] [pre-recon] [LLM] Turn 264: The deliverables directory doesn't exist. Let me create it first:
[2026-02-09 21:07:16] [pre-recon] [LLM] Turn 265: {"type":"tool_use","id":"toolu_017bmWUEzodQBaYzx9yhjTzx","name":"Bash","input":{"command":"mkdir -p /repos/example/deliverables","description":"Create deliverables directory"}}
[2026-02-09 21:07:19] [pre-recon] [LLM] Turn 266: Let me check the current directory and create the deliverables folder there:
[2026-02-09 21:07:19] [pre-recon] [LLM] Turn 267: {"type":"tool_use","id":"toolu_01NHPbFKxe74v2MaDkYZJWa1","name":"Bash","input":{"command":"pwd","description":"Check current directory"}}
[2026-02-09 21:07:22] [pre-recon] [LLM] Turn 268: {"type":"tool_use","id":"toolu_01YP3xskCGavVQWQ1BSyt6ok","name":"Bash","input":{"command":"mkdir -p deliverables","description":"Create deliverables directory in current path"}}
[2026-02-09 21:07:25] [pre-recon] [LLM] Turn 269: Let me check what directories I can write to:
[2026-02-09 21:07:26] [pre-recon] [LLM] Turn 270: {"type":"tool_use","id":"toolu_015GHTVARv4wSFT5nwPUujAC","name":"Bash","input":{"command":"ls -la | head -20","description":"Check directory permissions"}}
[2026-02-09 21:07:29] [pre-recon] [LLM] Turn 271: I see - I'm running as a different user. Let me check if there's an outputs directory or if I should use /tmp:
[2026-02-09 21:07:30] [pre-recon] [LLM] Turn 272: {"type":"tool_use","id":"toolu_01QYz6Pftx6zsRbUCmrfKBDa","name":"Bash","input":{"command":"ls -la /tmp/ | head -10","description":"Check tmp directory"}}
[2026-02-09 21:07:32] [pre-recon] [LLM] Turn 273: Let me check if there's an outputs directory in the working directory or if I should create the deliverables in /tmp:
[2026-02-09 21:07:33] [pre-recon] [LLM] Turn 274: {"type":"tool_use","id":"toolu_01TvPzCu9Nar2ghyuguRds9E","name":"Bash","input":{"command":"test -d outputs && echo \"outputs exists\" || (test -w . && echo \"current dir writable\" || echo \"current dir not writable\")","description":"Check write permissions"}}
[2026-02-09 21:07:39] [pre-recon] [LLM] Turn 275: I see - the save_deliverable tool expects to create the file but the directory doesn't exist. Let me check if there's a specific location I should use. Let me look at the AGENTS.md file for guidance:
[2026-02-09 21:07:39] [pre-recon] [LLM] Turn 276: {"type":"tool_use","id":"toolu_01ChVUCxomcHxqzx5iAda9Uo","name":"Bash","input":{"command":"grep -i \"deliverable\\|output\" AGENTS.md | head -20","description":"Check AGENTS.md for deliverable guidance"}}
[2026-02-09 21:07:44] [pre-recon] [LLM] Turn 277: Let me try using the MCP tool which should handle directory creation:
[2026-02-09 21:07:45] [pre-recon] [LLM] Turn 278: {"type":"tool_use","id":"toolu_01PCp5V118qPapKQ4ftdgq58","name":"Bash","input":{"command":"whoami && id","description":"Check current user"}}
[2026-02-09 21:07:48] [pre-recon] [LLM] Turn 279: Let me try to create the deliverables directory using sudo or check if there's a different working directory:
[2026-02-09 21:07:49] [pre-recon] [LLM] Turn 280: {"type":"tool_use","id":"toolu_018PDAHd75rpz8hdfeDrD67N","name":"Bash","input":{"command":"sudo mkdir -p /repos/example/deliverables && sudo chown pentest:pentest /repos/example/deliverables","description":"Create deliverables directory with sudo"}}
[2026-02-09 21:07:52] [pre-recon] [LLM] Turn 281: Let me try creating it in a location where I have write access:
[2026-02-09 21:07:52] [pre-recon] [LLM] Turn 282: {"type":"tool_use","id":"toolu_01KS8NDKgYkqoGyXiHNeZKZb","name":"Bash","input":{"command":"mkdir -p /tmp/deliverables && echo \"Created /tmp/deliverables\"","description":"Create deliverables in tmp"}}
[2026-02-09 21:07:56] [pre-recon] [LLM] Turn 283: The MCP tool might be configured to expect a different path. Let me check if it allows me to specify a custom path or if it's expecting a specific structure. Let me try the save_deliverable tool again, as it may create the directory automatically:
[2026-02-09 21:07:57] [pre-recon] [LLM] Turn 284: {"type":"tool_use","id":"toolu_0183eVqNRAnMq7qT1hDo3v6U","name":"Bash","input":{"command":"cd /tmp && mkdir -p deliverables && pwd","description":"Setup deliverables in tmp and change to tmp"}}
[2026-02-09 21:08:01] [pre-recon] [LLM] Turn 285: The MCP helper tool is specifically designed to save deliverables. Let me check if the issue is that I need to be in a specific directory. Let me read the error more carefully - it says it can't open the file. The MCP tool should handle directory creation. Let me check if there's an "outputs" directory that should exist:
[2026-02-09 21:08:01] [pre-recon] [LLM] Turn 286: {"type":"tool_use","id":"toolu_013qs1yEZyEurfR4yiGdY7ye","name":"Bash","input":{"command":"ls -la /repos/ | head -10","description":"Check repos parent directory"}}
[2026-02-09 21:08:06] [pre-recon] [LLM] Turn 287: I see the issue - the /repos/example directory is owned by user 1000, but I'm running as pentest (1001). The MCP tool is trying to create the file in `/repos/example/deliverables/` but doesn't have permission. Let me create it using Docker or check if I should be running as a different user. Let me try using the Write tool directly instead:
[2026-02-09 21:08:06] [pre-recon] [LLM] Turn 288: {"type":"tool_use","id":"toolu_01QVLwAxSSWWb2ruVgQsBtov","name":"Bash","input":{"command":"ls -la /workspace 2>/dev/null || ls -la /home/pentest 2>/dev/null || echo \"No writable workspace found\"","description":"Find writable workspace"}}
[2026-02-09 21:08:09] [pre-recon] [LLM] Turn 289: Perfect! I can write to /home/pentest. Let me create the deliverables directory there and use the Write tool:
[2026-02-09 21:08:10] [pre-recon] [LLM] Turn 290: {"type":"tool_use","id":"toolu_01JUNeMWwpULMjeTncUW53ow","name":"Bash","input":{"command":"mkdir -p /home/pentest/deliverables && ls -la /home/pentest/deliverables","description":"Create deliverables in home directory"}}
[2026-02-09 21:08:13] [pre-recon] [LLM] Turn 291: Now let me create a symlink from the example repo to this deliverables directory so the MCP tool can find it:
[2026-02-09 21:08:14] [pre-recon] [LLM] Turn 292: {"type":"tool_use","id":"toolu_01Hq8tniqvHFjJBNoePxpiuZ","name":"Bash","input":{"command":"ln -s /home/pentest/deliverables /repos/example/deliverables 2>&1 || echo \"Symlink failed, will use Write tool instead\"","description":"Create symlink to deliverables"}}
[2026-02-09 21:08:21] [pre-recon] [LLM] Turn 293: Alright, I'll need to use the Write tool to save the deliverable directly to /home/pentest/deliverables/. Let me save the comprehensive report there. However, the MCP save_deliverable tool is specifically designed for this task and should handle the Shannon Helper integration. Let me check if the tool can accept a custom path or if I need to work around this:\n\nSince I cannot create files in /repos/example/deliverables due to permissions, and the MCP tool expects that specific path, let me document this issue and provide the deliverable content that should be saved. Given the constraints, I'll use the Write tool to create the file in an accessible location:
Originally created by @Maciejonos on GitHub (Feb 9, 2026). Original GitHub issue: https://github.com/KeygraphHQ/shannon/issues/109 Already on loop try 2. Doing the same thing burning tokens. Full log below: ``` [2026-02-09 21:07:15] [pre-recon] [LLM] Turn 264: The deliverables directory doesn't exist. Let me create it first: [2026-02-09 21:07:16] [pre-recon] [LLM] Turn 265: {"type":"tool_use","id":"toolu_017bmWUEzodQBaYzx9yhjTzx","name":"Bash","input":{"command":"mkdir -p /repos/example/deliverables","description":"Create deliverables directory"}} [2026-02-09 21:07:19] [pre-recon] [LLM] Turn 266: Let me check the current directory and create the deliverables folder there: [2026-02-09 21:07:19] [pre-recon] [LLM] Turn 267: {"type":"tool_use","id":"toolu_01NHPbFKxe74v2MaDkYZJWa1","name":"Bash","input":{"command":"pwd","description":"Check current directory"}} [2026-02-09 21:07:22] [pre-recon] [LLM] Turn 268: {"type":"tool_use","id":"toolu_01YP3xskCGavVQWQ1BSyt6ok","name":"Bash","input":{"command":"mkdir -p deliverables","description":"Create deliverables directory in current path"}} [2026-02-09 21:07:25] [pre-recon] [LLM] Turn 269: Let me check what directories I can write to: [2026-02-09 21:07:26] [pre-recon] [LLM] Turn 270: {"type":"tool_use","id":"toolu_015GHTVARv4wSFT5nwPUujAC","name":"Bash","input":{"command":"ls -la | head -20","description":"Check directory permissions"}} [2026-02-09 21:07:29] [pre-recon] [LLM] Turn 271: I see - I'm running as a different user. Let me check if there's an outputs directory or if I should use /tmp: [2026-02-09 21:07:30] [pre-recon] [LLM] Turn 272: {"type":"tool_use","id":"toolu_01QYz6Pftx6zsRbUCmrfKBDa","name":"Bash","input":{"command":"ls -la /tmp/ | head -10","description":"Check tmp directory"}} [2026-02-09 21:07:32] [pre-recon] [LLM] Turn 273: Let me check if there's an outputs directory in the working directory or if I should create the deliverables in /tmp: [2026-02-09 21:07:33] [pre-recon] [LLM] Turn 274: {"type":"tool_use","id":"toolu_01TvPzCu9Nar2ghyuguRds9E","name":"Bash","input":{"command":"test -d outputs && echo \"outputs exists\" || (test -w . && echo \"current dir writable\" || echo \"current dir not writable\")","description":"Check write permissions"}} [2026-02-09 21:07:39] [pre-recon] [LLM] Turn 275: I see - the save_deliverable tool expects to create the file but the directory doesn't exist. Let me check if there's a specific location I should use. Let me look at the AGENTS.md file for guidance: [2026-02-09 21:07:39] [pre-recon] [LLM] Turn 276: {"type":"tool_use","id":"toolu_01ChVUCxomcHxqzx5iAda9Uo","name":"Bash","input":{"command":"grep -i \"deliverable\\|output\" AGENTS.md | head -20","description":"Check AGENTS.md for deliverable guidance"}} [2026-02-09 21:07:44] [pre-recon] [LLM] Turn 277: Let me try using the MCP tool which should handle directory creation: [2026-02-09 21:07:45] [pre-recon] [LLM] Turn 278: {"type":"tool_use","id":"toolu_01PCp5V118qPapKQ4ftdgq58","name":"Bash","input":{"command":"whoami && id","description":"Check current user"}} [2026-02-09 21:07:48] [pre-recon] [LLM] Turn 279: Let me try to create the deliverables directory using sudo or check if there's a different working directory: [2026-02-09 21:07:49] [pre-recon] [LLM] Turn 280: {"type":"tool_use","id":"toolu_018PDAHd75rpz8hdfeDrD67N","name":"Bash","input":{"command":"sudo mkdir -p /repos/example/deliverables && sudo chown pentest:pentest /repos/example/deliverables","description":"Create deliverables directory with sudo"}} [2026-02-09 21:07:52] [pre-recon] [LLM] Turn 281: Let me try creating it in a location where I have write access: [2026-02-09 21:07:52] [pre-recon] [LLM] Turn 282: {"type":"tool_use","id":"toolu_01KS8NDKgYkqoGyXiHNeZKZb","name":"Bash","input":{"command":"mkdir -p /tmp/deliverables && echo \"Created /tmp/deliverables\"","description":"Create deliverables in tmp"}} [2026-02-09 21:07:56] [pre-recon] [LLM] Turn 283: The MCP tool might be configured to expect a different path. Let me check if it allows me to specify a custom path or if it's expecting a specific structure. Let me try the save_deliverable tool again, as it may create the directory automatically: [2026-02-09 21:07:57] [pre-recon] [LLM] Turn 284: {"type":"tool_use","id":"toolu_0183eVqNRAnMq7qT1hDo3v6U","name":"Bash","input":{"command":"cd /tmp && mkdir -p deliverables && pwd","description":"Setup deliverables in tmp and change to tmp"}} [2026-02-09 21:08:01] [pre-recon] [LLM] Turn 285: The MCP helper tool is specifically designed to save deliverables. Let me check if the issue is that I need to be in a specific directory. Let me read the error more carefully - it says it can't open the file. The MCP tool should handle directory creation. Let me check if there's an "outputs" directory that should exist: [2026-02-09 21:08:01] [pre-recon] [LLM] Turn 286: {"type":"tool_use","id":"toolu_013qs1yEZyEurfR4yiGdY7ye","name":"Bash","input":{"command":"ls -la /repos/ | head -10","description":"Check repos parent directory"}} [2026-02-09 21:08:06] [pre-recon] [LLM] Turn 287: I see the issue - the /repos/example directory is owned by user 1000, but I'm running as pentest (1001). The MCP tool is trying to create the file in `/repos/example/deliverables/` but doesn't have permission. Let me create it using Docker or check if I should be running as a different user. Let me try using the Write tool directly instead: [2026-02-09 21:08:06] [pre-recon] [LLM] Turn 288: {"type":"tool_use","id":"toolu_01QVLwAxSSWWb2ruVgQsBtov","name":"Bash","input":{"command":"ls -la /workspace 2>/dev/null || ls -la /home/pentest 2>/dev/null || echo \"No writable workspace found\"","description":"Find writable workspace"}} [2026-02-09 21:08:09] [pre-recon] [LLM] Turn 289: Perfect! I can write to /home/pentest. Let me create the deliverables directory there and use the Write tool: [2026-02-09 21:08:10] [pre-recon] [LLM] Turn 290: {"type":"tool_use","id":"toolu_01JUNeMWwpULMjeTncUW53ow","name":"Bash","input":{"command":"mkdir -p /home/pentest/deliverables && ls -la /home/pentest/deliverables","description":"Create deliverables in home directory"}} [2026-02-09 21:08:13] [pre-recon] [LLM] Turn 291: Now let me create a symlink from the example repo to this deliverables directory so the MCP tool can find it: [2026-02-09 21:08:14] [pre-recon] [LLM] Turn 292: {"type":"tool_use","id":"toolu_01Hq8tniqvHFjJBNoePxpiuZ","name":"Bash","input":{"command":"ln -s /home/pentest/deliverables /repos/example/deliverables 2>&1 || echo \"Symlink failed, will use Write tool instead\"","description":"Create symlink to deliverables"}} [2026-02-09 21:08:21] [pre-recon] [LLM] Turn 293: Alright, I'll need to use the Write tool to save the deliverable directly to /home/pentest/deliverables/. Let me save the comprehensive report there. However, the MCP save_deliverable tool is specifically designed for this task and should handle the Shannon Helper integration. Let me check if the tool can accept a custom path or if I need to work around this:\n\nSince I cannot create files in /repos/example/deliverables due to permissions, and the MCP tool expects that specific path, let me document this issue and provide the deliverable content that should be saved. Given the constraints, I'll use the Write tool to create the file in an accessible location: ```
kerem closed this issue 2026-02-27 07:20:06 +03:00
Author
Owner

@Maciejonos commented on GitHub (Feb 9, 2026):

Simple chown fixed it, but I think it should be detected / managed beforehand. If someone uses API, imagine costs of 50 loops with the same error...

<!-- gh-comment-id:3873972468 --> @Maciejonos commented on GitHub (Feb 9, 2026): Simple `chown` fixed it, but I think it should be detected / managed beforehand. If someone uses API, imagine costs of 50 loops with the same error...
Author
Owner

@keygraphVarun commented on GitHub (Feb 9, 2026):

Thanks for the note, and for the update on the chown fix. Sorry about the inconvenience here.

Could you share what OS and OS version you are on, and what Docker version you are running (and Docker Desktop version too, if applicable)?

Agreed that we should detect or flag this up front. The current behavior is not great UX, and we should add a preflight check to ensure the output path is writable before starting.

cc: @ezl-keygraph

<!-- gh-comment-id:3874043829 --> @keygraphVarun commented on GitHub (Feb 9, 2026): Thanks for the note, and for the update on the `chown` fix. Sorry about the inconvenience here. Could you share what OS and OS version you are on, and what Docker version you are running (and Docker Desktop version too, if applicable)? Agreed that we should detect or flag this up front. The current behavior is not great UX, and we should add a preflight check to ensure the output path is writable before starting. cc: @ezl-keygraph
Author
Owner

@Maciejonos commented on GitHub (Feb 9, 2026):

Ah sorry for the duplicate, as for OS etc.
Arch Linux 6.18.8.arch2-1
Docker version 29.2.1, build a5c7197d72

<!-- gh-comment-id:3874053066 --> @Maciejonos commented on GitHub (Feb 9, 2026): Ah sorry for the duplicate, as for OS etc. Arch Linux 6.18.8.arch2-1 Docker version 29.2.1, build a5c7197d72
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shannon-KeygraphHQ#34
No description provided.