All resources

LLM Strategy

Prompt Engineering Playbook 2025

Published 2025-11-2610 min read

Trust layer + semantic stop rules ensure the Brain follows risk guardrails while staying context-aware.

1. Role separation

Define explicit responsibilities (Analyst = quant report, Boss = directive, Executor = PnL + execution guard) and keep prompts < 4k tokens.

2. Cooldowns & budgets

Use `max_trades_per_hour`, `cooldown_minutes`, and per-role model choices (flagship models for analysis, faster models for executor) to prevent runaway token spend.

3. Semantic stops

Embed instructions like “Reject execution if edge < cost” or “Skip trade if missing market data” to keep the LLM from improvising.

4. Versioning & rollout

Store prompts in `system_prompts.json`, log every update (session logs), and roll out via Brain Control Center with rollback.

5. Analyst template

Start with market regime, liquidity, catalysts, and risk radar. Include explicit hypotheses, target portion of balance, leverage bands, and a JSON summary that Boss/Executor can parse.

6. Boss template

Translate the Analyst’s metrics into directives such as BUY/SELL/HOLD, rationale, stop/target, execution urgency, and whether ErrorWatcher confirms no active incidents.

7. Executor template

Make the Executor prompt deterministic: remind it to check wallet balances, open orders, reduce-only rules, fee impact, and to call `execute_order` only when probability-adjusted payoff is positive.

8. Model routing

Assign flagship models to Analyst when deep reasoning is needed, route Boss to optimized models for concise directives, and pin Executor to a faster, cheaper model for execution. Budget field lives next to each model config.

9. Testing & rollback

Use `/bin/run-script.sh --script force_trade_test.py` in testnet before promoting prompts. Keep prior prompt versions in `session_log_seo_growth.md` and roll back immediately if ErrorWatcher spots anomalies.

FAQ

Institution-grade answers

How often should I refresh the prompts?

Treat them like code: sprint-based changes with review. We refresh Analyst/Boss monthly and Executor weekly, logging SHA references in session logs.

Can I mix different AI models in the same cycle?

Yes. The Router lets you assign per-role models plus cost ceilings. Analyst can run flagship models while Executor sticks to faster models to keep spend predictable.

How do we stop the LLM from over-trading?

Bake cooldown minutes, VaR constraints, and explicit 'DO NOT TRADE IF EDGE < COST' instructions into each prompt. ErrorWatcher enforces runtime guards.

Next steps

Want to see HyperAgent live or talk with a Solutions Architect?

Prompt Engineering Playbook 2025 | HyperAgent Knowledge Base | HyperAgent - Institutional Algo Execution