Autonomous AI agent TUI for CTF and pentesting.
z2e-terminal accepts natural-language missions, plans and executes multi-step CLI actions autonomously, observes output, reasons, and iterates until the objective is reached.

Features
Everything you need for autonomous security operations.
Agent Loop
Plan → Execute → Observe → Replan cycle with SSE streaming, doom-loop detection, and up to 30 autonomous steps.
250+ Models
Route through any AI Gateway provider. Switch models at runtime via /model. OpenAI, Anthropic, Google, DeepSeek, Meta, Mistral, xAI and more.
CTF System Prompt
Built-in CTF-oriented persona with crypto, web exploitation, and OSINT methodology. Tool-first approach with evidence-based iteration.
Tool Execution
Pure pass-through policy. bash / run_command with timeout enforcement, 64KB output capture, and doom-loop protection.
Session Debug
Live JSON snapshot at /tmp/z2e-terminal/session.json with per-step traces. Full conversation history and doom-loop monitoring.
Bubble Tea TUI
Vim-style modal input, markdown rendering via glamour, runtime model picker, and full mouse support.
Architecture
~4,000 LOC of Go across 5 clean layers.
Autonomous agent in action
Watch the agent plan, execute, and iterate on CTF challenges.
Get started
Clone the repo, set your API key, and run your first mission.