How hackerai-tech/hackerai works
HackerAI is an AI-powered penetration-testing assistant. A user opens the chat UI, selects a conversational or Agent mode, submits prompts and files, and receives streamed model reasoning, tool activity, and results. Agent runs are dispatched through API endpoints and a durable Trigger.dev runtime, using model providers and isolated sandboxes for terminal, web, file, and subagent work. Convex persists chats, messages, files, usage, and teams; WorkOS authenticates users, while Stripe supports subscriptions and usage billing. Sampled files show storage and sandbox coordination; some broader routes are represented from the repository tree and README.
Main entry points: chat-processor.ts Chat Processor · index.ts Agent Tools · schema.ts Convex Backend · useChatHandlers.ts Chat Handlers
Components 27
User Experience
- Chat Interface
app/(chat)/HomePageClient.tsx - Chat Handlers
app/hooks/useChatHandlers.ts - Streamed Results
app/components/DataStreamProvider.tsx
AI Orchestration
- Agent API
app/api/agent/route.ts - Long Agent API
app/api/agent-long/route.ts - Agent Stream Runner
lib/api/agent-stream-runner.ts - Chat Processor
lib/chat/chat-processor.ts - Model Providers
lib/ai/providers.ts - Durable Agent Runtime
app/api/agent/route.ts
Execution Tools
- Agent Tools
lib/ai/tools/index.ts - Hybrid Sandbox Manager
lib/ai/tools/utils/hybrid-sandbox-manager.ts - Terminal Tools
lib/ai/tools/run-terminal-cmd.ts - Web Tools
lib/ai/tools/web-search.ts - Subagent Runtime
lib/ai/subagents/agent-handle.ts
Product Data
- Convex Backend
convex/schema.ts - Chats Messages Projects
convex/chats.ts - File Storage Records
convex/fileStorage.ts
Identity Billing
- WorkOS Identity
- Billing Routes
app/api/subscribe/route.ts - Usage Accounting
convex/usageLogs.ts
Other components
- Security User
- Amazon S3
- Stripe
- E2B Sandbox
- MIOSA Sandbox
- Perplexity Search
- Redis Streams
Connections 32
- Security User → Chat Interface: uses
- Chat Interface → Chat Handlers: submits prompts
- Chat Handlers → Agent API: starts agent
- Chat Handlers → Long Agent API: starts long run
- Chat Handlers → Streamed Results: updates stream
- Agent API → Agent Stream Runner: dispatches run
- Long Agent API → Agent Stream Runner: dispatches run
- Agent Stream Runner → Durable Agent Runtime: runs durably
- Agent Stream Runner → Chat Processor: processes chat
- Chat Processor → Model Providers: requests completion
- Chat Processor → Agent Tools: dispatches tools
- Chat Processor → Chats Messages Projects: persists messages
- Chat Processor → Usage Accounting: records usage
- Agent Tools → Terminal Tools: dispatches terminal
- Agent Tools → Web Tools: dispatches web
- Agent Tools → Hybrid Sandbox Manager: controls workspace
- Agent Tools → Subagent Runtime: starts subagents
- Hybrid Sandbox Manager → E2B Sandbox: uses cloud sandbox
- Hybrid Sandbox Manager → MIOSA Sandbox: uses native sandbox
- Hybrid Sandbox Manager → Convex Backend: reads connections
- Chats Messages Projects → Convex Backend: stores domain data
- File Storage Records → Convex Backend: stores metadata
- File Storage Records → Amazon S3: stores file objects
- Chat Interface → File Storage Records: uploads files
- Model Providers → Perplexity Search: searches web
- Chat Processor → Redis Streams: resumes streams
- Agent API → WorkOS Identity: checks identity
- Billing Routes → WorkOS Identity: resolves user
- Billing Routes → Stripe: creates checkout
- Stripe → Billing Routes: sends webhooks
- Billing Routes → Convex Backend: updates billing state
- Usage Accounting → Convex Backend: persists charges