Urgent.News

What's breaking now, across hundreds of outlets.

AI

Decepticon: Autonomous Red Team Orchestration with LangGraph

Decepticon is an autonomous red-team agent built on LangChain and LangGraph. It chains reconnaissance, exploitation, and privilege escalation tools without human intervention. The project hit GitHub Trending at #13 for Python with 5,825 stars and 1,100 forks, making it a real-world case study of agentic orchestration in a domain where tool execution must be both autonomous and auditable. The…

Decepticon is a red-team autonomous agent that operates on the LangChain and LangGraph frameworks. It executes reconnaissance, exploitation, and privilege escalation tools without human intervention. The project gained significant attention on GitHub, reaching #13 in Python's trending list with 5,825 stars and 1,100 forks. This case study demonstrates the importance of autonomous and auditable tool execution in red-team operations.

The red-team scenario presents challenges in orchestrating tool execution, parsing results, deciding subsequent steps, and maintaining an audit trail in the face of tool failures. Decepticon's architecture showcases how LangGraph state machines can handle multi-phase adversarial workflows, addressing issues like tool boundaries, failure recovery, and context preservation.

In traditional penetration testing, the process is linear and human-driven, with operators manually running tools like nmap, parsing output, selecting exploits, and repeating the process. Autonomous agents eliminate this model by executing tools in sequence, parsing outputs, handling failures, and maintaining an audit trail. Decepticon employs LangGraph to model the workflow as a state machine, with each node representing a phase (reconnaissance, exploitation, post-exploitation) and edges defining transitions based on tool output.

The graph retains state across phases, preventing the agent from duplicating work or losing context when tools fail. LangGraph architecture consists of primary phases: reconnaissance (nmap execution, parsing open ports, identifying services), exploitation (matching services to exploits, executing Metasploit modules, checking for shells), and post-exploitation (privilege escalation, pivoting, exfiltration).

Each phase is a node, and transitions occur only upon successful completion of the current phase. If a tool fails, the graph can backtrack, retry with different parameters, or escalate to a human operator. The state schema in Decepticon includes target metadata (IP address, hostname, OS fingerprint), tool results (nmap output, open ports, service versions), exploit history (attempted exploits, successes), and session handles (active shells, credentials, pivot points).

State is persisted in memory or a database, enabling agents to resume from the last checkpoint after crashes. Conditional edges in LangGraph allow agents to adapt their behavior based on tool output. After reconnaissance, the agent checks for exploitable services; if found, it transitions to exploitation, otherwise, it may retry with different nmap flags or exit.

This adaptability is crucial in red-team operations, as it enables agents to adjust their strategies based on the environment's response. Tool boundary design is critical for autonomous agents to prevent unintended consequences, such as lateral movement, data loss, or compliance violations. Decepticon uses sandboxed subprocesses for tool execution, with timeouts to prevent tool hangups from blocking the workflow.

Additionally, the agent has an allowlist of approved tools with defined argument schemas, ensuring only validated commands are executed. Output parsing and validation are essential for maintaining data integrity. Decepticon parses tool output with strict schemas, logging errors and retrying if necessary. Invalid tool results are handled gracefully, ensuring the agent makes decisions based on accurate data.

Failure recovery and backtracking are vital in red-team workflows, which often encounter dead ends. Decepticon implements retry with exponential backoff for transient failures, attempting a tool multiple times with increasing delays before giving up and transitioning to a fallback node. Fallback exploits are also defined in the graph, allowing the agent to switch to alternative strategies when primary methods fail.

In cases where all exploits fail, the agent escalates to a human operator, pausing the graph and logging the escalation. Overall, Decepticon demonstrates the power of autonomous red-team agents in handling complex, multi-phase workflows with adaptability and resilience. By leveraging LangGraph state machines and strict tool boundaries, Decepticon showcases a robust approach to autonomous penetration testing, addressing the hard problems inherent in red-team operations while maintaining compliance and auditability.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in AI

TouchGrass AI 🌿 — Less Screen. More World!

This is a submission for the Hacktoberfest Open-Source AI Challenge. Week 1: Touch Grass What I Built What if AI encouraged us to spend less time online and more time experiencing the real world?

More from Saturday 10 October →