← Retour à Signodex

Comment fonctionne l'IA

What is under the hood, what it will refuse to say, and what each AI action actually costs.

Model and provider

Every AI request is routed through a Supabase Edge Function to Anthropic's Claude Sonnet 4.5 model. We do not use OpenAI, Google or other providers for the analyst features. The model is called with stream: true, so tokens appear progressively on your screen as they are generated — there is no batched "wait then show" experience.

The system prompt is locked server-side

The system prompt for each action (signal, summary, deep analysis, chat) is stored on the server and is appended automatically on every request. Anything a client tries to inject as a system prompt is ignored. This prevents prompt-injection attacks where a third party could trick the AI into recommending a specific asset or skipping the compliance suffix.

The compliance suffix

Every AI request includes a non-removable instruction block that:
  • Bans the words buy, sell, guaranteed, will rise, will fall.
  • Forces hedge phrasing: pattern suggests, indicator shows, historically, data indicates.
  • Requires the legal disclaimer at the end of every response.
  • Instructs the model to be analytical, not prescriptive, and to respond in the user's language.

The accuracy ledger is seeded

We also run the same AI on a daily cron across 24 top assets without a user trigger, so the /track-record page has a sample to publish even while the userbase is small. These rows go through the same model and the same compliance suffix as user-issued signals, and they are scored by the same cron with the same thresholds. The cron list is defined in supabase/functions/seed-ai-signals/index.ts.

The four AI actions

AI Signal10 cr500 tokens
AI Market Summary25 cr1,500 tokens
AI Deep Analysis50 cr3,000 tokens
AI Chat message5 cr800 tokens

The 15-minute cache

We hash the asset symbol, the market-state inputs (price bucket, indicator readings) and the action into a deterministic cache key. The first user to ask is the one whose request actually hits Anthropic. Anyone who asks the same question within 15 minutes gets the cached response and pays zero credits.

When the AI fails, we refund

If Anthropic returns an error before producing any tokens, the deducted credits are refunded atomically and logged as a refund transaction. You can audit this in your account's credit history.

What the AI will refuse to say

The AI will not give you a price target, a buy/sell instruction, a probability of future returns, or a financial-planning recommendation. It will describe what the indicators are showing, name the patterns it sees, give support and resistance levels observable in the data, and provide context. It is an analyst, not an advisor.

What the AI does not see

The AI sees the prompt you (or the system) send it and any market data the server attaches. It does not see your portfolio holdings, your watchlists, your email or your identity — unless you explicitly include them in a chat message. Cache keys do not contain user IDs; AI responses are stored keyed only on a deterministic market-state hash.

What the server records about your usage

To bill credits accurately and to operate the public accuracy ledger we keep two per-user logs that the AI itself does not see: Privacy Policy covers them in full.
  • credit_transactions — every paid AI action by you (action type, asset symbol, timestamp, cached yes/no, balance before/after). Required for billing audit and refund logic.
  • ai_signal_outcomes — the asset, our parsed directional call and the server-fetched snapshot price at signal time. No user_id. Used by /track-record only.
These records survive the cache window but are user-deletable via the in-app account-deletion flow (GDPR Art 17). The model never sees them in any subsequent request.