Hack4Hack

VERITAS

AI trader that knows when NOT to trade: no look-ahead, conformal abstain, LLM council, red-team veto, C++ gate, anti-injection, hash audit

Built at AgentX Hackathon 2026

Team Team veritas: Himanshu bendale., Viraj Rajput

Built with Python, LightGBM, Groq gpt-oss 20b/120b, C++17, OpenSSL, Firebase.

About the project

VERITAS: a safe AI trading agent that knows when NOT to trade

Most AI trading bots fail in three ways: they hallucinate prices, their prompts get hijacked, and they overtrade (every round trip costs 0.146%). In a 243-day test, a naive bot that traded daily lost ₹5,527.

VERITAS fixes this by design. Machine learning proposes, LLMs advise, and only a deterministic C++ risk gate can approve an order. Built for NIFTY 50 paper trading.

How it works:

DataClock: a look-ahead firewall. Today’s bars don’t exist at 08:30 IST, and any future date raises a LeakageError.

Conformal prediction: if the model is ambiguous ({UP, DOWN}), the bot abstains.

LLM council: Cue, News, Regime and Drift agents feed a Strategy agent that can only agree with the ML direction or wait.

Red-team veto: every proposal is attacked for contradictions and sizing errors. 5 of 6 vetoes were correct, saving ₹395.

C++ risk gate: six checks plus a kill switch. One failure means ABSTAIN, with a counterfactual explanation.

Prompt-injection defence: a sanitizer, a neutral fallback and a size-clipping gate mean a hijacked LLM has zero blast radius.

SHA-256 audit trail: an append-only hash chain. Change one byte and the verifier reports BROKEN.

Result: 57 trades instead of 243, costs down from ₹7,055 to ₹1,655, drawdown down from 0.642% to 0.253%, and every decision verified.

Explore hackathons