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

# Security & custody

Where your funds are, and what the agent can and cannot do with them.

### Where your funds live

Each agent has its own **vault**, created for your wallet by the OnlyFarm vault program on Solana. The vault holds your SOL, your tokens and your LP positions. It belongs to your wallet and no one else's, and it pays its own position and token-account rent.

### What only you can do

* **Withdraw** SOL or any token to your wallet, at any time. Withdrawals don't go through the agent.
* **Close the vault** once its positions are closed, and take back its rent.
* **Pause or resume** the agent.

### What the agent can do

The agent signs with an OnlyFarm operator key. The vault program lets that key trade on your vault's behalf, and nothing more:

* It can open, add to, collect from and close positions, and swap tokens, but only through three integrations: **Meteora DLMM**, **Meteora DAMM v2** and **Jupiter**.
* It **cannot withdraw**. There is no way for the operator to send funds to an address it chooses. Positions, token balances, swap proceeds and refunded rent all stay in your vault, and a swap whose output doesn't land back in the vault is rejected.
* It can only charge the performance fee on claimed fees and rewards, never on your capital. See [Fees](/onlyfarm/guide/fees.md).

### What the vault cannot protect you from

* **Losing trades.** The vault keeps your funds in place, but it can't tell a good trade from a bad one. A poor entry, a stop that fires late or a thin pool can still lose money. Your scopes, slippage and price-impact limits and exit triggers are how you manage that risk.
* **Pausing is not revoking.** Pausing stops the agent from acting for your vault, but the operator key keeps its permission on-chain. To end that for good, withdraw your funds and close the vault.
* **An emergency pause of the program.** If OnlyFarm ever pauses the vault program, you can still withdraw idle SOL and tokens. Funds inside open positions can then only be released with a custom transaction until the program is resumed.
* **Managing positions outside the app.** Your positions are owned by your vault, not directly by your wallet, so they don't appear in Meteora's own interface. You can close them yourself on-chain, but that takes a custom transaction. The OnlyFarm app is the practical way to manage them.

### Transparency

Every action the agent takes (entries, exits, harvests, swaps) is recorded in your agent's **transaction history** with a link to the transaction on Solscan. You can also ask the agent in its terminal why it did something.
