Skip to content
This repository was archived by the owner on Nov 29, 2025. It is now read-only.

Commit 64c3170

Browse files
authored
Merge pull request #87 from westonbrown/claude/issue-81-20251108-1705
refactor: ConfigManager consolidation and operation improvements
2 parents 074e3e7 + 5d91685 commit 64c3170

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+2209
-424
lines changed

README.md

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -97,27 +97,43 @@ The React terminal will automatically spawn the Python agent as a subprocess and
9797

9898
#### Single Container
9999

100+
**Interactive Mode (React Terminal UI):**
100101
```bash
101-
# Interactive mode with React terminal
102102
docker run -it --rm \
103-
-e AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} \
104-
-e AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} \
105-
-e AWS_REGION=${AWS_REGION:-us-east-1} \
103+
-e AZURE_API_KEY=your_azure_key \
104+
-e AZURE_API_BASE=https://your-endpoint.openai.azure.com/ \
105+
-e AZURE_API_VERSION=2024-12-01-preview \
106+
-e CYBER_AGENT_LLM_MODEL=azure/gpt-5 \
107+
-e CYBER_AGENT_EMBEDDING_MODEL=azure/text-embedding-3-large \
106108
-v $(pwd)/outputs:/app/outputs \
107-
cyber-autoagent
109+
cyberautoagent:latest
110+
```
108111

109-
# Or start directly with parameters
110-
docker run -it --rm \
111-
-e AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} \
112-
-e AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} \
113-
-e AWS_REGION=${AWS_REGION:-us-east-1} \
112+
**Direct Python Execution (Non-Interactive):**
113+
```bash
114+
# Override entrypoint for direct Python execution
115+
docker run --rm --entrypoint python \
116+
-e AZURE_API_KEY=your_azure_key \
117+
-e AZURE_API_BASE=https://your-endpoint.openai.azure.com/ \
118+
-e AZURE_API_VERSION=2024-12-01-preview \
119+
-e CYBER_AGENT_LLM_MODEL=azure/gpt-5 \
120+
-e CYBER_AGENT_EMBEDDING_MODEL=azure/text-embedding-3-large \
121+
-e REASONING_EFFORT=medium \
114122
-v $(pwd)/outputs:/app/outputs \
115-
cyber-autoagent \
123+
cyberautoagent:latest \
124+
src/cyberautoagent.py \
116125
--target "http://testphp.vulnweb.com" \
117126
--objective "Identify SQL injection vulnerabilities" \
118-
--auto-run
127+
--iterations 50 \
128+
--provider litellm
119129
```
120130

131+
**Works with any LiteLLM provider (300+ supported):**
132+
- Azure OpenAI: `azure/model-name`
133+
- AWS Bedrock: Use AWS credentials instead
134+
- OpenRouter: Set `OPENROUTER_API_KEY`, use `openrouter/model-name`
135+
- Moonshot AI: Set `MOONSHOT_API_KEY`, use `moonshot/model-name`
136+
121137
#### Docker Compose (Full Stack with Observability)
122138

123139
**Setup:** Create `.env` file in project root with your configuration:

docker/Dockerfile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,16 +168,20 @@ RUN cd /app/src/modules/interfaces/react && \
168168
chown -R cyberagent:cyberagent /app/src/modules/interfaces/react
169169

170170
# Install chromium browser for playwright to use
171-
# We use the PLAYWRIGHT_HOST_PLATFORM_OVERRIDE to force installation of Debian 13 packages on Kali Rolling since
172-
# Kali Rolling is based off Debian Testing and playwright does not have a specific Kali target.
173-
RUN env PLAYWRIGHT_HOST_PLATFORM_OVERRIDE="debian13-$(dpkg --print-architecture | sed 's/amd/x/')" uv run playwright install chromium --with-deps && \
171+
RUN env PLAYWRIGHT_HOST_PLATFORM_OVERRIDE="debian13-$(dpkg --print-architecture | sed 's/amd/x/')" \
172+
PLAYWRIGHT_BROWSERS_PATH=/home/cyberagent/.cache/ms-playwright \
173+
uv run playwright install chromium --with-deps && \
174+
chown -R cyberagent:cyberagent /home/cyberagent/.cache && \
175+
CHROME_BIN=$(find /home/cyberagent/.cache/ms-playwright -type f \( -name chrome -o -name chromium \) | head -n 1) && \
176+
if [ -n "$CHROME_BIN" ]; then mkdir -p /usr/lib/chromium && ln -sf "$CHROME_BIN" /usr/lib/chromium/chromium; fi && \
174177
apt-get clean && \
175178
rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*
176179

