# Exporting Policies for Treasure AI Studio

Export policies from Treasure Console to specify which policies agents can use through the Treasure Data connector in Treasure AI Studio. The exported JSON identifies the policies you selected; it doesn't copy their permission definitions. Use this procedure before adding or recreating the connector to restrict access for all users, without granting permissions they don't already have.

## Prerequisites

- An administrator or delegated administrator in Treasure Console. Only these roles can export policies.
- Policies that contain the permissions you want Treasure AI Studio to be limited to. See [Creating policies](/products/control-panel/security/policies/creating-policies) and [About policy-based permissions](/products/control-panel/security/policies/about-policy-based-permissions).


## Export the Selected Policies

1. Open Treasure Console and navigate to **Control Panel** > **Policies**.
2. Select the policies you want agents to use. **Export** becomes available once at least one policy is selected.
3. Select **Export**. The **Export policy definition** dialog shows the selected policy IDs and account information as JSON.
4. Select **Copy to Clipboard** to copy the entire JSON.
5. Paste the JSON into **Policy export document** when you add the Treasure Data connector in Treasure AI Studio. See [Connect Treasure Data CDP](/products/ai-studio/connections/treasure-data).


The screenshots use demo policy names and example IDs.

Up to 20 policies per export
An export can include at most 20 policies. If you select more than 20, **Export** is unavailable.

Don't edit the exported JSON
Export from the Treasure Data CDP account and environment used by your Treasure AI Studio account. Paste the JSON exactly as Treasure Console shows it, without changing the account information or policy IDs.

## What the Exported JSON Contains

The JSON refers to policies by ID. It includes the Treasure Data CDP account ID, the environment, and a version number, but it doesn't copy the permission definitions from the policies. The following example uses illustrative IDs; use the JSON copied from your own Console, not this example.

```json
{
  "version": 1,
  "site": "aws",
  "stage": "development",
  "account_id": 12345,
  "policy_ids": [101]
}
```

When a user authorizes a Treasure AI Studio connection, the connection receives only the policies that are both specified for the connector and assigned to that user. Specifying policies for the connector can narrow a user's access, but never expands it.

## Troubleshooting

| Issue  | Solution |
|  --- | --- |
| **Export** is unavailable | Select at least one policy, and no more than 20. |
| Treasure AI Studio says the pasted JSON is not valid | Paste the entire JSON as copied. Don't add, remove, or change any characters. |
| Connecting in Treasure AI Studio fails because the JSON was exported from a different account or environment | Export the JSON from the Treasure Data CDP account and environment that your Treasure AI Studio account uses, and add the connector again. |


## Next Steps

- [Connect Treasure Data CDP](/products/ai-studio/connections/treasure-data) — Add the connector and paste the exported JSON
- [About policy-based permissions](/products/control-panel/security/policies/about-policy-based-permissions) — How policies define access
- [Creating policies](/products/control-panel/security/policies/creating-policies) — Create the policies you want to export