> your AI agent picks dependencies from memory; give it dated facts — try starlog.dev ↗ vet your agent's deps ↗ vibe-coding is fine. vibe-importing isn’t. — try starlog.dev ↗ vibe-importing isn’t fine ↗ your agent has never seen your private packages — try starlog.dev ↗ facts for private packages ↗ a linter for the dependencies your AI agent picks — try starlog.dev ↗ a linter for agent deps ↗ whois is redacted, cdns mask the rest — get the real operator — try whoisgeni.us ↗ who really runs that domain ↗ domain attribution that shows its work — full evidence chain — try whoisgeni.us ↗ domain intel w/ evidence ↗

← Back to Articles

artex-ld: Adding Human Guardrails to Autonomous Penetration Testing Agents

[ View on GitHub ]

artex-ld: Adding Human Guardrails to Autonomous Penetration Testing Agents

Hook

An autonomous AI agent deciding to pivot laterally through your client's production database server sounds like a career-ending lawsuit waiting to happen—which is exactly why artex-ld forces you to approve every high-risk decision before the agent pulls the trigger.

Context

The promise of LLM-powered agents in penetration testing is compelling: give an AI a foothold, and it autonomously explores networks, escalates privileges, and chains exploits while you focus on strategic decisions. Tools like AutoGPT and raw LangChain agents can technically do this, but they share a fatal flaw for offensive security work—they have no concept of authorization boundaries or legal risk. A hallucinated command or over-eager lateral movement can violate scope agreements, trigger incident response teams prematurely, or worse, cause actual damage to production systems.

artex-ld, a fork of the ARTEX autonomous penetration testing framework, tackles this by injecting human-in-the-loop controls into what would otherwise be a fully autonomous system. It's designed specifically for internal network penetration, code auditing, and vulnerability research scenarios where you need the efficiency of AI automation but can't tolerate the liability of unchecked agent behavior. The Chinese security community built this after recognizing that while LLMs excel at generating creative attack chains, real red team work requires approval gates, audit trails, and repeatable playbooks—not just a chatbot with root access.

Technical Insight

High-level Objective

Generate Intents

Approved Intents

SSE Updates

Route by Type

Tool Invocations

SSE

Execution Results

State Updates

Findings Detected

New Intents

Reports/Retests

Real-time State

React Frontend

Task Management

Planner Agent

LLM-powered

Intent Review Layer

Human Approval Gate

Custom Agent Router

Worker Selection

Worker Agents

Tool Executors

MCP Ecosystem

GodzillaSuper/Playwright

PostgreSQL

State & Findings

Finding Orchestrator

Auto-Derivative Tasks

System architecture — auto-generated

artex-ld's architecture splits into three control layers that transform ARTEX's autonomous planner-worker pattern into something operators can actually trust in production engagements. The core innovation is the intent审核 (intent review) system, which intercepts every AI-generated action before execution.

Here's how the approval flow works in practice. When the Planner agent (powered by your choice of GPT-4, Claude, or local LLMs) decomposes a high-level objective like "establish persistence on the target host," it generates structured Intent objects—not just natural language suggestions. Each Intent specifies the target worker agent, required tools from the MCP (Model Context Protocol) ecosystem, and expected outputs:

// Simplified Intent structure from the codebase
type Intent struct {
    ID          string          `json:"id"`
    Type        string          `json:"type"`        // e.g., "exploit", "recon", "lateral_movement"
    Description string          `json:"description"` 
    ToolCalls   []ToolCall      `json:"tool_calls"`  // MCP tools to invoke
    TargetAgent string          `json:"target_agent"` // Which worker executes this
    Metadata    json.RawMessage `json:"metadata"`    // JSONB for extensibility
    Status      string          `json:"status"`      // "pending_review", "approved", "rejected"
    Reviewer    *string         `json:"reviewer"`    // Who approved/rejected
}

Before any Intent with risk-flagged tool calls (like shell execution or credential dumping) moves to the Worker queue, it hits two gates: an AI safety filter that pattern-matches against prohibited actions (destroying logs, affecting availability), then human approval through the React UI. Operators see the full tool invocation plan, can edit parameters, or reject outright. The system tracks every decision in PostgreSQL with timestamp and actor attribution—critical when clients ask "why did you pivot to HR's file server?"

The seed intent system solves the cold-start problem that plagues general-purpose agent frameworks. Rather than asking an LLM to hallucinate entire penetration testing methodologies, operators select scenario templates like "内网渗透-已有立足点" (internal penetration with existing foothold). This loads a pre-configured chain of intent types:

