@@ -16,7 +16,10 @@ SecNode API helps security engineers and backend teams run repeatable API risk a
1616- Executes tests concurrently with optional proxy routing
1717- Supports autonomous agent mode with request budgets and iterative replanning
1818- Supports direct microservices mode with controller/planner/worker boundaries
19- - Produces both human-readable and machine-readable findings
19+ - Bug bounty mode with strict scope enforcement for authorized testing
20+ - TUI (` secnodeapi-tui ` ) for interactive scans and skill execution
21+ - MCP server for Cursor and IDE integration
22+ - Produces both human-readable and machine-readable findings (Markdown, SARIF, JUnit)
2023
2124## What It Is and Is Not
2225
@@ -93,6 +96,16 @@ export SECNODE_LLM="nebius/meta-llama/Meta-Llama-3.1-70B-Instruct"
9396export NEBIUS_API_KEY=" your-nebius-key"
9497```
9598
99+ Or with Nebius Token Factory (OpenAI-compatible):
100+
101+ ``` bash
102+ export SECNODE_LLM=" openai/meta-llama/Meta-Llama-3.1-8B-Instruct"
103+ export OPENAI_API_BASE=" https://api.tokenfactory.nebius.com/v1"
104+ export NEBIUS_API_KEY=" your-nebius-token"
105+ ```
106+
107+ Run ` secnodeapi --list-models ` to see available model IDs for your endpoint.
108+
96109Provider credentials are model-specific. ` openai/* ` requires ` OPENAI_API_KEY ` , ` anthropic/* `
97110requires ` ANTHROPIC_API_KEY ` , ` nebius/* ` requires ` NEBIUS_API_KEY ` , and ` ollama/* ` can run locally without cloud API keys.
98111See [ LiteLLM providers] ( https://docs.litellm.ai/docs/providers ) .
@@ -116,20 +129,27 @@ Reports are written to `results/<target_or_local_schema>_<timestamp>/`.
116129## CLI Usage
117130
118131``` bash
132+ secnodeapi --list-models
119133secnodeapi --target ./openapi.yaml --schema-only
120134secnodeapi --target https://api.example.com/swagger.json --dry-run --dry-run-output ./results/tests.json
121135secnodeapi --target https://api.example.com/swagger.json --auth-header " Authorization: Bearer <token>"
122136secnodeapi --target https://api.example.com/swagger.json --proxy http://127.0.0.1:8080 --insecure
123137secnodeapi --target https://api.example.com/swagger.json --mode agent --request-budget 500 --max-iterations 6
124138secnodeapi --target https://api.example.com/swagger.json --mode agent --instruction " username=admin, role=superuser" --instruction " username=user"
125139secnodeapi --target https://api.example.com/swagger.json --mode microservices
140+ secnodeapi --target https://api.example.com --mode bugbounty --program " Acme BBP" --scope host:api.example.com --scope path:/api --bb-instruction " Only test assigned API assets"
141+ ```
142+
143+ ``` bash
144+ secnodeapi-tui --target https://api.example.com --backend local
145+ secnodeapi-tui --target https://api.example.com --backend remote --api-base-url http://127.0.0.1:8000
126146```
127147
128148### Key options
129149
130- - ` --target ` URL or local path to OpenAPI schema (required)
131- - ` --mode ` ` agent ` (default) or ` legacy ` execution pipeline
132- - ` --mode ` ` agent ` , ` legacy ` , or ` microservices `
150+ - ` --target ` URL or local path to OpenAPI schema (required unless ` --list-models ` )
151+ - ` --list-models ` list available models from OPENAI_API_BASE (for custom endpoints like Nebius)
152+ - ` --mode ` ` agent ` , ` legacy ` , ` microservices ` , ` greybox ` , or ` bugbounty `
133153- ` --concurrency ` concurrent request workers
134154- ` --auth-header ` single inline auth header
135155- ` --auth-file ` JSON file of auth headers
@@ -143,14 +163,38 @@ secnodeapi --target https://api.example.com/swagger.json --mode microservices
143163- ` --max-iterations ` max plan/execute loops in agent mode
144164- ` --proxy ` route traffic via proxy
145165- ` --insecure ` disable TLS verification for controlled environments
166+ - ` --scope ` bug bounty scope entries (` host: ` , ` path: ` , ` method: ` , ` deny-host: ` , ` deny-path: ` )
167+ - ` --scope-file ` JSON scope config for bug bounty mode
168+ - ` --bb-instruction ` repeatable bug bounty instruction passed to planning and enforcement
169+ - ` --program ` bug bounty program identifier for session metadata
170+
171+ TUI command highlights:
172+
173+ - ` /scan <target> ` create and run a scan session
174+ - ` /skill <name> ` run a selected skill
175+ - ` /sessions ` list saved snapshots from ` ~/.api-agent/sessions `
176+ - ` /load <session-id> ` load a saved snapshot into TUI panels
177+ - ` /targets ` list active in-memory targets from multi-session dashboard
178+ - ` /switch <session-id> ` switch active session in the dashboard
179+ - ` /export <markdown|sarif> [path] ` export findings from current session
180+
181+ ### Bug bounty strict scope mode
182+
183+ ` --mode bugbounty ` enables strict scope enforcement. When this mode is active, out-of-scope invocations are blocked at both planning and runtime.
184+
185+ - Scope is required via ` --scope ` or ` --scope-file `
186+ - Rules are persisted with the session policy
187+ - Any invocation outside allowed host/path/method constraints is rejected before tool execution
146188
147189## Output
148190
149- Each run generates an output directory containing:
191+ Each run generates an output directory under ` results/ ` containing:
150192
151193- ` report.md ` with executive summary, severity overview, and evidence sections
152194- ` findings.json ` for machine processing and pipeline integration
153195
196+ Export formats include Markdown, SARIF, and JUnit for CI integration.
197+
154198## Development
155199
156200``` bash
@@ -171,24 +215,37 @@ make test-cov-uv
171215make build-uv
172216```
173217
218+ On Windows, if ` make ` is unavailable, use ` uv run ` directly:
219+
220+ ``` powershell
221+ uv sync --extra dev
222+ uv run ruff check src tests
223+ uv run pytest
224+ uv run pytest --cov=src/secnodeapi --cov-report=term-missing
225+ uv build
226+ ```
227+
174228## CI
175229
176230GitHub Actions workflow runs:
177231
178- - lint checks
179- - test suite with coverage thresholds
232+ - lint checks (ruff)
233+ - test suite with coverage thresholds (pytest)
180234- package build
235+ - dependency vulnerability audit (pip-audit)
236+ - container vulnerability scan (Trivy)
181237- scan job template for staging targets
182238
183239## Direct Microservices Runtime
184240
185- This repository now includes a direct microservices runtime foundation:
241+ This repository includes a direct microservices runtime foundation:
186242
187243- Controller service
188244- Planner service
189245- Skill engine service with ranked skill dispatch
190246- Specialized workers (recon, discovery, fuzzing, exploit)
191247- Tool adapters (` ffuf ` , ` nuclei ` , ` sqlmap ` , ` zap ` , ` kiterunner ` )
248+ - Python skills: BOLA, JWT tamper, XSS, SSRF, GraphQL injection/auth bypass, NoSQL injection, command injection, rate limit bypass, workflow exploit
192249- Memory subsystem (session, history, skill metrics)
193250- Attack graph engine
194251- FastAPI control plane
@@ -199,6 +256,68 @@ Run local stack:
199256docker compose -f deploy/docker-compose.yml up --build
200257```
201258
259+ ## Semantic Memory (Optional)
260+
261+ Long-term cross-session memory improves skill ranking and planning over time. Enable with Postgres + pgvector:
262+
263+ ``` bash
264+ uv sync --extra memory
265+ export SECNODE_SEMANTIC_MEMORY_ENABLED=true
266+ export SECNODE_POSTGRES_DSN=postgresql://secnode:secnode@localhost:5432/secnode
267+ ```
268+
269+ The deploy stack uses ` pgvector/pgvector:pg16-trixie ` for Postgres. When enabled, the agent ingests target profiles, exploit attempts, endpoint patterns, and skill performance into vector storage. Retrieval augments planner context and skill ranking with historical success rates.
270+
271+ ## MCP (Model Context Protocol)
272+
273+ SecNode API exposes an MCP server so AI assistants (Cursor, Claude Desktop, etc.) can run scans and query findings via tools.
274+
275+ ### Install MCP support
276+
277+ ``` bash
278+ uv sync --extra mcp
279+ ```
280+
281+ ### Run the MCP server
282+
283+ Stdio (default, for Cursor/IDE integration):
284+
285+ ``` bash
286+ secnodeapi-mcp
287+ ```
288+
289+ HTTP (for MCP Inspector or remote clients):
290+
291+ ``` bash
292+ secnodeapi-mcp --transport streamable-http --port 8010
293+ ```
294+
295+ ### Tools
296+
297+ - ` run_scan(target) ` run a full API pentest against the target URL
298+ - ` run_skill(target, skill_name) ` run a specific skill (e.g. api_path_fuzz, bola_test, jwt_tamper, xss_scan)
299+ - ` list_skills() ` list available pentesting skills
300+ - ` export_report(session_id, format, output_path) ` export findings to Markdown or SARIF
301+
302+ ### Resources
303+
304+ - ` secnode://session/{session_id} ` fetch session details, findings, and attack paths
305+
306+ ### Cursor configuration
307+
308+ Add to ` .cursor/mcp.json ` or Cursor MCP settings:
309+
310+ ``` json
311+ {
312+ "mcpServers" : {
313+ "secnodeapi" : {
314+ "command" : " secnodeapi-mcp" ,
315+ "args" : []
316+ }
317+ }
318+ }
319+ ```
320+
202321## Security and Responsible Use
203322
204323Only test systems you own or are explicitly authorized to assess.
0 commit comments