177180
# Environment
178181
ENV GOPATH="/home/cyberagent/go"
179182
ENV GOCACHE="/home/cyberagent/go/.cache"
180183
ENV PATH="/app/.venv/bin:/home/cyberagent/go/bin:$PATH"
184+
ENV PLAYWRIGHT_BROWSERS_PATH="/home/cyberagent/.cache/ms-playwright"
181185
ENV PYTHONPATH="/usr/lib/python3/dist-packages:/app/src"
182186

183187
# Pre-install Go-based recon tools (mix of go build and prebuilt binaries)

docs/deployment.md

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,144 @@
22

33
This guide covers deployment options for Cyber-AutoAgent in various environments.
44

5+
## Invocation Methods
6+
7+
Cyber-AutoAgent supports **4 invocation methods**, each with different use cases:
8+
9+
### 1. Python CLI (Direct Execution)
10+
11+
Best for: Automation, scripting, CI/CD pipelines
12+
13+
```bash
14+
# Configure via environment variables
15+
export AZURE_API_KEY="your_key"
16+
export AZURE_API_BASE="https://your-endpoint.openai.azure.com/"
17+
export AZURE_API_VERSION="2024-12-01-preview"
18+
export CYBER_AGENT_LLM_MODEL="azure/gpt-5"
19+
export CYBER_AGENT_EMBEDDING_MODEL="azure/text-embedding-3-large"
20+
export REASONING_EFFORT="medium"
21+
22+
# Run with uv (recommended)
23+
uv run python src/cyberautoagent.py \
24+
--target "https://example.com" \
25+
--objective "Bug bounty assessment" \
26+
--iterations 150 \
27+
--provider litellm
28+
```
29+
30+
### 2. NPM Auto-Run (Config File)
31+
32+
Best for: Repeated testing with saved config, development
33+
34+
```bash
35+
# Uses ~/.cyber-autoagent/config.json for settings
36+
cd src/modules/interfaces/react
37+
npm start -- --auto-run \
38+
--target "https://example.com" \
39+
--objective "Security assessment" \
40+
--iterations 50
41+
```
42+
43+
**Configure via** `~/.cyber-autoagent/config.json`:
44+
```json
45+
{
46+
"modelProvider": "litellm",
47+
"modelId": "azure/gpt-5",
48+
"embeddingModel": "azure/text-embedding-3-large",
49+
"azureApiKey": "your_key",
50+
"azureApiBase": "https://your-endpoint.openai.azure.com/",
51+
"azureApiVersion": "2024-12-01-preview",
52+
"reasoningEffort": "medium"
53+
}
54+
```
55+
56+
### 3. Docker (Standalone Container)
57+
58+
Best for: Isolated environments, clean tooling, reproducibility
59+
60+
**With Interactive React Terminal:**
61+
```bash
62+
docker run -it --rm \
63+
-e AZURE_API_KEY=your_key \
64+
-e AZURE_API_BASE=https://your-endpoint.openai.azure.com/ \
65+
-e CYBER_AGENT_LLM_MODEL=azure/gpt-5 \
66+
-v $(pwd)/outputs:/app/outputs \
67+
cyberautoagent:latest
68+
```
69+
70+
**Direct Python Execution (Override Entrypoint):**
71+
```bash
72+
docker run --rm --entrypoint python \
73+
-e AZURE_API_KEY=your_key \
74+
-e AZURE_API_BASE=https://your-endpoint.openai.azure.com/ \
75+
-e AZURE_API_VERSION=2024-12-01-preview \
76+
-e CYBER_AGENT_LLM_MODEL=azure/gpt-5 \
77+
-e CYBER_AGENT_EMBEDDING_MODEL=azure/text-embedding-3-large \
78+
-e REASONING_EFFORT=medium \
79+
-v $(pwd)/outputs:/app/outputs \
80+
cyberautoagent:latest \
81+
src/cyberautoagent.py \
82+
--target https://example.com \
83+
--objective "Security assessment" \
84+
--iterations 50 \
85+
--provider litellm
86+
```
87+
88+
### 4. Docker Compose (Full Stack)
89+
90+
Best for: Observability, team deployments, production monitoring
91+
92+
```bash
93+
# Uses docker/.env for configuration
94+
docker compose -f docker/docker-compose.yml up -d
95+
```
96+
97+
## Universal Provider Support
98+
99+
Cyber-AutoAgent supports **300+ LLM providers** via LiteLLM. Examples:
100+
101+
**Azure OpenAI:**
102+
```bash
103+
-e AZURE_API_KEY=your_key
104+
-e AZURE_API_BASE=https://your-endpoint.openai.azure.com/
105+
-e AZURE_API_VERSION=2024-12-01-preview
106+
-e CYBER_AGENT_LLM_MODEL=azure/gpt-5
107+
-e CYBER_AGENT_EMBEDDING_MODEL=azure/text-embedding-3-large
108+
```
109+
110+
**AWS Bedrock:**
111+
```bash
112+
-e AWS_ACCESS_KEY_ID=your_key
113+
-e AWS_SECRET_ACCESS_KEY=your_secret
114+
-e CYBER_AGENT_LLM_MODEL=us.anthropic.claude-sonnet-4-5-20250929-v1:0
115+
-e CYBER_AGENT_EMBEDDING_MODEL=amazon.titan-embed-text-v2:0
116+
```
117+
118+
**OpenRouter:**
119+
```bash
120+
-e OPENROUTER_API_KEY=your_key
121+
-e CYBER_AGENT_LLM_MODEL=openrouter/openrouter/polaris-alpha
122+
-e CYBER_AGENT_EMBEDDING_MODEL=azure/text-embedding-3-large
123+
```
124+
125+
**Moonshot AI:**
126+
```bash
127+
-e MOONSHOT_API_KEY=your_key
128+
-e OPENAI_API_KEY=your_key # Required for Mem0 OpenAI-compatible providers
129+
-e CYBER_AGENT_LLM_MODEL=moonshot/kimi-k2-thinking
130+
-e CYBER_AGENT_EMBEDDING_MODEL=azure/text-embedding-3-large
131+
-e MEM0_LLM_MODEL=azure/gpt-4o # Memory system LLM (use Azure/Anthropic/Bedrock for Mem0)
132+
-e AZURE_API_KEY=azure_key # Required for embeddings and Mem0
133+
-e AZURE_API_BASE=https://your-endpoint.openai.azure.com/
134+
-e AZURE_API_VERSION=2024-12-01-preview
135+
```
136+
137+
**Note:** When using OpenAI-compatible providers (Moonshot, OpenRouter, etc.) with Mem0, you must:
138+
1. Set `OPENAI_API_KEY` to the provider's API key for Mem0 compatibility
139+
2. Use a supported Mem0 provider (Azure, OpenAI, Anthropic, Bedrock) for `MEM0_LLM_MODEL`
140+
141+
**Mixed Providers:** You can combine any LLM with any embedding model!
142+
5143
## Quick Start
6144

