Hacker

Joshua

@joshua

Joined Aug 2026Student at University Of MadrasIndia

Projects

  • Sentinel

    Flagsmith Experimentation HackathonNov 2026

    I built Sentinel, an AI-assisted portfolio advisor protected by Tripwire, a deterministic pre-trade security firewall with live remote governance powered by Flagsmith. The Problem: Giving an LLM direct authority over financial decisions—and relying on static config files to govern it—introduces major operational and security risks: Hallucinated Math & Orders: Language models can fabricate risk numbers, miscalculate position sizes, or ignore transaction costs. Prompt Injection via Market Data: Malicious instructions hidden inside external news articles or web feeds can hijack an AI agent into executing unauthorized or harmful trades. Quote Drift & Race Conditions (TOCTOU): Market prices and bid-ask spreads can spike between the moment an AI recommends a trade and the moment a user approves it. Slow Incident Response: If market volatility spikes or an anomaly occurs, redeploying code or editing static policy files on disk is too slow to halt execution or tighten risk limits in real time. The Solution: Sentinel enforces a strict architectural boundary: Python calculates, AI explains, and Tripwire protects. All portfolio risk metrics and rebalancing plans are computed deterministically in code, external news is sanitized and isolated before the LLM ever sees it, and every approved paper trade must pass deterministic policy gates, a cryptographic quote-lock, and live Flagsmith runtime flags and kill switches before execution. Who would use it, and how does it work? Target Users: Retail & Active Self-Directed Investors: Traders managing mixed equity and crypto portfolios who want AI-synthesized market context and rebalancing guidance without surrendering execution control. Fintech & Wealth-Tech Engineering Teams: Developers building AI-powered financial copilots who need a verifiable, policy-driven safety layer, remote kill switches, and an audit trail around LLM outputs. Risk, Compliance & Security Reviewers: Teams evaluating how to safely deploy and govern agentic AI in regulated or high-stakes financial workflows. How It Works (Advise → Verify → Execute → Explain): 1.Deterministic Risk & Planning (Advise): Sentinel pulls portfolio holdings and market quotes from True Markets (or offline replay fixtures), calculates tail risk (95% VaR, Historical and Cornish-Fisher CVaR, pairwise correlations, and stress-test drawdowns), and generates exact, transaction-cost-aware candidate plans (HOLD, TRIM, DERISK, REBALANCE) in Python. 2.Quarantined AI Reasoning (Explain): Live news from Tavily is normalized (Unicode NFKC), stripped of prompt-injection patterns, and wrapped in <untrusted_evidence> XML tags. OpenAI Structured Outputs selects only from the precomputed plan IDs, cites verified evidence, and undergoes automated numeric cross-checking against the Python calculations. 3.Human Approval & TOCTOU Lock (Verify): Nothing runs autonomously. The user reviews the metrics, risk alerts, and evidence in the Streamlit dashboard and approves a plan, which is bound to a SHA-256 snapshot of current prices and spreads with a 30-second expiration timer. 4.Tripwire Firewall, Flagsmith Control Plane & Signed Audit (Execute): Before paper orders reach the True Markets adapter, Tripwire pulls live runtime flags and remote config overrides from Flagsmith (falling back safely to policy_advisor.yaml if offline) to enforce instant remote kill switches, dynamic spread and position caps, symbol allowlists, and quote-freshness checks—logging every verdict and active flag state into an append-only, HMAC-SHA256 hash-chained SQLite audit ledger.