AfterHours handles:
- Wallet connections (read-only balance reading)
- Trade proposals (AI-generated, user-approved)
- On-chain execution (Solana transactions)
- Portfolio data (user-specific)
- AI Analyst prompt injection (the LLM could produce malicious recommendations)
- Risk Governor bypass (AI overrides policy)
- Front-run detection (gap trading is profitable for insiders)
- Transaction replay
- Wallet signature phishing
- Solana consensus attacks
- RPC provider compromise
- Smart contract bugs in tokenized stock contracts (we don't deploy any)
The AI can propose. The Governor enforces. The AI cannot override:
- Max single asset exposure
- Max trade size
- Min USDC reserve
- Max daily drawdown
These are hardcoded in the backend, not in the frontend or the AI prompt.
REQUIRE_USER_APPROVAL = true is the default and cannot be disabled.
The system never executes without a user signature. The AI recommendation is always advisory.
Environment variables are loaded from .env (gitignored).
Trades are simulated before sending to the blockchain. The user always sees:
- The exact asset
- The exact amount
- The expected output
- The price impact
- Do NOT access production wallets or private keys
- Do NOT modify risk policy limits without review
- Do NOT deploy to mainnet without audit
- Do NOT store API keys in code
- Do NOT send real funds in the hackathon demo
Security issues should be documented in AUDIT.md (if the project grows to that
complexity) and raised with the team before the submission deadline.