Skip to main content

Overview

PentAGI uses specialized AI agents for autonomous penetration testing. This API provides access to agent logs, assistants, and various execution logs including terminal output, web searches, and inter-agent communications.

Assistants

Assistants are interactive AI agents that can answer questions and perform follow-up tasks within a flow.

Assistant Type

type Assistant {
  id: ID!
  title: String!
  status: StatusType!
  provider: Provider!
  flowId: ID!
  useAgents: Boolean!
  createdAt: Time!
  updatedAt: Time!
}
useAgents
Boolean
required
Whether the assistant can delegate to specialized agents or works independently

Query Assistants

query GetAssistants($flowId: ID!) {
  assistants(flowId: $flowId) {
    id
    title
    status
    provider {
      name
      type
    }
    useAgents
    createdAt
  }
}

Create Assistant

mutation CreateAssistant(
  $flowId: ID!
  $provider: String!
  $input: String!
  $useAgents: Boolean!
) {
  createAssistant(
    flowId: $flowId
    modelProvider: $provider
    input: $input
    useAgents: $useAgents
  ) {
    flow {
      id
      updatedAt
    }
    assistant {
      id
      title
      status
    }
  }
}
Variables:
{
  "flowId": "1",
  "provider": "default-openai",
  "input": "Explain the SQL injection vulnerability found in the login form",
  "useAgents": false
}

Call Assistant

Send a follow-up message to an existing assistant.
mutation CallAssistant(
  $flowId: ID!
  $assistantId: ID!
  $input: String!
  $useAgents: Boolean!
) {
  callAssistant(
    flowId: $flowId
    assistantId: $assistantId
    input: $input
    useAgents: $useAgents
  )
}

Stop Assistant

mutation StopAssistant($flowId: ID!, $assistantId: ID!) {
  stopAssistant(flowId: $flowId, assistantId: $assistantId) {
    id
    status
  }
}

Delete Assistant

mutation DeleteAssistant($flowId: ID!, $assistantId: ID!) {
  deleteAssistant(flowId: $flowId, assistantId: $assistantId)
}

Agent Logs

Agent logs track inter-agent communications and task delegations.

AgentLog Type

type AgentLog {
  id: ID!
  initiator: AgentType!
  executor: AgentType!
  task: String!
  result: String!
  flowId: ID!
  taskId: ID
  subtaskId: ID
  createdAt: Time!
}
initiator
AgentType
required
Agent that initiated the task delegation
executor
AgentType
required
Agent that executed the task

Query Agent Logs

query GetAgentLogs($flowId: ID!) {
  agentLogs(flowId: $flowId) {
    id
    initiator
    executor
    task
    result
    taskId
    subtaskId
    createdAt
  }
}
Response:
{
  "data": {
    "agentLogs": [
      {
        "id": "log-001",
        "initiator": "primary_agent",
        "executor": "searcher",
        "task": "Search for recent CVEs affecting Apache 2.4.41",
        "result": "Found 3 relevant CVEs: CVE-2021-44790 (critical), CVE-2021-44224 (high), CVE-2021-26691 (medium)",
        "taskId": "task-001",
        "subtaskId": "subtask-002",
        "createdAt": "2024-02-20T10:33:15Z"
      }
    ]
  }
}

Subscribe to Agent Logs

subscription AgentLogAdded($flowId: ID!) {
  agentLogAdded(flowId: $flowId) {
    id
    initiator
    executor
    task
    result
    createdAt
  }
}

Terminal Logs

Terminal logs capture all command executions and their output.

TerminalLog Type

type TerminalLog {
  id: ID!
  flowId: ID!
  taskId: ID
  subtaskId: ID
  type: TerminalLogType!
  text: String!
  terminal: ID!
  createdAt: Time!
}
type
TerminalLogType
required
Stream type: stdin, stdout, or stderr
terminal
ID
required
ID of the terminal (container) where the command was executed

Query Terminal Logs

