agentleFS
voyager67voyager67/JaneStreet-Agentic-Skills/skills/pre-trade-risk-controls/SKILL.md

pre-trade-risk-controls

Skill13 starsChanged 5 days agoApache-2.0View on GitHub

Specify, review, or test pre-trade and real-time controls for automated trading systems, including order size/notional limits, price collars, position/exposure limits, message throttles, stale-data checks, disconnect handling, and kill switches. Use for risk-control architecture and testing, not for bypassing controls.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 6 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Validate orders before release: Check instrument status, price/quantity increments, duplicate/client IDs, allowed order types, notional, …

    line 13
  2. Distinctive:

    Fail closed where required: When critical data or control state is unknown, block new risk-increasing orders.

    line 17
  3. Distinctive:

    Test limits and failures: Use boundary tests, concurrency tests, stale data, sequence gaps, duplicate fills, disconnect/reconnect, clock …

    line 18
  4. Distinctive:

    No silent fallback to permissive limits when a risk service is unavailable.

    line 24
  5. Distinctive:

    Never allow an agent to raise a production limit, disable a kill switch, or submit live orders without explicit approval through the proper …

    line 25
  6. Distinctive:

    Treat stale positions, FX rates, reference prices, and market data as risk events.

    line 26

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Pre-Trade Risk Controls and Kill Switches

Act as a risk-controls engineer. Controls must fail safely, be observable, and remain effective when strategies, market data, networks, or dependencies fail. A skill cannot authorize live trading or weaken a firm's controls.

Workflow

  1. Inventory the risk surface. Identify accounts, instruments, venues, strategies, order types, currencies, position nets, credit/margin dependencies, and control owners. Distinguish firm limits from local strategy limits.
  2. Define hard limits and units. Examples include max order quantity, max notional, price collars, max open orders, max message rate, max position, gross/net exposure, loss thresholds, and concentration. Specify currency conversion source and stale-FX behavior.
  3. Validate orders before release. Check instrument status, price/quantity increments, duplicate/client IDs, allowed order types, notional, position impact, credit, exposure, price collar, session, throttle, and strategy authorization. Specify ordering of checks and atomicity.
  4. Monitor changing risk after release. Recompute on fills, cancels, replaces, corporate/instrument events, FX updates, and risk-model changes. Handle partial fills and race conditions without double-counting.
  5. Detect unsafe market/system state. Define maximum market-data age, sequence-gap behavior, crossed-book behavior, clock skew, order acknowledgement lag, disconnect, reject spikes, compute overload, and inconsistent position state.
  6. Define a kill hierarchy. Strategy pause, instrument/venue pause, account-level cancel, and firm-level kill. Specify who can invoke each, what it cancels, whether new orders are blocked, and how recovery is approved.
  7. Fail closed where required. When critical data or control state is unknown, block new risk-increasing orders. Preserve the ability to reduce risk through separately governed procedures; do not assume every cancel/hedge path is always available.
  8. Test limits and failures. Use boundary tests, concurrency tests, stale data, sequence gaps, duplicate fills, disconnect/reconnect, clock drift, limit service outage, partial fill during kill, and recovery drills.
  9. Audit and evidence. Record the pre-trade decision, limits/versions used, reject reason, override owner, state transitions, and kill activation. Redact secrets.

Guardrails

  • Controls must not rely only on a strategy's own code path; use an independent control boundary where the architecture permits.
  • No silent fallback to permissive limits when a risk service is unavailable.
  • Never allow an agent to raise a production limit, disable a kill switch, or submit live orders without explicit approval through the proper process.
  • Treat stale positions, FX rates, reference prices, and market data as risk events.

Deliverable

Produce a control inventory, limit matrix, order-validation sequence, state/failure matrix, kill-switch semantics, test evidence, audit design, owners, and approval requirements.

Further reading

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.