[GH-ISSUE #36] [Enhancement]: Support continuous execution of commands over multiple rounds. #18

Closed
opened 2026-06-06 22:07:59 -04:00 by yindo · 1 comment
Owner

Originally created by @prodigy99 on GitHub (Apr 24, 2025).
Original GitHub issue: https://github.com/vxcontrol/pentagi/issues/36

Originally assigned to: @asdek on GitHub.

Target Component

Security Tools Integration, AI Agents (Researcher/Developer/Executor)

Enhancement Description

Based on my observations, when executing a command to complete a task, only a single command execution is supported. However, sometimes executing a command requires interaction or input. In such cases, the execution gets stuck in a waiting state and repeatedly attempts to run the command.

Here is an example I encountered: this penetration testing tool attempts to use FTP to log into the target host's FTP server and check if anonymous login is possible. This is a good attempt, but it is an interactive process that requires entering a username. It gets stuck at this step, and then the command is repeatedly executed many times.

Image

In penetration testing tasks, many tools require interaction, such as Metasploit (although it is possible to execute a series of commands directly without entering interaction through certain instructions, for tasks like reverse shell, interaction is still needed to compromise the target host's shell). Therefore, I believe that supporting continuous multi-round conversational interaction is necessary.

Technical Details

I am not very familiar with Pentagi's execution model because I only started trying to use it yesterday and haven't had the chance to carefully review the code. My problem-solving approach will involve some assumptions, so if there are any errors, please bear with me.
I speculate that when Pentagi executes code, it uses docker exec to attempt to execute commands directly within Docker. However, for exec, we can attach stdin and stdout, thereby completely taking over the container's exec stream. Then, by using the input from the stream as the large model's input and detecting the output stream's field inputs, if no new content is output after a certain period (or after waiting for a specified time), the content can be sent to the large model for it to decide whether to continue waiting. The stream information from the execution process can then be sent to the large model, allowing it to continue generating input. This process can repeat, enabling multi-round interaction.
Here is a simple implementation I wrote before (https://github.com/codePlaceOfficial/sandbox/tree/master/example/cmdStreamWithXterm), which interacts with the Docker exec stream using xterm.js. The interaction with the large model should be similar, except the input comes from the LLM instead of a human.

The above description and suggestions are based on my lack of understanding of PentAgi's implementation details. If anything is incorrect or offensive, please forgive me.

Designs and Mockups

No response

Alternative Solutions

No response

Verification

  • I have checked that this enhancement hasn't been already proposed
  • This enhancement aligns with PentAGI's goal of autonomous penetration testing
  • I have considered the security implications of this enhancement
  • I have provided clear use cases and benefits
Originally created by @prodigy99 on GitHub (Apr 24, 2025). Original GitHub issue: https://github.com/vxcontrol/pentagi/issues/36 Originally assigned to: @asdek on GitHub. ### Target Component Security Tools Integration, AI Agents (Researcher/Developer/Executor) ### Enhancement Description Based on my observations, when executing a command to complete a task, only a single command execution is supported. However, sometimes executing a command requires interaction or input. In such cases, the execution gets stuck in a waiting state and repeatedly attempts to run the command. Here is an example I encountered: this penetration testing tool attempts to use FTP to log into the target host's FTP server and check if anonymous login is possible. This is a good attempt, but it is an interactive process that requires entering a username. It gets stuck at this step, and then the command is repeatedly executed many times. ![Image](https://github.com/user-attachments/assets/8ee06958-58cb-4a18-bd1b-61cedb03ce4b) In penetration testing tasks, many tools require interaction, such as Metasploit (although it is possible to execute a series of commands directly without entering interaction through certain instructions, for tasks like reverse shell, interaction is still needed to compromise the target host's shell). Therefore, I believe that supporting continuous multi-round conversational interaction is necessary. ### Technical Details I am not very familiar with Pentagi's execution model because I only started trying to use it yesterday and haven't had the chance to carefully review the code. My problem-solving approach will involve some assumptions, so if there are any errors, please bear with me. I speculate that when Pentagi executes code, it uses docker exec to attempt to execute commands directly within Docker. However, for exec, we can attach stdin and stdout, thereby completely taking over the container's exec stream. Then, by using the input from the stream as the large model's input and detecting the output stream's field inputs, if no new content is output after a certain period (or after waiting for a specified time), the content can be sent to the large model for it to decide whether to continue waiting. The stream information from the execution process can then be sent to the large model, allowing it to continue generating input. This process can repeat, enabling multi-round interaction. Here is a simple implementation I wrote before [(https://github.com/codePlaceOfficial/sandbox/tree/master/example/cmdStreamWithXterm),](url) which interacts with the Docker exec stream using xterm.js. The interaction with the large model should be similar, except the input comes from the LLM instead of a human. The above description and suggestions are based on my lack of understanding of PentAgi's implementation details. If anything is incorrect or offensive, please forgive me. ### Designs and Mockups _No response_ ### Alternative Solutions _No response_ ### Verification - [x] I have checked that this enhancement hasn't been already proposed - [x] This enhancement aligns with PentAGI's goal of autonomous penetration testing - [x] I have considered the security implications of this enhancement - [x] I have provided clear use cases and benefits
yindo added the enhancement label 2026-06-06 22:07:59 -04:00
yindo closed this issue 2026-06-06 22:08:00 -04:00
Author
Owner

@asdek commented on GitHub (Feb 21, 2026):

Closes #102

<!-- gh-comment-id:3939798341 --> @asdek commented on GitHub (Feb 21, 2026): Closes #102
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: vxcontrol/pentagi#18