Patriot is an autonomous cybersecurity agent that thinks, plans, and learns as it works. It performs analysis using task planning, self-reflection, and real-time security data. It's built specifically to help with CyberPatriot
USAGE INSTRUCTIONS BELOW
Patriot takes complex cybersecurity questions and turns them into clear, step-by-step research plans. It runs those tasks using live security data, checks its own work, and refines the results until it has a confident, data-backed answer.
It’s not just a chatbot. It’s an agent that plans ahead, verifies its progress, and keeps iterating until the job is done.
Key Capabilities:
- Intelligent Task Planning: Automatically decomposes complex queries into structured research steps
- Autonomous Execution: Selects and executes the right tools to gather security data
- Self-Validation: Checks its own work and iterates until tasks are complete
- Real-Time Security Data: Access to vulnerability databases, threat intelligence feeds, and more.
- Safety Features: Built-in loop detection and step limits to prevent runaway execution
- Python 3.10 or higher
- uv package manager
- OpenAI API key (get here)
OR - Gemini API key (get here) (FREE TIER - RECOMMENDED)
Install UV if not already:
# On macOS and Linux.
curl -LsSf https://astral.sh/uv/install.sh | sh# On Windows.
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"- Clone the repository:
git clone https://github.com/adhyaay-karnwal/patriot.git
cd patriot- Install dependencies with uv:
uv sync- Set up your environment variables(whichever you set, thats the provider patriot will use):
# Copy the example environment file
cp env.example .env
# Edit .env and add your API keys
# OPENAI_API_KEY=your-openai-api-key
# GEMINI_API_KEY=your-gemini-api-keyRun Patriot in interactive mode:
uv run patriot-agentPress CTRL+C to exit or type "exit"
Try asking Patriot questions like:
- "How do I harden a Windows 10 image?"
- "What are the common vulnerabilities in a Cisco router?"
- "How do I analyze a pcap file for forensic evidence?"
- "What are the best practices for securing a Linux server?"
Patriot will automatically:
- Break down your question into research tasks
- Fetch the necessary security data
- Perform analysis
- Provide a comprehensive, data-rich answer
Patriot uses a multi-agent architecture with specialized components:
- Planning Agent: Analyzes queries and creates structured task lists
- Action Agent: Selects appropriate tools and executes research steps
- Validation Agent: Verifies task completion and data sufficiency
- Answer Agent: Synthesizes findings into comprehensive responses
patriot/
├── src/
│ ├── patriot/
│ │ ├── agent.py # Main agent orchestration logic
│ │ ├── model.py # LLM interface
│ │ ├── tools.py # Cybersecurity tools
│ │ ├── prompts.py # System prompts for each component
│ │ ├── schemas.py # Pydantic models
│ │ ├── utils/ # Utility functions
│ │ └── cli.py # CLI entry point
├── pyproject.toml
└── uv.lock
Patriot supports configuration via the Agent class initialization:
from patriot.agent import Agent
agent = Agent(
max_steps=20, # Global safety limit
max_steps_per_task=5 # Per-task iteration limit
)- Add line breaks to AI answer
- Better tool use - terminal actions + file reading
- Better OS and systems context
- Enhance system prompt + add make it better for windows and linux
Apache-2.0-license
Officially open source
Built by Adhyaay Karnwal for CyberPatriot


