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

# Security model

The guarantees Kyte is built around, and how they are enforced.

{% hint style="success" %}
**In short.** No sweep, no rescue, no proxies. Checks-effects-interactions and transient-storage reentrancy guards on every entry point, exact balance-delta checks on every pull, and 106 Foundry tests including fuzzing and invariants.
{% endhint %}

**Design rules**

* No function moves collateral anywhere except to its seller or the option holder; the only deduction is the fixed exercise fee, which goes to the FeeVault. There is **no sweep or rescue**.
* Checks → effects → interactions everywhere. Terminal status is set before any transfer.
* `nonReentrant` (OpenZeppelin `ReentrancyGuardTransient`, EIP-1153 transient storage) on every state-changing entry point.
* `_mint` instead of `_safeMint`: no receiver callbacks during a fill.
* **Exact balance-delta checks** on every pull, so fee-on-transfer and similar tokens revert (`FeeOnTransfer`).
* Separate escrows for calls and puts. `locked[token]` ledgers per market (invariant: balance ≥ locked).
* Fees are snapshotted per position; hard caps are compile-time constants (10% premium, 1% exercise, stakers ≥ 20%).
* A pause blocks only new offers, fills, new stake and buybacks. Cancel, exercise, expire, unstake and claim are never paused.
* Router: wraps exact amounts, refunds, and must end empty. Markets accept `*For` calls only from the timelock-set router, and still check NFT ownership.
* Buybacks: two on-chain price floors (TWAP + last price) and a per-call cap.
* Staking: activation delay plus activation lock against just-in-time staking.
* Mainnet deploy guards: guardian, ops, admin and timelock must be contracts, not EOAs (the Safes and the `TimelockController`); the deployer can't be the timelock.

**Website hardening**

* Strict Content-Security-Policy with a fresh nonce per request (`src/proxy.ts`): `script-src 'self' 'nonce-…' 'strict-dynamic'`, `frame-ancestors 'none'`, and `connect-src` limited to the chain RPC, the indexer and the wallet providers.
* HSTS, `X-Frame-Options: DENY`, `nosniff`, a strict `Permissions-Policy`, no `X-Powered-By`, no production source maps.
* Every write is simulated before the wallet is asked to sign.

**Testing:** 106 Foundry tests covering every external function, fuzzing (fee conservation, exercise-xor-expire around expiry ±10 s, decimals 0–24, vault and pool solvency), handler invariants (collateral ledgers, forward-only status, NFT exists iff Filled, Router never holds a balance) and swaps on a real Uniswap v4 PoolManager.

**Reporting vulnerabilities:** <contact@kyte.sh> or a direct message to @useKyte on X.


---

# 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 by asking a question.

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

```
GET https://docs.kyte.sh/protocol/security.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 `automate deployments from our CI pipeline` 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.
