> For the complete documentation index, see [llms.txt](https://kline-operation.gitbook.io/kline-operations/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kline-operation.gitbook.io/kline-operations/security-and-risk-framework.md).

# Security and risk framework

## Security principles

<figure><img src="https://1394161170-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDdMuk4GiSJIpFyqK1m98%2Fuploads%2FZ0KUiHlxd9NLH4rpYqet%2FSecurity%20and%20risk%20framework.png?alt=media&amp;token=38dd5b2f-7e62-4436-b176-31d60e957887" alt=""><figcaption></figcaption></figure>

Kline0 should be built around a non-custodial and risk-aware design.

Core security principles:

* Users keep funds on their own exchange accounts.
* Kline0 should not require withdrawal permissions.
* API keys should be encrypted.
* Secrets should never be exposed to the frontend.
* Every execution path should pass risk checks.
* User data should be isolated by user ID.
* Admin and partner access should be role-based.
* AI agents should operate inside clear permission boundaries.

## Exchange API security

Kline0 exchange connections should follow these rules:

```
User submits exchange API key
  ↓
KlineO validates permissions
  ↓
Withdrawal permission is not required
  ↓
Credentials are encrypted
  ↓
Backend service handles signed exchange requests
  ↓
User can disconnect exchange access at any time
```

## Trading risk controls

Kline0 risk settings may include:

* Max position size
* Max daily loss
* Max leverage
* Max open positions
* Strategy allocation limits
* Copy trading allocation
* Bot exposure limits
* Futures trading warnings
* Competition risk rules

## AI agent controls

AI agents should include:

* No guaranteed profit claims
* User confirmation for sensitive actions
* Risk engine validation
* Audit logs
* Permission scopes
* Clear disclaimers

## Competition integrity controls

Trading competitions should include:

* Clear eligibility rules
* Minimum activity thresholds
* Anti-abuse review
* Duplicate account checks
* Suspicious activity flags
* Reward review before final settlement
* Campaign-specific terms

## Risk disclaimer

Kline0 provides trading tools, automation workflows, AI-assisted analysis, and campaign infrastructure. It does not remove trading risk. Users should understand that crypto markets are volatile and trading can result in capital loss.
