Building an autonomous AI penetration testing agent is deceptively difficult. Early attempts by industry researchers typically involved feeding an entire penetration testing methodology and target URL into a single long-running LLM conversation.
Within 30 minutes, this architecture breaks down. The context window is flooded with megabytes of raw HTML, port scan dumps, and terminal outputs. The model suffers from context degradation (forgetting vulnerabilities discovered earlier), hallucinates tool arguments, and hits Input Tokens Per Minute (ITPM) rate limits.
To solve this fundamental challenge, Lorikeet Security engineered the 3-Layer Orchestration Engine (LoryOrchestrator).
The Architectural Breakthrough: Instead of executing an entire engagement in one degrading conversation, Lory decouples deterministic reconnaissance from vector exploitation, running independent, clean context passes for each attack class.
Layer 3: Deterministic Reconnaissance Sweep (LoryEnumerator)
Zero-LLM Fast Recon
Before involving a single LLM token, Layer 3 executes standard network and web enumeration tools: http_probe, dns_recon, port_scan, web_fingerprint, and nuclei_scan.
It ingests raw outputs and compiles a compact JSON Recon Digest (~2 KB to 5 KB). This digest provides exact HTTP status codes, detected frameworks, server headers, and exposed endpoints without polluting the reasoning loop with thousands of lines of unneeded terminal text.
Layer 2: Per-Vector Fan-Out (LoryEngine)
Isolated Reasoning Contexts
Lory splits the engagement across distinct attack vectors: SQL Injection, Broken Object Level Authorization (BOLA/IDOR), Server-Side Request Forgery (SSRF), Authentication Flaws, and Remote Code Execution.
For each vector in scope, an isolated LoryEngine instance spins up:
- Seeded with a pristine context window containing only the core rules of engagement, the specific attack vector’s
SKILL.mdplaybook, and the Layer 3 Recon Digest. - Executes targeted hypotheses using sandboxed tools (
sqlmap_probe,service_audit,content_fetch). - Constructs validated, reproducible finding payloads with exact curl commands when vulnerabilities are confirmed.
Layer 1: Context Budgeting, Compaction & Rate-Limit Throttling
Mathematical Token Caps & Compaction
Layer 1 governs compute budgets and prevents runaway loops.
- Message Compaction (
compactMessages): As conversation history approaches token thresholds, intermediate tool outputs are summarized into succinct evidence blocks while retaining critical cryptographic keys and response headers. - Proactive Throttling (
LoryAnthropicClient::throttle): Tracks sliding-window token usage, pausing execution before provider rate limits are breached. - Depth Budgeting: Enforces hard limits based on profile (
surface: 4 vectors / 40 tool calls;standard: 8 vectors / 120 calls;deep: all vectors / 350 calls).
Harness Enterprise-Grade Autonomous Pentesting
See how Lory's 3-layer architecture delivers exhaustive offensive coverage without false positives or hallucinated findings.