7145
### Using Docker (Recommended)

docs/prompt_management.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,8 @@ src/modules/operation_plugins/
6363
│ ├── execution_prompt.md # Domain-specific system prompt
6464
│ ├── report_prompt.md # Report generation guidance
6565
│ ├── module.yaml # Module configuration
66-
│ └── tools/ # Module-specific tools
67-
│ ├── __init__.py
68-
│ └── quick_recon.py
66+
│ └── tools/ # Module-specific tools / specialist agents
67+
│ └── validation_specialist.py
6968
└── ctf/
7069
├── execution_prompt.md
7170
├── report_prompt.md
@@ -83,6 +82,7 @@ configuration:
8382
8483
**Available Modules**:
8584
- **general**: Comprehensive web application and network security testing
85+
- Includes the `validation_specialist` tool (invoked via `load_tool("validation_specialist")`) and can be extended with additional specialist agents following the same pattern.
8686
- **ctf**: CTF challenge solving with flag recognition and success detection
8787

8888
## Prompt Loading System
@@ -360,4 +360,4 @@ agent, callback_handler = create_agent(
360360
```
361361

362362

363-
The module system provides a powerful way to specialize Cyber-AutoAgent for different security domains while maintaining consistent core functionality and user experience.
363+
The module system provides a powerful way to specialize Cyber-AutoAgent for different security domains while maintaining consistent core functionality and user experience.

docs/user-instructions.md

Lines changed: 82 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,52 @@ Select during setup or change via `/setup` command.
3636

3737
## Configuration
3838

39-
Configuration persists to `~/.cyber-autoagent/config.json`.
39+
Cyber-AutoAgent offers **3 configuration methods**:
4040

41-
### Model Providers
41+
### Method 1: Config Editor UI (Recommended)
42+
43+
Launch the React interface to configure via UI:
44+
45+
```bash
46+
cd src/modules/interfaces/react
47+
npm start
48+
```
49+
50+
**In the Terminal:**
51+
1. Type `/config` to open Config Editor
52+
2. Select **Provider**: `litellm` (supports 300+ models)
53+
3. Configure **LLM Settings**:
54+
- Model ID: `azure/gpt-5`, `moonshot/kimi-k2-thinking`, `openrouter/openrouter/polaris-alpha`
55+
- Temperature: `1.0` (for reasoning models) or `0.95` (default)
56+
- Max Tokens: `32000`
57+
- Reasoning Effort: `medium` (for GPT-5/o1 models)
58+
4. Configure **Embedding Model**: `azure/text-embedding-3-large`
59+
5. Add **Provider Credentials**:
60+
- Azure: API Key, API Base, API Version
61+
- Moonshot: API Key
62+
- OpenRouter: API Key
63+
6. Save settings - persists to `~/.cyber-autoagent/config.json`
64+
7. Type `/help` for available commands
65+
66+
**Using Saved Config:**
67+
```bash
68+
# Auto-run uses saved config
69+
npm start -- --auto-run --target https://example.com --iterations 50
70+
```
71+
72+
### Method 2: Environment Variables
73+
74+
Direct configuration for Python CLI:
75+
76+
**Azure OpenAI (GPT-5):**
77+
```bash
78+
export AZURE_API_KEY=your_key
79+
export AZURE_API_BASE=https://your-endpoint.openai.azure.com/
80+
export AZURE_API_VERSION=2024-12-01-preview
81+
export CYBER_AGENT_LLM_MODEL=azure/gpt-5
82+
export CYBER_AGENT_EMBEDDING_MODEL=azure/text-embedding-3-large
83+
export REASONING_EFFORT=medium
84+
```
4285

4386
**AWS Bedrock:**
4487
```bash
@@ -47,6 +90,21 @@ export AWS_SECRET_ACCESS_KEY=your_secret
4790
export AWS_REGION=us-east-1
4891
```
4992

93+
**OpenRouter:**
94+
```bash
95+
export OPENROUTER_API_KEY=your_key
96+
export CYBER_AGENT_LLM_MODEL=openrouter/openrouter/polaris-alpha
97+
export CYBER_AGENT_EMBEDDING_MODEL=azure/text-embedding-3-large
98+
```
99+
100+
**Moonshot AI:**
101+
```bash
102+
export MOONSHOT_API_KEY=your_key
103+
export CYBER_AGENT_LLM_MODEL=moonshot/kimi-k2-thinking
104+
export CYBER_AGENT_EMBEDDING_MODEL=azure/text-embedding-3-large
105+
export MEM0_LLM_MODEL=azure/gpt-4o # Separate LLM for memory system
106+
```
107+
50108
**Ollama (Local):**
51109
```bash
52110
ollama serve
@@ -61,6 +119,28 @@ export OPENAI_API_KEY=your_key
61119
export ANTHROPIC_API_KEY=your_key
62120
```
63121

122+
### Method 3: Config File (Direct Edit)
123+
124+
Advanced users can directly edit `~/.cyber-autoagent/config.json`:
125+
126+
```json
127+
{
128+
"modelProvider": "litellm",
129+
"modelId": "azure/gpt-5",
130+
"embeddingModel": "azure/text-embedding-3-large",
131+
"temperature": 1.0,
132+
"maxTokens": 32000,
133+
"reasoningEffort": "medium",
134+
"azureApiKey": "your_key",
135+
"azureApiBase": "https://your-endpoint.openai.azure.com/",
136+
"azureApiVersion": "2024-12-01-preview",
137+
"observability": false,
138+
"autoEvaluation": false
139+
}
140+
```
141+
142+
**Supported Providers:** `bedrock`, `ollama`, `litellm` (300+ models)
143+
64144
### Configuration Commands
65145

66146
| Command | Function |

pyproject.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,12 @@ classifiers = [
2929
]
3030
requires-python = ">=3.10,<3.14"
3131
dependencies = [
32-
"strands-agents[ollama,otel,litellm]==1.11.0",
33-
"strands-agents-tools==0.2.9",
34-
"mem0ai",
32+
"strands-agents[ollama,otel,litellm]>=1.11.0",
33+
"strands-agents-tools>=0.2.9",
34+
"mem0ai>=0.1.116",
35+
"google-genai>=0.3.0",
36+
"litellm>=1.79.1",
37+
"azure-identity>=1.15.0",
3538
"boto3>=1.39.10",
3639
"botocore>=1.39.10",
3740
"faiss-cpu",

0 commit comments

Comments
 (0)