query GetTerminalLogs($flowId: ID!) {
  terminalLogs(flowId: $flowId) {
    id
    type
    text
    terminal
    taskId
    subtaskId
    createdAt
  }
}
Response:
{
  "data": {
    "terminalLogs": [
      {
        "id": "tlog-001",
        "type": "stdin",
        "text": "nmap -sV -p- target.example.com",
        "terminal": "term-001",
        "taskId": "task-001",
        "subtaskId": "subtask-001",
        "createdAt": "2024-02-20T10:31:00Z"
      },
      {
        "id": "tlog-002",
        "type": "stdout",
        "text": "Starting Nmap 7.94 ( https://nmap.org )\nNmap scan report for target.example.com (192.168.1.100)\nHost is up (0.0012s latency).",
        "terminal": "term-001",
        "taskId": "task-001",
        "subtaskId": "subtask-001",
        "createdAt": "2024-02-20T10:31:01Z"
      }
    ]
  }
}

Subscribe to Terminal Logs

subscription TerminalLogAdded($flowId: ID!) {
  terminalLogAdded(flowId: $flowId) {
    id
    type
    text
    terminal
    createdAt
  }
}

Message Logs

Message logs track agent communications, thoughts, and results.

MessageLog Type

type MessageLog {
  id: ID!
  type: MessageLogType!
  message: String!
  thinking: String
  result: String!
  resultFormat: ResultFormat!
  flowId: ID!
  taskId: ID
  subtaskId: ID
  createdAt: Time!
}
type
MessageLogType
required
Message type: answer, report, thoughts, browser, terminal, file, search, advice, ask, input, done
thinking
String
AI agent’s reasoning process (if available)
resultFormat
ResultFormat
required
Format of the result: plain, markdown, or terminal

Query Message Logs

query GetMessageLogs($flowId: ID!) {
  messageLogs(flowId: $flowId) {
    id
    type
    message
    thinking
    result
    resultFormat
    taskId
    subtaskId
    createdAt
  }
}

Search Logs

Search logs track web searches performed by agents.

SearchLog Type

type SearchLog {
  id: ID!
  initiator: AgentType!
  executor: AgentType!
  engine: String!
  query: String!
  result: String!
  flowId: ID!
  taskId: ID
  subtaskId: ID
  createdAt: Time!
}
engine
String
required
Search engine used: “tavily”, “duckduckgo”, “google”, “perplexity”, etc.

Query Search Logs

query GetSearchLogs($flowId: ID!) {
  searchLogs(flowId: $flowId) {
    id
    initiator
    executor
    engine
    query
    result
    createdAt
  }
}

Vector Store Logs

Vector store logs track memory operations.

VectorStoreLog Type

type VectorStoreLog {
  id: ID!
  initiator: AgentType!
  executor: AgentType!
  filter: String!
  query: String!
  action: VectorStoreAction!
  result: String!
  flowId: ID!
  taskId: ID
  subtaskId: ID
  createdAt: Time!
}
action
VectorStoreAction
required
Action performed: retrieve or store

Screenshots

Screenshots captured during browser-based testing.

Screenshot Type

type Screenshot {
  id: ID!
  flowId: ID!
  taskId: ID
  subtaskId: ID
  name: String!
  url: String!
  createdAt: Time!
}

Query Screenshots

query GetScreenshots($flowId: ID!) {
  screenshots(flowId: $flowId) {
    id
    name
    url
    taskId
    subtaskId
    createdAt
  }
}

Agent Types

Available AI agent types:
  • primary_agent - Main orchestration agent
  • assistant - Interactive question-answering agent
  • pentester - Security testing specialist
  • coder - Script and exploit development
  • installer - Tool installation and setup
  • searcher - Web search and research
  • memorist - Memory storage and retrieval
  • adviser - Strategic advice and planning
  • generator - Task decomposition
  • refiner - Result refinement
  • reflector - Analysis and insights
  • enricher - Context enrichment
  • reporter - Report generation
  • summarizer - Summary creation
  • tool_call_fixer - Tool call error recovery

Build docs developers (and LLMs) love