> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xpander.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Policies

> License models, API key lifetime, request and conversation retention, saved prompt text and which agents start sessions, for the whole organization.

[Policies](https://platform.xpander.ai/governance/policies) (**Platform > AI governance > Policies**) holds the rules for every model call in the organization. Select a row or choose **Change setting…** to change one. Changes reach the AI Gateway within seconds and are recorded in the [Audit log](https://platform.xpander.ai/governance/audit). A role that may only view policies sees **Your role lets you see the policies, not change them.**

## Agents that can start sessions

**New agents accept sessions from** is **Any agent** or **No agents**. **Set a group's own default** gives a group its own starting point. When a member's groups disagree, the organization default applies. Owners can still change it per agent ([Who can send tasks](https://docs.xpander.ai/use/agents/channels.md#other-agents)).

## License model

Each way of paying for model calls has a switch:

| License model | Who pays |
| - | - |
| **Bring your own subscription** | The person, on their own Claude plan in Claude Code, where xpander has enabled it for your organization. Plan calls go through xpander cloud. The plan covers model usage, which counts toward no budget. On xpander cloud, your organization pays the session-hour rate for agent turns on the plan ([What a run costs](https://docs.xpander.ai/use/agents/budgets.md#what-a-run-costs)). |
| **Bring your own key** | Your organization, on a stored provider key ([Providers and keys](https://docs.xpander.ai/run/llm-gateway/providers-and-keys.md)). The provider bills you. On xpander cloud, agent turns on the key pay the session-hour rate. |
| **Xpander AI Credits** | xpander's key, billed in credits. xpander cloud only. |

The last one that is on can't be turned off and shows **Stays on: calls fall back to it.** **Exceptions** lets groups and agents use fewer license models than the organization.

* **Default license model** (when both **Bring your own key** and **Xpander AI Credits** are on): **Bring your own key** uses your stored key when there is one and xpander's key otherwise. **Xpander AI Credits** always uses xpander's key, billed.
* **When someone's plan hits its limit** (when **Bring your own subscription** is on): **Fall back to company models** (the default) until the plan resets, or **Pause**, which holds their calls until then. Fallback calls are paid like any company call: per token on your stored key, or in credits on xpander's key, and they count toward budgets.

On Hybrid, **Xpander AI Credits** is not offered for anything on your install or your people's computers. Air-Gapped has only **Bring your own key**, so this section does not show. The full order on every call: [Licenses and who pays](https://docs.xpander.ai/run/llm-gateway/which-key-pays.md).

## Key lifetime

**Longest lifetime for a new API key** caps the expiry people can give keys in [AI models & keys](https://chat.xpander.ai/?settings=my-gateway): **30 days**, **90 days**, **180 days**, **1 year** or **No limit**. With a cap, the form says *Your organization allows up to ...* and does not offer **Never**. Existing keys keep their expiry.

## Request retention

**Keep requests for** sets how long [request records](https://docs.xpander.ai/run/llm-gateway/requests-and-costs.md) and their saved text are kept: **30 days**, **90 days**, **180 days**, **1 year**, or **Default** (90 days). Self-hosted installs also offer **No limit**, which applies until you set a period.

## Conversation retention

**Conversation retention** deletes finished conversations a set time after their last activity, with every turn in them. Admins set it under **Delete conversations after**: **Keep forever** (the default), **7 days**, **30 days**, **90 days**, **1 year** or **Custom** (1 to 3,650 days). The panel counts the conversations the next run will delete and asks you to confirm a shorter period.

* **Kept:** running conversations, files the agent created and files people uploaded, usage, billing, the audit log and gateway request records. Pinned and shared conversations are kept too, unless you turn on **Also delete pinned and shared conversations**.
* **When:** a nightly run at 02:30 UTC. Deleted conversations cannot be restored.
* **One agent's own period:** in the agent's settings, under **Advanced** > **Retention**: **Follow organization** (the default), **Custom for this agent** or **Keep forever**. **Agents that override** in the panel lists them. A person who cannot change policies can only set a shorter period than the organization's.
* **Record:** every change of either period, and every run that deletes conversations, is in the [Audit log](https://platform.xpander.ai/governance/audit).

## Prompt and response text

![Policies page with the Saved prompt text panel open: All users in the account and a switch per group, all on](https://mintcdn.com/xpanderai-099931d1/H-WYYv839kjeMNSx/images/llm-gateway/08-policies-capture.png?fit=max\&auto=format\&n=H-WYYv839kjeMNSx\&q=85\&s=290711b83ca28c8dcaca23f7474966bf)

Saved prompt text: one switch for all users in the account and one per group. Shown with sample data.

Usage, cost and timing are always kept. Prompt and response text is saved for everyone by default, including groups added later and people in no group. Saved text can include personal data: check your privacy obligations.

In **Saved prompt text**, turn off **All users in the account** to save no text at all, or turn off a single group's switch. Turning a switch back on asks you to confirm and says how long the text will be kept. Turning one off stops saving from the next call. Text already saved stays until its request is deleted.

| | |
| - | - |
| **Which calls** | Calls by, or agent runs started by, a person in a group with the switch on, or in no group while **All users in the account** is on |
| **What is kept** | The prompt (instructions, conversation, names of the skills offered) and the final answer. Never keys, headers, images or files. Anything that looks like a secret is removed, and very long text is cut with a note. |
| **Where** | Encrypted with a key unique to your organization, next to its request in your organization's own database |
| **Who can read it** | Roles that may view usage, under **Prompt and response** in [Logs](https://platform.xpander.ai/governance/logs). Every opened request is recorded in the [Audit log](https://platform.xpander.ai/governance/audit). |

On Hybrid, these switches cover agents in your environment. Coding tools on your people's computers connect to xpander cloud, which never saves their text.

## Next steps

> [card] [See who pays for each call](https://docs.xpander.ai/run/llm-gateway/which-key-pays.md)
>
> The order on every call.

> [card] [Read requests and their cost](https://docs.xpander.ai/run/llm-gateway/requests-and-costs.md)
>
> What a request record holds.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.