How b-3llum/tars works
TARS is an iOS cybersecurity command assistant backed by a FastAPI server. Operators send chat or voice-derived requests, receive a structured plan, and may confirm sensitive actions before execution; results return to chat with optional speech output. The README describes local/Claude routing, while the sampled decision engine routes only through Ollama, so no Claude dispatch edge is shown. The repository also documents kerb-map guidance, whitelisted scans, system and log queries, and configured-host SSH. Some router, security, configuration, and audit wiring is based on README descriptions where implementation excerpts were not provided.
Main entry points: router.py API Router · action_engine.py Action Engine · NetworkManager.swift Network Manager · ChatView.swift Chat UI
Components 21
iOS Client
- Chat UI
ios/Tars/Views/ChatView.swift - Chat ViewModel
ios/Tars/Views/ChatViewModel.swift - Request Models
ios/Tars/Models/TarsModels.swift - Network Manager
ios/Tars/Network/NetworkManager.swift
Control Server
- FastAPI App
server/main.py - API Router
server/router.py - API and Plan Models
server/models.py
Planning and Actions
- Decision Engine
server/decision_engine.py - Ollama Integration
server/llm_local.py - Claude Integration
server/llm_claude.py - Action Engine
server/action_engine.py
Operations and Safety
- Settings and Rules
server/config.py - Request Security
server/security.py - Audit Logging
server/logger.py - SSH Manager
server/ssh_manager.py
Other components
- Operator
- Local Commands
- Configured Hosts
config/hosts.yaml - Ollama Service
- Claude API
- Remote Host
Connections 27
- Operator → Chat UI: enters requests
- Chat UI → Chat ViewModel: sends input
- Chat ViewModel → Network Manager: submits requests
- Network Manager → Request Models: encodes and decodes
- Network Manager → FastAPI App: HTTP requests
- FastAPI App → API Router: dispatches API
- API Router → Request Security: checks access
- API Router → Decision Engine: requests plans
- Decision Engine → Ollama Integration: plans requests
- Ollama Integration → Ollama Service: calls generation API
- Ollama Integration → API and Plan Models: returns plan
- Decision Engine → API and Plan Models: returns plan
- API Router → Action Engine: executes plans
- API Router → Action Engine: stores or retrieves pending
- Action Engine → Settings and Rules: reads command rules
- Action Engine → Request Security: sanitizes and validates
- Action Engine → Local Commands: runs whitelisted commands
- Action Engine → SSH Manager: dispatches remote actions
- SSH Manager → Settings and Rules: reads host settings
- Settings and Rules → Configured Hosts: loads host definitions
- SSH Manager → Remote Host: executes over SSH
- Action Engine → Audit Logging: records action events
- API Router → Audit Logging: records request events
- API Router → API and Plan Models: builds API responses
- Network Manager → Chat ViewModel: returns responses
- Chat ViewModel → Chat UI: updates chat and speaks
- Chat UI → Operator: shows responses