scopeforge 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- scopeforge-0.1.0/.gitignore +30 -0
- scopeforge-0.1.0/PKG-INFO +188 -0
- scopeforge-0.1.0/README.md +155 -0
- scopeforge-0.1.0/pyproject.toml +65 -0
- scopeforge-0.1.0/src/scopeforge_engine/__init__.py +1 -0
- scopeforge-0.1.0/src/scopeforge_engine/a2a/__init__.py +5 -0
- scopeforge-0.1.0/src/scopeforge_engine/a2a/bus.py +65 -0
- scopeforge-0.1.0/src/scopeforge_engine/a2a/protocol.py +44 -0
- scopeforge-0.1.0/src/scopeforge_engine/agent.py +326 -0
- scopeforge-0.1.0/src/scopeforge_engine/agents/__init__.py +11 -0
- scopeforge-0.1.0/src/scopeforge_engine/agents/custom_agent.py +88 -0
- scopeforge-0.1.0/src/scopeforge_engine/agents/graph.py +792 -0
- scopeforge-0.1.0/src/scopeforge_engine/agents/state.py +26 -0
- scopeforge-0.1.0/src/scopeforge_engine/browser.py +81 -0
- scopeforge-0.1.0/src/scopeforge_engine/coach.py +102 -0
- scopeforge-0.1.0/src/scopeforge_engine/coverage_skeleton.py +43 -0
- scopeforge-0.1.0/src/scopeforge_engine/db.py +91 -0
- scopeforge-0.1.0/src/scopeforge_engine/egress.py +254 -0
- scopeforge-0.1.0/src/scopeforge_engine/evidence.py +229 -0
- scopeforge-0.1.0/src/scopeforge_engine/exporter.py +150 -0
- scopeforge-0.1.0/src/scopeforge_engine/labs.py +117 -0
- scopeforge-0.1.0/src/scopeforge_engine/llm_providers/__init__.py +14 -0
- scopeforge-0.1.0/src/scopeforge_engine/llm_providers/factory.py +167 -0
- scopeforge-0.1.0/src/scopeforge_engine/llm_providers/manager.py +464 -0
- scopeforge-0.1.0/src/scopeforge_engine/llm_providers/mock.py +250 -0
- scopeforge-0.1.0/src/scopeforge_engine/llm_providers/models.py +253 -0
- scopeforge-0.1.0/src/scopeforge_engine/mcp.py +193 -0
- scopeforge-0.1.0/src/scopeforge_engine/mcp_bridge.py +74 -0
- scopeforge-0.1.0/src/scopeforge_engine/middleware/__init__.py +18 -0
- scopeforge-0.1.0/src/scopeforge_engine/middleware/approval.py +61 -0
- scopeforge-0.1.0/src/scopeforge_engine/middleware/audit.py +76 -0
- scopeforge-0.1.0/src/scopeforge_engine/middleware/base.py +58 -0
- scopeforge-0.1.0/src/scopeforge_engine/middleware/pipeline.py +89 -0
- scopeforge-0.1.0/src/scopeforge_engine/middleware/redaction.py +57 -0
- scopeforge-0.1.0/src/scopeforge_engine/middleware/scope_gate.py +110 -0
- scopeforge-0.1.0/src/scopeforge_engine/models/__init__.py +61 -0
- scopeforge-0.1.0/src/scopeforge_engine/models/anthropic_compat.py +277 -0
- scopeforge-0.1.0/src/scopeforge_engine/models/errors.py +31 -0
- scopeforge-0.1.0/src/scopeforge_engine/models/factory.py +63 -0
- scopeforge-0.1.0/src/scopeforge_engine/models/gemini.py +305 -0
- scopeforge-0.1.0/src/scopeforge_engine/models/http.py +97 -0
- scopeforge-0.1.0/src/scopeforge_engine/models/litellm_bridge.py +194 -0
- scopeforge-0.1.0/src/scopeforge_engine/models/mock.py +88 -0
- scopeforge-0.1.0/src/scopeforge_engine/models/ollama.py +239 -0
- scopeforge-0.1.0/src/scopeforge_engine/models/openai_compat.py +338 -0
- scopeforge-0.1.0/src/scopeforge_engine/models/presets.py +95 -0
- scopeforge-0.1.0/src/scopeforge_engine/models/replay.py +94 -0
- scopeforge-0.1.0/src/scopeforge_engine/models/router.py +143 -0
- scopeforge-0.1.0/src/scopeforge_engine/models/sanitize.py +106 -0
- scopeforge-0.1.0/src/scopeforge_engine/models/secrets.py +75 -0
- scopeforge-0.1.0/src/scopeforge_engine/models/types.py +169 -0
- scopeforge-0.1.0/src/scopeforge_engine/parsers.py +280 -0
- scopeforge-0.1.0/src/scopeforge_engine/policy.py +598 -0
- scopeforge-0.1.0/src/scopeforge_engine/proof_gate.py +66 -0
- scopeforge-0.1.0/src/scopeforge_engine/protocol_generated.py +37 -0
- scopeforge-0.1.0/src/scopeforge_engine/providers.py +154 -0
- scopeforge-0.1.0/src/scopeforge_engine/rag/__init__.py +4 -0
- scopeforge-0.1.0/src/scopeforge_engine/rag/engine.py +150 -0
- scopeforge-0.1.0/src/scopeforge_engine/reports.py +125 -0
- scopeforge-0.1.0/src/scopeforge_engine/roles.py +189 -0
- scopeforge-0.1.0/src/scopeforge_engine/runs.py +280 -0
- scopeforge-0.1.0/src/scopeforge_engine/sec_tools/__init__.py +50 -0
- scopeforge-0.1.0/src/scopeforge_engine/sec_tools/code_tools.py +409 -0
- scopeforge-0.1.0/src/scopeforge_engine/sec_tools/tools.py +375 -0
- scopeforge-0.1.0/src/scopeforge_engine/server.py +1584 -0
- scopeforge-0.1.0/src/scopeforge_engine/skills/__init__.py +5 -0
- scopeforge-0.1.0/src/scopeforge_engine/skills/manager.py +233 -0
- scopeforge-0.1.0/src/scopeforge_engine/skills/models.py +95 -0
- scopeforge-0.1.0/src/scopeforge_engine/store.py +129 -0
- scopeforge-0.1.0/src/scopeforge_engine/tools.py +188 -0
- scopeforge-0.1.0/src/scopeforge_engine/tui/__init__.py +4 -0
- scopeforge-0.1.0/src/scopeforge_engine/tui/app.py +1143 -0
- scopeforge-0.1.0/src/scopeforge_engine/tui/clipboard.py +274 -0
- scopeforge-0.1.0/src/scopeforge_engine/tui/screens/approval_screen.py +46 -0
- scopeforge-0.1.0/src/scopeforge_engine/tui/screens/help_screen.py +104 -0
- scopeforge-0.1.0/src/scopeforge_engine/tui/screens/model_screen.py +538 -0
- scopeforge-0.1.0/src/scopeforge_engine/tui/screens/wiki_screen.py +58 -0
- scopeforge-0.1.0/src/scopeforge_engine/tui/styles.py +265 -0
- scopeforge-0.1.0/src/scopeforge_engine/tui/widgets/chat_log.py +267 -0
- scopeforge-0.1.0/src/scopeforge_engine/tui/widgets/clipboard_input.py +94 -0
- scopeforge-0.1.0/src/scopeforge_engine/tui/widgets/header_bar.py +77 -0
- scopeforge-0.1.0/src/scopeforge_engine/tui/widgets/prompt_bar.py +174 -0
- scopeforge-0.1.0/src/scopeforge_engine/tui/widgets/sidebar.py +188 -0
- scopeforge-0.1.0/src/scopeforge_engine/wiki/__init__.py +4 -0
- scopeforge-0.1.0/src/scopeforge_engine/wiki/store.py +112 -0
- scopeforge-0.1.0/tests/conftest.py +10 -0
- scopeforge-0.1.0/tests/test_agent.py +249 -0
- scopeforge-0.1.0/tests/test_agent_rpc.py +101 -0
- scopeforge-0.1.0/tests/test_browser.py +38 -0
- scopeforge-0.1.0/tests/test_clipboard.py +127 -0
- scopeforge-0.1.0/tests/test_conformance.py +192 -0
- scopeforge-0.1.0/tests/test_conformance_phase8.py +157 -0
- scopeforge-0.1.0/tests/test_egress.py +202 -0
- scopeforge-0.1.0/tests/test_egress_rpc.py +160 -0
- scopeforge-0.1.0/tests/test_golden_t02.py +43 -0
- scopeforge-0.1.0/tests/test_labs.py +67 -0
- scopeforge-0.1.0/tests/test_new_suite.py +586 -0
- scopeforge-0.1.0/tests/test_phase8.py +175 -0
- scopeforge-0.1.0/tests/test_policy.py +205 -0
- scopeforge-0.1.0/tests/test_policy_props.py +52 -0
- scopeforge-0.1.0/tests/test_policy_rpc.py +114 -0
- scopeforge-0.1.0/tests/test_provider_units.py +190 -0
- scopeforge-0.1.0/tests/test_providers_live.py +106 -0
- scopeforge-0.1.0/tests/test_records_rpc.py +142 -0
- scopeforge-0.1.0/tests/test_run_store.py +183 -0
- scopeforge-0.1.0/tests/test_secrets.py +121 -0
- scopeforge-0.1.0/tests/test_server.py +194 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
node_modules/
|
|
2
|
+
dist/
|
|
3
|
+
build/
|
|
4
|
+
.turbo/
|
|
5
|
+
*.tsbuildinfo
|
|
6
|
+
|
|
7
|
+
.venv/
|
|
8
|
+
__pycache__/
|
|
9
|
+
*.pyc
|
|
10
|
+
*.pyo
|
|
11
|
+
*.egg-info/
|
|
12
|
+
uv.lock.bak/
|
|
13
|
+
|
|
14
|
+
.scopeforge/
|
|
15
|
+
runs/
|
|
16
|
+
|
|
17
|
+
*.log
|
|
18
|
+
.DS_Store
|
|
19
|
+
.env
|
|
20
|
+
.env.*
|
|
21
|
+
!.env.example
|
|
22
|
+
|
|
23
|
+
coverage/
|
|
24
|
+
.nyc_output/
|
|
25
|
+
.pytest_cache/
|
|
26
|
+
.hypothesis/
|
|
27
|
+
|
|
28
|
+
# Generated SBOM / provenance (run `uv run python scripts/sbom.py`)
|
|
29
|
+
sbom.json
|
|
30
|
+
provenance.json
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: scopeforge
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: ScopeForge — Commercial-Grade Cybersecurity Multi-Agent Harness & Interactive TUI
|
|
5
|
+
Author-email: Boopathi Raj <boopathi@neuronestai.in>
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Keywords: agent-harness,claude-code,cybersecurity,langchain,langgraph,mcp,security-automation,textual,tui
|
|
8
|
+
Classifier: Development Status :: 4 - Beta
|
|
9
|
+
Classifier: Environment :: Console
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: Intended Audience :: Information Technology
|
|
12
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Topic :: Security
|
|
17
|
+
Classifier: Topic :: Terminals
|
|
18
|
+
Requires-Python: >=3.12
|
|
19
|
+
Requires-Dist: anyio>=4.4
|
|
20
|
+
Requires-Dist: httpx>=0.27
|
|
21
|
+
Requires-Dist: langchain>=1.0.0
|
|
22
|
+
Requires-Dist: langgraph>=1.0.0
|
|
23
|
+
Requires-Dist: llama-index-core>=0.14.0
|
|
24
|
+
Requires-Dist: pydantic>=2.7
|
|
25
|
+
Requires-Dist: pyyaml>=6.0
|
|
26
|
+
Requires-Dist: textual>=8.0.0
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
Requires-Dist: hypothesis>=6; extra == 'dev'
|
|
29
|
+
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
|
|
30
|
+
Requires-Dist: pytest>=8; extra == 'dev'
|
|
31
|
+
Requires-Dist: respx>=0.22; extra == 'dev'
|
|
32
|
+
Description-Content-Type: text/markdown
|
|
33
|
+
|
|
34
|
+
# ScopeForge
|
|
35
|
+
|
|
36
|
+
> **Commercial-Grade Cybersecurity Multi-Agent Harness & Claude Code Style TUI**
|
|
37
|
+
> Autonomous SecOps Orchestrator, LangGraph Multi-Agent Team, LangChain Tool Harness, MCP Bridge & Interactive Terminal UI.
|
|
38
|
+
|
|
39
|
+
[](https://pypi.org/project/scopeforge/)
|
|
40
|
+
[](https://pypi.org/project/scopeforge/)
|
|
41
|
+
[](https://opensource.org/licenses/Apache-2.0)
|
|
42
|
+
[](https://textual.textualize.io/)
|
|
43
|
+
[](https://langchain-ai.github.io/langgraph/)
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## ⚡ What is ScopeForge?
|
|
48
|
+
|
|
49
|
+
**ScopeForge** is a standalone, commercial-grade autonomous cybersecurity agent harness and terminal interface designed to work like **Claude Code** and **Open Code**, but specifically engineered with **ScopeGate Rules of Engagement (RoE)** safety guarantees.
|
|
50
|
+
|
|
51
|
+
Powered by **LangChain**, **LangGraph**, **Textual**, and the **Model Context Protocol (MCP)**, ScopeForge coordinates specialized cybersecurity agents to perform automated reconnaissance, vulnerability scanning, static code analysis (SAST), proof-of-concept verification, and executive reporting—or operates as a general-purpose AI coding and system administration assistant.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## 🚀 Installation & Quickstart
|
|
56
|
+
|
|
57
|
+
### 1. Install via pip / pipx / uv
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
# Recommended: Install using pipx (isolated environment)
|
|
61
|
+
pipx install scopeforge
|
|
62
|
+
|
|
63
|
+
# Or standard pip
|
|
64
|
+
pip install scopeforge
|
|
65
|
+
|
|
66
|
+
# Or run instantly without installation via uv
|
|
67
|
+
uvx scopeforge
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### 2. Launch the Interactive TUI
|
|
71
|
+
|
|
72
|
+
Simply type `scopeforge` or the shorthand `sf` in your terminal:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
scopeforge
|
|
76
|
+
# Or:
|
|
77
|
+
sf
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
ScopeForge will launch directly into the dark-themed reactive terminal UI.
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## ⌨️ Modern Terminal Shortcuts
|
|
85
|
+
|
|
86
|
+
ScopeForge uses standard modern terminal `Ctrl+[key]` bindings:
|
|
87
|
+
|
|
88
|
+
| Shortcut | Secondary | Action | Description |
|
|
89
|
+
|:---:|:---:|:---|:---|
|
|
90
|
+
| <kbd>Ctrl+M</kbd> | <kbd>F1</kbd> | **Model Switcher** | Open live model picker, filter presets, or configure custom endpoints |
|
|
91
|
+
| <kbd>Ctrl+H</kbd> | <kbd>F2</kbd> | **Help Cheatsheet** | Show all slash commands, shortcuts, and agent roles |
|
|
92
|
+
| <kbd>Ctrl+O</kbd> | <kbd>F3</kbd> | **Toggle SecOps Mode** | Cycle policy gates (`plan` ↔ `live` ↔ `artifacts`) |
|
|
93
|
+
| <kbd>Ctrl+B</kbd> | <kbd>F4</kbd> | **Toggle Sidebar** | Expand or collapse agent telemetry and finding ledger |
|
|
94
|
+
| <kbd>Ctrl+W</kbd> | <kbd>F5</kbd> | **SecOps Wiki** | Open persistent knowledge base and user preferences |
|
|
95
|
+
| <kbd>Ctrl+Y</kbd> | <kbd>F6</kbd> | **Copy Last Response** | Copy the latest AI response to system clipboard |
|
|
96
|
+
| <kbd>Ctrl+T</kbd> | <kbd>F7</kbd> | **Toggle Native Mouse** | Switch between TUI clicks and terminal text selection |
|
|
97
|
+
| <kbd>Ctrl+L</kbd> | — | **Clear Screen** | Clear conversation stream and reset buffer |
|
|
98
|
+
| <kbd>Ctrl+Q</kbd> | — | **Quit** | Safely exit ScopeForge |
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## 🤖 Multi-Agent Team (LangGraph)
|
|
103
|
+
|
|
104
|
+
ScopeForge routes tasks dynamically to specialized autonomous agents:
|
|
105
|
+
|
|
106
|
+
- 🧠 **Supervisor**: General architecture, system management, code discussion, and high-level strategy.
|
|
107
|
+
- 💻 **DevAgent**: Local code workspace operations, terminal sandbox commands, skill installation, and live web research.
|
|
108
|
+
- 🛰️ **ReconAgent**: Passive & active reconnaissance, port discovery telemetry, and attack surface enumeration.
|
|
109
|
+
- 🔬 **AuditAgent**: Static code auditing (SAST), CVE advisory correlation, and OWASP vulnerability identification.
|
|
110
|
+
- ⚡ **ExploitAgent**: Controlled proof-of-concept (PoC) validation within strict authorized bounds.
|
|
111
|
+
- 📋 **ReportAgent**: Executive SecOps summary, CVSS scoring, and remediation action plans.
|
|
112
|
+
|
|
113
|
+
Agents communicate asynchronously using the cryptographically verified **Agent-to-Agent (A2A) Protocol Bus**.
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## 🛠️ LangChain Autonomous Tool-Calling Harness
|
|
118
|
+
|
|
119
|
+
ScopeForge provides real autonomous tool execution through LangChain:
|
|
120
|
+
- **Autonomous Tool Binding**: Models (`OpenRouter`, `Groq`, `DeepSeek`, `Claude`, `OpenAI`) are automatically bound to the complete toolsuite and active MCP tools via `chat_model.bind_tools()`.
|
|
121
|
+
- **Iterative Tool Execution**: The harness detects `tool_calls`, executes tools safely via the ScopeGate middleware pipeline, feeds `ToolMessage` outputs back into context, and synthesizes answers iteratively.
|
|
122
|
+
- **Built-in Tools**:
|
|
123
|
+
- `bash_cli`: Sandboxed shell execution with dangerous-pattern blocking.
|
|
124
|
+
- `google_web_search`: Live web search for fast technical lookups.
|
|
125
|
+
- `view_file` / `write_file` / `edit_file`: Surgical code workspace inspection and editing.
|
|
126
|
+
- `glob_files` / `grep_search`: Fast repository pattern discovery.
|
|
127
|
+
- `git_status_tool` / `git_diff_tool` / `git_commit_tool`: Git version control operations.
|
|
128
|
+
- `recon_port_scan` / `web_surface_probe`: Perimeter discovery tools.
|
|
129
|
+
- `sast_code_audit` / `cve_advisory_search`: Vulnerability triage tools.
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## 🌐 Model Support & Custom API Configuration
|
|
134
|
+
|
|
135
|
+
ScopeForge supports any OpenAI-compatible, Anthropic, or Ollama provider:
|
|
136
|
+
|
|
137
|
+
### Quick Presets (Zero Setup):
|
|
138
|
+
- `openrouter-free`: Meta-router for high-availability free frontier models (`openrouter/free`).
|
|
139
|
+
- `openrouter-free-nemotron`: NVIDIA Nemotron 550B Free.
|
|
140
|
+
- `groq-llama3`: Llama 3.3 70B on Groq Ultra-Fast inference.
|
|
141
|
+
- `ollama-llama3`: Offline local models via Ollama.
|
|
142
|
+
|
|
143
|
+
### Custom Endpoints & Third-Party Proxies:
|
|
144
|
+
Open the Model Switcher (<kbd>Ctrl+M</kbd>) or use slash commands:
|
|
145
|
+
|
|
146
|
+
```text
|
|
147
|
+
/model
|
|
148
|
+
/config set key <API_KEY>
|
|
149
|
+
/config set model <MODEL_ID>
|
|
150
|
+
/config set base <CUSTOM_URL>
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
ScopeForge features native paste de-duplication and custom endpoint normalization (no forced path appending).
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## 🔌 Model Context Protocol (MCP) & Skills
|
|
158
|
+
|
|
159
|
+
### MCP Integration:
|
|
160
|
+
```text
|
|
161
|
+
/mcp # List all configured MCP servers
|
|
162
|
+
/mcp tools # View all registered MCP tools
|
|
163
|
+
/mcp add <name> <command> # Add and enable an MCP server
|
|
164
|
+
/mcp enable <name> # Enable a server
|
|
165
|
+
/mcp disable <name> # Disable a server
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Extensible Skills (`SKILL.md`):
|
|
169
|
+
Install custom skills from any Git repository:
|
|
170
|
+
```text
|
|
171
|
+
/skill install https://github.com/example/sec-skills
|
|
172
|
+
/skill list
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## 🛡️ ScopeGate Rules of Engagement (RoE)
|
|
178
|
+
|
|
179
|
+
ScopeForge operates under 3 strict enforcement modes:
|
|
180
|
+
1. **PLAN (`plan`)**: Zero network egress. Generates falsifiable hypotheses, models attack surface, and plans audits.
|
|
181
|
+
2. **ARTIFACTS (`artifacts`)**: Inspects locally supplied source code, HAR files, and logs without external traffic.
|
|
182
|
+
3. **LIVE (`live`)**: Network tools enabled strictly against authorized scope domains and IPs.
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## 📜 License
|
|
187
|
+
|
|
188
|
+
Licensed under the **Apache License, Version 2.0**.
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# ScopeForge
|
|
2
|
+
|
|
3
|
+
> **Commercial-Grade Cybersecurity Multi-Agent Harness & Claude Code Style TUI**
|
|
4
|
+
> Autonomous SecOps Orchestrator, LangGraph Multi-Agent Team, LangChain Tool Harness, MCP Bridge & Interactive Terminal UI.
|
|
5
|
+
|
|
6
|
+
[](https://pypi.org/project/scopeforge/)
|
|
7
|
+
[](https://pypi.org/project/scopeforge/)
|
|
8
|
+
[](https://opensource.org/licenses/Apache-2.0)
|
|
9
|
+
[](https://textual.textualize.io/)
|
|
10
|
+
[](https://langchain-ai.github.io/langgraph/)
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## ⚡ What is ScopeForge?
|
|
15
|
+
|
|
16
|
+
**ScopeForge** is a standalone, commercial-grade autonomous cybersecurity agent harness and terminal interface designed to work like **Claude Code** and **Open Code**, but specifically engineered with **ScopeGate Rules of Engagement (RoE)** safety guarantees.
|
|
17
|
+
|
|
18
|
+
Powered by **LangChain**, **LangGraph**, **Textual**, and the **Model Context Protocol (MCP)**, ScopeForge coordinates specialized cybersecurity agents to perform automated reconnaissance, vulnerability scanning, static code analysis (SAST), proof-of-concept verification, and executive reporting—or operates as a general-purpose AI coding and system administration assistant.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 🚀 Installation & Quickstart
|
|
23
|
+
|
|
24
|
+
### 1. Install via pip / pipx / uv
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# Recommended: Install using pipx (isolated environment)
|
|
28
|
+
pipx install scopeforge
|
|
29
|
+
|
|
30
|
+
# Or standard pip
|
|
31
|
+
pip install scopeforge
|
|
32
|
+
|
|
33
|
+
# Or run instantly without installation via uv
|
|
34
|
+
uvx scopeforge
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### 2. Launch the Interactive TUI
|
|
38
|
+
|
|
39
|
+
Simply type `scopeforge` or the shorthand `sf` in your terminal:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
scopeforge
|
|
43
|
+
# Or:
|
|
44
|
+
sf
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
ScopeForge will launch directly into the dark-themed reactive terminal UI.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## ⌨️ Modern Terminal Shortcuts
|
|
52
|
+
|
|
53
|
+
ScopeForge uses standard modern terminal `Ctrl+[key]` bindings:
|
|
54
|
+
|
|
55
|
+
| Shortcut | Secondary | Action | Description |
|
|
56
|
+
|:---:|:---:|:---|:---|
|
|
57
|
+
| <kbd>Ctrl+M</kbd> | <kbd>F1</kbd> | **Model Switcher** | Open live model picker, filter presets, or configure custom endpoints |
|
|
58
|
+
| <kbd>Ctrl+H</kbd> | <kbd>F2</kbd> | **Help Cheatsheet** | Show all slash commands, shortcuts, and agent roles |
|
|
59
|
+
| <kbd>Ctrl+O</kbd> | <kbd>F3</kbd> | **Toggle SecOps Mode** | Cycle policy gates (`plan` ↔ `live` ↔ `artifacts`) |
|
|
60
|
+
| <kbd>Ctrl+B</kbd> | <kbd>F4</kbd> | **Toggle Sidebar** | Expand or collapse agent telemetry and finding ledger |
|
|
61
|
+
| <kbd>Ctrl+W</kbd> | <kbd>F5</kbd> | **SecOps Wiki** | Open persistent knowledge base and user preferences |
|
|
62
|
+
| <kbd>Ctrl+Y</kbd> | <kbd>F6</kbd> | **Copy Last Response** | Copy the latest AI response to system clipboard |
|
|
63
|
+
| <kbd>Ctrl+T</kbd> | <kbd>F7</kbd> | **Toggle Native Mouse** | Switch between TUI clicks and terminal text selection |
|
|
64
|
+
| <kbd>Ctrl+L</kbd> | — | **Clear Screen** | Clear conversation stream and reset buffer |
|
|
65
|
+
| <kbd>Ctrl+Q</kbd> | — | **Quit** | Safely exit ScopeForge |
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## 🤖 Multi-Agent Team (LangGraph)
|
|
70
|
+
|
|
71
|
+
ScopeForge routes tasks dynamically to specialized autonomous agents:
|
|
72
|
+
|
|
73
|
+
- 🧠 **Supervisor**: General architecture, system management, code discussion, and high-level strategy.
|
|
74
|
+
- 💻 **DevAgent**: Local code workspace operations, terminal sandbox commands, skill installation, and live web research.
|
|
75
|
+
- 🛰️ **ReconAgent**: Passive & active reconnaissance, port discovery telemetry, and attack surface enumeration.
|
|
76
|
+
- 🔬 **AuditAgent**: Static code auditing (SAST), CVE advisory correlation, and OWASP vulnerability identification.
|
|
77
|
+
- ⚡ **ExploitAgent**: Controlled proof-of-concept (PoC) validation within strict authorized bounds.
|
|
78
|
+
- 📋 **ReportAgent**: Executive SecOps summary, CVSS scoring, and remediation action plans.
|
|
79
|
+
|
|
80
|
+
Agents communicate asynchronously using the cryptographically verified **Agent-to-Agent (A2A) Protocol Bus**.
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## 🛠️ LangChain Autonomous Tool-Calling Harness
|
|
85
|
+
|
|
86
|
+
ScopeForge provides real autonomous tool execution through LangChain:
|
|
87
|
+
- **Autonomous Tool Binding**: Models (`OpenRouter`, `Groq`, `DeepSeek`, `Claude`, `OpenAI`) are automatically bound to the complete toolsuite and active MCP tools via `chat_model.bind_tools()`.
|
|
88
|
+
- **Iterative Tool Execution**: The harness detects `tool_calls`, executes tools safely via the ScopeGate middleware pipeline, feeds `ToolMessage` outputs back into context, and synthesizes answers iteratively.
|
|
89
|
+
- **Built-in Tools**:
|
|
90
|
+
- `bash_cli`: Sandboxed shell execution with dangerous-pattern blocking.
|
|
91
|
+
- `google_web_search`: Live web search for fast technical lookups.
|
|
92
|
+
- `view_file` / `write_file` / `edit_file`: Surgical code workspace inspection and editing.
|
|
93
|
+
- `glob_files` / `grep_search`: Fast repository pattern discovery.
|
|
94
|
+
- `git_status_tool` / `git_diff_tool` / `git_commit_tool`: Git version control operations.
|
|
95
|
+
- `recon_port_scan` / `web_surface_probe`: Perimeter discovery tools.
|
|
96
|
+
- `sast_code_audit` / `cve_advisory_search`: Vulnerability triage tools.
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## 🌐 Model Support & Custom API Configuration
|
|
101
|
+
|
|
102
|
+
ScopeForge supports any OpenAI-compatible, Anthropic, or Ollama provider:
|
|
103
|
+
|
|
104
|
+
### Quick Presets (Zero Setup):
|
|
105
|
+
- `openrouter-free`: Meta-router for high-availability free frontier models (`openrouter/free`).
|
|
106
|
+
- `openrouter-free-nemotron`: NVIDIA Nemotron 550B Free.
|
|
107
|
+
- `groq-llama3`: Llama 3.3 70B on Groq Ultra-Fast inference.
|
|
108
|
+
- `ollama-llama3`: Offline local models via Ollama.
|
|
109
|
+
|
|
110
|
+
### Custom Endpoints & Third-Party Proxies:
|
|
111
|
+
Open the Model Switcher (<kbd>Ctrl+M</kbd>) or use slash commands:
|
|
112
|
+
|
|
113
|
+
```text
|
|
114
|
+
/model
|
|
115
|
+
/config set key <API_KEY>
|
|
116
|
+
/config set model <MODEL_ID>
|
|
117
|
+
/config set base <CUSTOM_URL>
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
ScopeForge features native paste de-duplication and custom endpoint normalization (no forced path appending).
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## 🔌 Model Context Protocol (MCP) & Skills
|
|
125
|
+
|
|
126
|
+
### MCP Integration:
|
|
127
|
+
```text
|
|
128
|
+
/mcp # List all configured MCP servers
|
|
129
|
+
/mcp tools # View all registered MCP tools
|
|
130
|
+
/mcp add <name> <command> # Add and enable an MCP server
|
|
131
|
+
/mcp enable <name> # Enable a server
|
|
132
|
+
/mcp disable <name> # Disable a server
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Extensible Skills (`SKILL.md`):
|
|
136
|
+
Install custom skills from any Git repository:
|
|
137
|
+
```text
|
|
138
|
+
/skill install https://github.com/example/sec-skills
|
|
139
|
+
/skill list
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## 🛡️ ScopeGate Rules of Engagement (RoE)
|
|
145
|
+
|
|
146
|
+
ScopeForge operates under 3 strict enforcement modes:
|
|
147
|
+
1. **PLAN (`plan`)**: Zero network egress. Generates falsifiable hypotheses, models attack surface, and plans audits.
|
|
148
|
+
2. **ARTIFACTS (`artifacts`)**: Inspects locally supplied source code, HAR files, and logs without external traffic.
|
|
149
|
+
3. **LIVE (`live`)**: Network tools enabled strictly against authorized scope domains and IPs.
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## 📜 License
|
|
154
|
+
|
|
155
|
+
Licensed under the **Apache License, Version 2.0**.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "scopeforge"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "ScopeForge — Commercial-Grade Cybersecurity Multi-Agent Harness & Interactive TUI"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.12"
|
|
7
|
+
license = { text = "Apache-2.0" }
|
|
8
|
+
authors = [
|
|
9
|
+
{ name = "Boopathi Raj", email = "boopathi@neuronestai.in" },
|
|
10
|
+
]
|
|
11
|
+
keywords = [
|
|
12
|
+
"cybersecurity",
|
|
13
|
+
"agent-harness",
|
|
14
|
+
"claude-code",
|
|
15
|
+
"tui",
|
|
16
|
+
"textual",
|
|
17
|
+
"langchain",
|
|
18
|
+
"langgraph",
|
|
19
|
+
"mcp",
|
|
20
|
+
"security-automation",
|
|
21
|
+
]
|
|
22
|
+
classifiers = [
|
|
23
|
+
"Development Status :: 4 - Beta",
|
|
24
|
+
"Environment :: Console",
|
|
25
|
+
"Intended Audience :: Developers",
|
|
26
|
+
"Intended Audience :: Information Technology",
|
|
27
|
+
"License :: OSI Approved :: Apache Software License",
|
|
28
|
+
"Operating System :: OS Independent",
|
|
29
|
+
"Programming Language :: Python :: 3",
|
|
30
|
+
"Programming Language :: Python :: 3.12",
|
|
31
|
+
"Topic :: Security",
|
|
32
|
+
"Topic :: Terminals",
|
|
33
|
+
]
|
|
34
|
+
dependencies = [
|
|
35
|
+
"pydantic>=2.7",
|
|
36
|
+
"anyio>=4.4",
|
|
37
|
+
"httpx>=0.27",
|
|
38
|
+
"textual>=8.0.0",
|
|
39
|
+
"langchain>=1.0.0",
|
|
40
|
+
"langgraph>=1.0.0",
|
|
41
|
+
"llama-index-core>=0.14.0",
|
|
42
|
+
"pyyaml>=6.0",
|
|
43
|
+
]
|
|
44
|
+
|
|
45
|
+
[project.optional-dependencies]
|
|
46
|
+
dev = ["pytest>=8", "pytest-asyncio>=0.23", "respx>=0.22", "hypothesis>=6"]
|
|
47
|
+
|
|
48
|
+
[project.scripts]
|
|
49
|
+
scopeforge = "scopeforge_engine.tui.app:main"
|
|
50
|
+
sourceforge = "scopeforge_engine.tui.app:main"
|
|
51
|
+
sf = "scopeforge_engine.tui.app:main"
|
|
52
|
+
agi = "scopeforge_engine.tui.app:main"
|
|
53
|
+
scopeforge-tui = "scopeforge_engine.tui.app:main"
|
|
54
|
+
scopeforge-engine = "scopeforge_engine.server:main"
|
|
55
|
+
|
|
56
|
+
[build-system]
|
|
57
|
+
requires = ["hatchling"]
|
|
58
|
+
build-backend = "hatchling.build"
|
|
59
|
+
|
|
60
|
+
[tool.hatch.build.targets.wheel]
|
|
61
|
+
packages = ["src/scopeforge_engine"]
|
|
62
|
+
|
|
63
|
+
[tool.pytest.ini_options]
|
|
64
|
+
asyncio_mode = "auto"
|
|
65
|
+
testpaths = ["tests"]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""ScopeForge engine package (Phase 1 spine)."""
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"""Agent-to-Agent (A2A) Message Bus."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
import json
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
from typing import Callable, Dict, List, Optional
|
|
7
|
+
|
|
8
|
+
from .protocol import A2AMessage, A2AIntent
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class A2ABus:
|
|
12
|
+
"""Central bus for inter-agent communication, telemetry, and collaboration."""
|
|
13
|
+
|
|
14
|
+
def __init__(self, log_path: Optional[Path] = None):
|
|
15
|
+
self.log_path = log_path or Path(".scopeforge/a2a_log.jsonl")
|
|
16
|
+
self.log_path.parent.mkdir(parents=True, exist_ok=True)
|
|
17
|
+
self.messages: List[A2AMessage] = []
|
|
18
|
+
self.subscribers: List[Callable[[A2AMessage], None]] = []
|
|
19
|
+
|
|
20
|
+
def subscribe(self, callback: Callable[[A2AMessage], None]):
|
|
21
|
+
"""Subscribe to incoming A2A messages."""
|
|
22
|
+
self.subscribers.append(callback)
|
|
23
|
+
|
|
24
|
+
def publish(self, message: A2AMessage) -> A2AMessage:
|
|
25
|
+
"""Sign and broadcast a message to subscribers and audit log."""
|
|
26
|
+
if not message.signature:
|
|
27
|
+
message.sign()
|
|
28
|
+
|
|
29
|
+
self.messages.append(message)
|
|
30
|
+
|
|
31
|
+
# Append to disk log
|
|
32
|
+
try:
|
|
33
|
+
with open(self.log_path, "a", encoding="utf-8") as f:
|
|
34
|
+
f.write(message.model_dump_json() + "\n")
|
|
35
|
+
except Exception:
|
|
36
|
+
pass
|
|
37
|
+
|
|
38
|
+
# Notify subscribers
|
|
39
|
+
for sub in self.subscribers:
|
|
40
|
+
try:
|
|
41
|
+
sub(message)
|
|
42
|
+
except Exception:
|
|
43
|
+
pass
|
|
44
|
+
|
|
45
|
+
return message
|
|
46
|
+
|
|
47
|
+
def send(
|
|
48
|
+
self,
|
|
49
|
+
sender: str,
|
|
50
|
+
recipient: str,
|
|
51
|
+
intent: A2AIntent,
|
|
52
|
+
payload: Dict,
|
|
53
|
+
) -> A2AMessage:
|
|
54
|
+
"""Convenience method to construct and publish an A2A message."""
|
|
55
|
+
msg = A2AMessage(
|
|
56
|
+
sender=sender,
|
|
57
|
+
recipient=recipient,
|
|
58
|
+
intent=intent,
|
|
59
|
+
payload=payload,
|
|
60
|
+
)
|
|
61
|
+
return self.publish(msg)
|
|
62
|
+
|
|
63
|
+
def get_history(self, limit: int = 50) -> List[A2AMessage]:
|
|
64
|
+
"""Get recent A2A messages."""
|
|
65
|
+
return self.messages[-limit:]
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"""A2A (Agent-to-Agent) Protocol: Standardized inter-agent messaging and delegation format."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
import datetime
|
|
5
|
+
import hashlib
|
|
6
|
+
import json
|
|
7
|
+
import uuid
|
|
8
|
+
from enum import Enum
|
|
9
|
+
from typing import Any, Dict, Optional
|
|
10
|
+
from pydantic import BaseModel, Field
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class A2AIntent(str, Enum):
|
|
14
|
+
TASK_DELEGATION = "TASK_DELEGATION"
|
|
15
|
+
TASK_RESULT = "TASK_RESULT"
|
|
16
|
+
EVIDENCE_SHARING = "EVIDENCE_SHARING"
|
|
17
|
+
CONSENSUS_REQUEST = "CONSENSUS_REQUEST"
|
|
18
|
+
CONSENSUS_RESPONSE = "CONSENSUS_RESPONSE"
|
|
19
|
+
HANDOVER = "HANDOVER"
|
|
20
|
+
ALERT = "ALERT"
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class A2AMessage(BaseModel):
|
|
24
|
+
"""Standardized A2A Protocol Envelope."""
|
|
25
|
+
message_id: str = Field(default_factory=lambda: f"a2a_{uuid.uuid4().hex[:10]}")
|
|
26
|
+
timestamp: str = Field(default_factory=lambda: datetime.datetime.now(datetime.timezone.utc).isoformat())
|
|
27
|
+
protocol_version: str = "1.0.0"
|
|
28
|
+
sender: str
|
|
29
|
+
recipient: str
|
|
30
|
+
intent: A2AIntent
|
|
31
|
+
payload: Dict[str, Any]
|
|
32
|
+
signature: str = ""
|
|
33
|
+
|
|
34
|
+
def sign(self) -> str:
|
|
35
|
+
"""Compute cryptographic hash of the message payload for integrity."""
|
|
36
|
+
raw = f"{self.sender}:{self.recipient}:{self.intent}:{json.dumps(self.payload, sort_keys=True)}"
|
|
37
|
+
self.signature = hashlib.sha256(raw.encode("utf-8")).hexdigest()
|
|
38
|
+
return self.signature
|
|
39
|
+
|
|
40
|
+
def verify(self) -> bool:
|
|
41
|
+
"""Verify the integrity hash of the message."""
|
|
42
|
+
raw = f"{self.sender}:{self.recipient}:{self.intent}:{json.dumps(self.payload, sort_keys=True)}"
|
|
43
|
+
expected = hashlib.sha256(raw.encode("utf-8")).hexdigest()
|
|
44
|
+
return self.signature == expected
|