Documentation

Quick Start & API Reference

Quick Start

One-Command Setup

$ git clone https://github.com/kaushikdharamshi/AgnosticSecurity.git
$ cd SecureMind
$ pip install -e .
$ sm-init
Detected: Claude Code, VS Code, Cursor
Configured protections for all tools

Start the Gateway

$ source .venv/bin/activate
$ uvicorn main:app --port 8000
Dashboard: http://localhost:8000/unified
API docs: http://localhost:8000/docs

API Reference

Smart Routing

MethodEndpointDescription
GET/routing/modelsList all 14 models with capabilities, costs, speed, coding/reasoning scores
GET/routing/statsPer-provider request counts, latency (avg/p95), cost, failure rates
GET/routing/configCurrent routing strategy (auto/cheapest/fastest/best_quality/local_only)
POST/routing/config?strategy=XChange routing strategy
GET/routing/explain?prompt=XDry run — shows which model would be selected and why

Privacy Mode

MethodEndpointDescription
GET/privacyGet current privacy mode, cloud_llm_blocked, allowed_providers
POST/privacy?mode=XSet mode: full_privacy, balanced, permissive. Returns 400 on invalid.

Shadow AI

MethodEndpointDescription
GET/shadow-aiScan for AI tools — returns detected tools, approved vs unauthorized

Knowledge Graph

MethodEndpointDescription
GET/graph/statsNode/edge/event counts, nodes by type

Block Rules

MethodEndpointDescription
GET/block-rulesList all block rules
POST/block-rulesAdd a new block rule (keyword or regex)
DELETE/block-rules/{id}Remove a block rule

Taxonomy Configuration

MethodEndpointDescription
GET/config/taxonomyGet active breach taxonomy
GET/config/taxonomy/templateGet default template for customization
PUT/config/taxonomyUpdate taxonomy (severity levels, breach types, detection hints)

Gateway Core

MethodEndpointDescription
POST/v1/chat/completionsSecure chat completions proxy (OpenAI-compatible). Use model: "auto" for smart routing.
GET/healthLiveness probe
GET/v1/auditQuery audit log entries

500+ Tests

# v1.8.0 modules (243 tests)
$ python3 scripts/test_privacy_mode.py # 28 PASS
$ python3 scripts/test_knowledge_graph.py # 33 PASS
$ python3 scripts/test_vuln_scanner.py # 45 PASS
$ python3 scripts/test_code_fingerprint.py # 28 PASS
$ python3 scripts/test_shadow_ai.py # 60 PASS
$ python3 scripts/test_security_memory.py # 49 PASS

# Smart routing (53 tests)
$ python3 scripts/test_smart_router.py # 53 PASS

# Core + red team (216 tests)
$ python3 scripts/smoke_test.py # 31 PASS
$ python3 scripts/test_red_team.py # 46 PASS (adversarial)
$ ... and 8 more test suites

Service Ports

ServicePortStart Command
API Gateway + Dashboard8000uvicorn main:app --port 8000
LLM Proxy18790python3 llm/llm_proxy.py --port 18790
Breach Engine8081uvicorn breach_intel.main:app --port 8081