Guides / Cookbooks
Cookbooks · Risk and execution · Beginner · about 6 min
Confidence-gated actions
Let the system act on its own only when an answer is clearly away from 0.5, and route everything in between to a person.
When to use it
Automation is cheap when the answer is clear and expensive when it is not. A band around 0.5 (here 0.38 to 0.62) marks "not clear". Above it one action fires, below it another, and
elsecatches the middle and asks a human.The request
{ "model": "ora-fin1", "state": { "symbol": "NVDA" }, "questions": { "up_week": { "type": "yes_no", "instructions": "Will the stock be higher in a week?" }, "drop5": { "type": "yes_no", "instructions": "Will it drop at least 5% at some point in the next month?" } }, "actions": [ { "id": "auto_long", "when": "up_week >= 0.62", "do": "webhook", "connection": "my-oms", "body": { "symbol": "{{symbol}}", "route": "auto", "side": "consider_long", "p_up_week": "{{up_week}}", "as_of": "{{as_of}}" } }, { "id": "auto_avoid", "when": "up_week <= 0.38", "do": "webhook", "connection": "my-oms", "body": { "symbol": "{{symbol}}", "route": "auto", "side": "avoid", "p_up_week": "{{up_week}}", "as_of": "{{as_of}}" } }, { "id": "to_human", "when": "else", "do": "slack", "connection": "trading-desk", "message": "Review {{symbol}} ({{as_of}}): up_week {{up_week|pct}} is inside the 38-62% band, drawdown odds {{drop5|pct}}. No automatic action." } ], "dry_run": true }Open this in the PlaygroundThe real response
{ "model": "ora-fin1", "answers": { "up_week": { "type": "yes_no", "yes_no": 0.527 }, "drop5": { "type": "yes_no", "yes_no": 0.523 } }, "usage": { "input_tokens": 327, "output_tokens": 8 }, "context": { "source": "server", "symbol": "NVDA", "as_of": "2026-10-30" }, "version": "ora-fin-0.1.1", "actions": [ { "id": "auto_long", "fired": false, "status": "skipped" }, { "id": "auto_avoid", "fired": false, "status": "skipped" }, { "id": "to_human", "fired": true, "status": "dry_run", "do": "slack", "connection": "trading-desk", "preview": { "text": "Review NVDA (2026-10-30): up_week 53% is inside the 38-62% band, drawdown odds 52%. No automatic action." } } ] }up_weekis 0.527, inside the band, so both automatic actions were skipped andto_humanfired with the review message shown in the preview.The code
Requires curl 7.76+. Save as run.sh, then: bash run.shcurl -sS https://oramodel.com/v1/systemone \ -H "Authorization: Bearer $JEV_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "ora-fin1", "state": { "symbol": "NVDA" }, "questions": { "up_week": { "type": "yes_no", "instructions": "Will the stock be higher in a week?" }, "drop5": { "type": "yes_no", "instructions": "Will it drop at least 5% at some point in the next month?" } }, "actions": [ { "id": "auto_long", "when": "up_week >= 0.62", "do": "webhook", "connection": "my-oms", "body": { "symbol": "{{symbol}}", "route": "auto", "side": "consider_long", "p_up_week": "{{up_week}}", "as_of": "{{as_of}}" } }, { "id": "auto_avoid", "when": "up_week <= 0.38", "do": "webhook", "connection": "my-oms", "body": { "symbol": "{{symbol}}", "route": "auto", "side": "avoid", "p_up_week": "{{up_week}}", "as_of": "{{as_of}}" } }, { "id": "to_human", "when": "else", "do": "slack", "connection": "trading-desk", "message": "Review {{symbol}} ({{as_of}}): up_week {{up_week|pct}} is inside the 38-62% band, drawdown odds {{drop5|pct}}. No automatic action." } ], "dry_run": true }'The same gate in your own code, if you keep the routing on your side:
def route(p, lo=0.38, hi=0.62): if p >= hi: return "auto_long" if p <= lo: return "auto_avoid" return "human_review" route(data["answers"]["up_week"]["yes_no"])Act on it
Pick the band from your own history: run the questions on past sessions, see how often each side of the band was right, and widen it until the automatic side is right often enough for you. Log every routed decision with the probability and
version, so the band can be tuned later.Variations
- Asymmetric bands, e.g. act on longs only above 0.65 but on risk cuts above 0.55.
- Gate on two answers:
up_week >= 0.62 and drop5 < 0.4. - For choice and score answers use
confidenceinstead of distance from 0.5 (Route support tickets).
Information, not investment advice. Every number on this page is a real response for the session shown; answers change with each session.