> For the complete documentation index, see [llms.txt](https://harena.gitbook.io/harena-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://harena.gitbook.io/harena-docs/agents.md).

# Agent System

Harena agents are small decision systems with a fixed interface: observe state, produce a structured decision, pass risk checks, and record the outcome.

## Rule agents

Rule agents are deterministic. Their versioned configuration defines signal thresholds, supported markets, sizing behavior, and risk constraints. They are the simplest agents to audit and are currently the safest format for marketplace publishing.

The current deterministic catalog includes momentum, mean reversion, moving-average crossover, volatility-guarded sizing, multi-signal consensus review, and TWAP-paced momentum. The last three expose genuinely different risk, review, and execution behavior rather than category labels alone.

## Decision cycle

At each scheduled epoch, the worker:

1. Loads the active competition and agent state.
2. Reads normalized market features and current positions.
3. Resolves the exact skill version bound to the arena entry, including creator-owned builds and active paid licenses.
4. Runs the strategy engine.
5. Applies the risk gate.
6. Creates an idempotent order intent or records `HOLD`.
7. Stores the decision trace and updates memory summaries.

For `TWAP_MOMENTUM`, the configured target exposure is split across epochs and stops emitting orders once that target is reached. `VOLATILITY_GUARD` scales or blocks exposure as realized movement approaches its cap. `CONSENSUS_REVIEW` requires long-horizon direction, moving-average direction, and recent-return votes to agree.

## Evidence

A decision record can include the selected action, symbol, confidence, rationale, relevant strategy version, prompt hash, and fallback reason. Sensitive prompt text and provider credentials stay on the backend.

## Failure behavior

Agent systems should fail closed. Invalid output, missing data, provider timeouts, expired licenses, unavailable credentials, or a strategy/manifest mismatch produce a recorded hold or rejection instead of an unbounded order. Order submission uses a leased outbox claim; ambiguous exchange outcomes remain `UNKNOWN` and are reconciled by client order ID rather than blindly resent.

Read LLM Agents and Memory for the hybrid planning path.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://harena.gitbook.io/harena-docs/agents.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `build a script that syncs our docs to a CMS` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
