# AI Agent Usage

## How does Byreal Perps Agent Skills work with AI agents?

Byreal Perps Agent Skills is designed to be used by AI agents like RealClaw. When an agent runs the CLI on your behalf, it operates in the background without a visible terminal prompt. Every command available to you manually is also available to the agent.

The key difference is that certain high-impact actions are designed to pause and check with you before proceeding, rather than executing immediately. This ensures you stay in control of the decisions that matter most.

## Which actions require your confirmation?

| Action                              | When the agent asks                                                                      |
| ----------------------------------- | ---------------------------------------------------------------------------------------- |
| Close a position with a limit order | When the price set would fill immediately with more than 5% slippage from the mark price |
| Close all positions                 | Always                                                                                   |
| Cancel all orders                   | Always                                                                                   |

When one of these situations arises, the CLI outputs a plain-text warning and stops. The agent then passes that warning to you. Once you confirm, the agent re-runs the command to proceed.

## Example: closing a position with high slippage

1. The agent runs a close-limit command on your BTC position
2. The CLI detects the target price is 8.5% away from the current mark price and exits with a warning
3. The agent shows you the warning and waits
4. You confirm you want to proceed
5. The agent re-runs the command with the confirmation flag and the position is closed

## Example: closing all positions

1. You ask RealClaw to close all your open positions
2. The agent describes what it is about to do and which positions will be affected
3. You confirm
4. The agent proceeds and all positions are closed

## Account commands

| Command           | Description                                             |
| ----------------- | ------------------------------------------------------- |
| `account init`    | Connect your RealClaw wallet and set up a perps account |
| `account info`    | View your balance, margin, and account summary          |
| `account history` | View your recent trade history                          |


---

# Agent Instructions: 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 current page URL with the `ask` query parameter:

```
GET https://docs.byreal.io/byreal-perps-agent-skills/ai-agent-usage.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