# Example seed intent template (simplified)
scenario: internal_penetration_post_foothold
seed_intents:
  - type: recon_local_system
    description: "枚举当前主机权限和网络配置"
    auto_approve: true  # Low-risk reconnaissance
    tools: ["shell_exec", "file_read"]
  
  - type: credential_harvest
    description: "搜索配置文件和内存中的凭据"
    requires_review: true  # Needs approval
    tools: ["mimikatz_mcp", "grep_secrets"]
  
  - type: lateral_movement
    description: "使用获取的凭据横向移动"
    requires_review: true
    triggers_on_finding: ["valid_credential"]

Notice the triggers_on_finding field—this connects to artex-ld's finding orchestration engine. When a Worker completes an Intent and reports a Finding (structured vulnerability or intelligence data), the system pattern-matches against trigger rules. Finding a webshell triggers automatic validation via the GodzillaSuper MCP tool (a Java-based webshell manager exposed as an SSE service). Confirming a SQL injection spawns child Intents for data exfiltration and privilege escalation. This creates emergent multi-stage workflows without hard-coding attack graphs.

The MCP integration deserves special attention because it solves stateful tool persistence. Traditional security automation treats tools as one-shot scripts—run Nmap, parse output, done. But post-exploitation requires session continuity: authenticating to a webshell, maintaining a Meterpreter session, or keeping database connections alive across multiple queries. artex-ld connects to MCP servers like GodzillaSuper as long-lived processes:

// Worker invoking stateful MCP tool via SSE
func (w *Worker) ExecuteIntent(intent Intent) (*Finding, error) {
    for _, toolCall := range intent.ToolCalls {
        // Connect to MCP server's SSE endpoint
        client := sse.NewClient(toolCall.MCPServerURL)
        
        // Send tool invocation with session context
        resp, err := client.Send(toolCall.Name, map[string]interface{}{
            "session_id": w.SessionID,  // Persisted across calls
            "params":     toolCall.Params,
        })
        
        // MCP server maintains state (auth tokens, file handles, etc.)
        // Returns structured Finding or error
    }
}

The GodzillaSuper integration is particularly clever—it wraps the popular Chinese webshell client in an MCP-compatible API, allowing Intents like "upload auxiliary tools to compromised server" to work across different webshell types (PHP, JSP, ASP.NET) without the Planner needing webshell-specific knowledge.

Custom agent routing addresses the "one model to rule them all" fallacy. Not every Intent needs Claude Opus burning $0.015 per 1K tokens. Reconnaissance Intents route to a worker using GPT-3.5-turbo with broad tool access. Exploitation Intents hit a constrained worker using Claude with only pre-approved exploit modules. Code audit Intents use a specialized agent with static analysis tools and no network access. The routing table lives in PostgreSQL as a simple JSONB mapping, avoiding brittle configuration files.

Deployment is refreshingly simple for a tool with this much complexity. The install.sh script handles PostgreSQL initialization, systemd service registration, and generates a working .env with sane defaults. No Kubernetes, no Docker Compose multi-file nightmares—just a Go binary, a database, and a Node frontend.

Gotcha

The intent review system creates genuine operational friction. When you're racing against a 24-hour red team engagement window, waiting for approval on every lateral movement attempt feels like running with ankle weights. The UI has no batch approval, so if the Planner generates ten reconnaissance Intents simultaneously, you're clicking through ten individual approval dialogs. There's also no priority queue—a critical privilege escalation Intent waits behind low-value port scans if submitted later.

Cost controls are entirely missing. The system will happily burn through your OpenAI API quota if the Planner enters a reasoning loop or if finding orchestration triggers spawn recursive child tasks. You're monitoring token usage through your LLM provider's dashboard, not through artex-ld itself. For long-running campaigns, this could mean surprise four-figure bills. MCP tool failures also cascade silently—if GodzillaSuper crashes mid-engagement, dependent Intents just time out without bubbling errors back to the Planner for replanning. You'll discover the tool is down only when manually checking why lateral movement stalled.

Verdict

Use if: You're a red team operator or security researcher who needs repeatable, auditable automation for post-exploitation workflows but operates under strict legal/ethical constraints where autonomous agents are too risky. The intent review layer and scenario templates make this significantly safer than raw LangChain agents for offensive work, and the forensic audit trails satisfy client reporting requirements. You're comfortable with Chinese-language documentation and already use webshell management tools compatible with the GodzillaSuper ecosystem. Skip if: You need real-time autonomous response (the approval bottleneck kills that), require multi-tenant isolation for a red team-as-a-service platform (no RBAC beyond admin/user), or want a tool that works out-of-the-box in English-speaking environments without translation overhead. Also skip if you're doing pure vulnerability scanning at scale—Nuclei with scripted orchestration will be 10x faster and cheaper since it doesn't burn LLM tokens on deterministic CVE checks.