Overview
Flows represent complete penetration testing sessions in PentAGI. Each flow manages an isolated execution environment with Docker containers, AI agents, and comprehensive logging.
Flow Type
type Flow {
id: ID!
title: String!
status: StatusType!
terminals: [Terminal!]
provider: Provider!
createdAt: Time!
updatedAt: Time!
}
Fields
Unique identifier for the flow
Human-readable title describing the flow objective
Current execution status: created, running, waiting, finished, failed
Docker containers (terminals) associated with this flow
LLM provider used for this flow (OpenAI, Anthropic, etc.)
Timestamp when the flow was created
Timestamp of last flow update
Terminal Type
type Terminal {
id: ID!
type: TerminalType!
name: String!
image: String!
connected: Boolean!
createdAt: Time!
}
Terminals represent Docker containers where commands are executed.
Terminal type: primary or secondary
Docker image used for the container (e.g., vxcontrol/pentagi-kali)
Whether the container is currently running and accessible
Queries
List All Flows
Retrieve all flows accessible to the authenticated user.
query {
flows {
id
title
status
provider {
name
type
}
createdAt
updatedAt
}
}
Response:
{
"data": {
"flows": [
{
"id": "1",
"title": "Web Application Security Assessment",
"status": "running",
"provider": {
"name": "default-openai",
"type": "openai"
},
"createdAt": "2024-02-20T10:30:00Z",
"updatedAt": "2024-02-20T10:45:00Z"
}
]
}
}
Get Single Flow
Retrieve detailed information about a specific flow.
query GetFlow($id: ID!) {
flow(flowId: $id) {
id
title
status
terminals {
id
type
name
image
connected
createdAt
}
provider {
name
type
}
createdAt
updatedAt
}
}
Variables:
Response:
{
"data": {
"flow": {
"id": "1",
"title": "Web Application Security Assessment",
"status": "running",
"terminals": [
{
"id": "term-001",
"type": "primary",
"name": "pentagi-kali-main",
"image": "vxcontrol/pentagi-kali:latest",
"connected": true,
"createdAt": "2024-02-20T10:30:05Z"
}
],
"provider": {
"name": "default-openai",
"type": "openai"
},
"createdAt": "2024-02-20T10:30:00Z",
"updatedAt": "2024-02-20T10:45:00Z"
}
}
}
Mutations
Create Flow
Create a new penetration testing flow.
mutation CreateFlow($provider: String!, $input: String!) {
createFlow(modelProvider: $provider, input: $input) {
id
title
status
terminals {
id
type
name
image
connected
}
provider {
name
type
}
createdAt
}
}
Parameters:
Name of the LLM provider configuration (e.g., “default-openai”, “my-anthropic”)
Initial task description for the penetration test
Variables:
{
"provider": "default-openai",
"input": "Perform a comprehensive security assessment of the web application at https://example.com. Identify common vulnerabilities including SQL injection, XSS, and authentication issues."
}
Response:
{
"data": {
"createFlow": {
"id": "2",
"title": "Security assessment of example.com",
"status": "created",
"terminals": [],
"provider": {
"name": "default-openai",
"type": "openai"
},
"createdAt": "2024-02-20T11:00:00Z"
}
}
}
Send user input to a flow that is waiting for input.
mutation PutUserInput($flowId: ID!, $input: String!) {
putUserInput(flowId: $flowId, input: $input)
}
Parameters:
ID of the flow waiting for input
User’s response or additional information
Variables:
{
"flowId": "1",
"input": "Yes, proceed with the SQL injection test on the login form."
}
Response:
{
"data": {
"putUserInput": "success"
}
}
Stop Flow
Gracefully stop a running flow.
mutation StopFlow($flowId: ID!) {
stopFlow(flowId: $flowId)
}
Variables:
Finish Flow
Mark a flow as finished.
mutation FinishFlow($flowId: ID!) {
finishFlow(flowId: $flowId)
}
Delete Flow
Permanently delete a flow and all associated data.
mutation DeleteFlow($flowId: ID!) {
deleteFlow(flowId: $flowId)
}
This action cannot be undone. All tasks, logs, and results will be permanently deleted.
Subscriptions
Flow Created
Subscribe to new flow creation events.
subscription {
flowCreated {
id
title
status
terminals {
id
type
name
}
provider {
name
type
}
createdAt
}
}
Flow Updated
Receive real-time updates when a flow changes.
subscription {
flowUpdated {
id
title
status
terminals {
id
connected
}
updatedAt
}
}
Flow Deleted
Be notified when a flow is deleted.
subscription {
flowDeleted {
id
status
updatedAt
}
}
Status Transitions
A flow in waiting status requires user input via putUserInput mutation.