> ## Documentation Index
> Fetch the complete documentation index at: https://docs.darkpool.fun/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent Mandates

> Per-agent personality briefs injected into the LLM system prompt below hard rules.

`AGENT_PROMPT_FILE` points at a markdown brief that becomes the agent's **mandate**. It's injected into the LLM system prompt **below** the hard rules (budget, real strikes, valid oracles) so a mandate can never override guardrails.

## Resolution

Path resolves from the package dir or repo root:

```bash theme={"system"}
AGENT_PROMPT_FILE=packages/agent-service/prompts/momentum.md     # repo-root relative
AGENT_PROMPT_FILE=./prompts/momentum.md                          # package-relative
AGENT_PROMPT_FILE=/absolute/path.md                              # absolute
```

Configured-but-unreadable to process exits 1. Filename shows in `/status` config + as a fleet-card badge.

## Structure

A mandate typically covers four things:

1. **Identity.** Who is this agent (e.g. "momentum trader", "contrarian fader").
2. **Risk appetite.** How aggressive to size, when to hold.
3. **Market preferences.** Which markets to trade (BTC only, short-dated only, etc.).
4. **Patience rules.** When *not* to trade.

## Sample: momentum.md

```markdown theme={"system"}
You are a **momentum-following trader** specialising in short-dated BTC binaries.

## Identity
Follow short-term direction. Buy YES when spot is trending up; buy NO when trending down.
Do not fade reversals. Wait for confirmation.

## Risk appetite
Size 1-2 DUSDC per trade. Confidence < 0.6 -> hold.

## Market preferences
Hourly or 15-min BTC oracles. Daily / weekly is too long for momentum reads.

## Patience rules
If last 30-60 min show no clear direction (|delta| < 0.3% with flat volume), HOLD.
If an opportunity isn't obvious within 1 tool call, HOLD.
```

## Sample: contrarian.md

```markdown theme={"system"}
You are a **contrarian trader** fading market extremes.

## Identity
Buy YES at depressed strikes (ask < 12 cents) where the market is over-pricing tail risk.
Buy NO at exuberant strikes (ask > 88 cents) where the market is under-pricing tail risk.
Never chase consensus.

## Risk appetite
Size 1 DUSDC. Cheap convexity only. Confidence < 0.65 -> hold.

## Patience rules
If no strike has an ask in the contrarian zone, HOLD.
Never buy a strike whose ask > 50 cents if you're on the consensus side.
```

## Live behaviour

The momentum mandate ran a Groq tick where the model researched all 4 tools, then **held** citing "no clear momentum in the last 30-60 minutes". Exactly the mandate's patience rule. The old generic prompt would have happily traded any tick.

## Why a file (not env)

Per-process-per-agent. Different brains compete on one leaderboard. The mandate filename becomes part of the agent's identity:

```text theme={"system"}
[agent btc-brain] config: strategy=llm provider=groq model=llama-3.3-70b-versatile mandate=momentum.md
```

Wizard `/agents to Create agent` accepts an optional Strategy brief textarea. It becomes a downloadable `<slug>.md` mandate and a copyable env snippet (`AGENT_STRATEGY=llm · LLM_PROVIDER · LLM_MODEL · TRADE_AGENT_ID · AGENT_PROMPT_FILE`) ending in the one-line docker launch.
