# Change something that's live

> Changes an agent people already use, tries it before they meet it, puts it live, and rolls back if it goes wrong.

**Skill for your coding agent:** [`mindset-build-agent/SKILL.md`](https://docs.mindset.ai/skills/mindset-build-agent/SKILL.md)

**Skill for your coding agent:** [`mindset-connect/SKILL.md`](https://docs.mindset.ai/skills/mindset-connect/SKILL.md)

**Skill for your coding agent:** [`mindset-test-agent/SKILL.md`](https://docs.mindset.ai/skills/mindset-test-agent/SKILL.md)

Running an agent is a loop: see what happened, diagnose what went wrong, change the agent, test the change, activate it, then see what happens next. Highlighted: Change, Activate.

## Ask your AI client

```
Finance wants the invoice exceptions agent's supplier queries to quote the contract clause. Save that as a new version, compare it with the active one, and tell me what stands between it and going live. Don't activate it.
```

## What you get back

A new numbered [version](https://docs.mindset.ai/docs/versions-and-going-live) that isn't live, a comparison with the active one part by part, and anything that would stop it activating. Everyone keeps talking to the active version until you activate the new one.

## Who a change reaches

| What you change      | Reaches people                                                                                               |
| -------------------- | ------------------------------------------------------------------------------------------------------------ |
| The agent            | When you activate the version, from each conversation's next turn                                            |
| A function or widget | When you publish it, in every agent that uses it. Check which agents hold it on **Monitor → Topology** first |
| A connection         | On the next call, for every agent                                                                            |

Your whole org gets the same active version in an [environment](https://docs.mindset.ai/docs/environments). For a change you wouldn't want a colleague to meet first, make it in a second environment and repeat it in Production. Nothing copies between them.

## Try it, then put it live

### 1. Try it on the Chat tab

Try the saved version on the **Chat** tab. Its writes are refused until an admin presses **Agree writes**, and then they're real.

### 2. Run the tests

Run the script's test parameters and the acceptance tests. See [Test behavior](https://docs.mindset.ai/docs/test-an-agents-behavior).

### 3. Note where you start

Note the agent's **p95** and **Avg $/call**, so you have something to compare against.

### 4. Activate

Activation is refused when something the version uses is deleted, archived or switched off, when its model isn't served in your region, or when it puts new script text live over an operation with no successful call since its last lapse. Hover over the version's badge to read why. An admin can **Go live untested**, recorded with their name.

### 5. Tell people it changed

Tell the people who use the agent that it changed, and read its new sessions for a few days.

## If it goes wrong

Stop it this minute at the connection: **Withdraw approval** on a write, or **Disable** on a read or a whole connection. It takes effect on the next call, for every conversation already running. See [Approve what agents can do](https://docs.mindset.ai/docs/approve-what-an-agent-can-do).

Then roll back.

| What you changed | How to go back                                        |
| ---------------- | ----------------------------------------------------- |
| The agent        | **Activate version N** on an earlier version          |
| A function       | **Roll back to this** on an earlier published version |
| A widget         | **Re-activate** on an earlier published version       |

Rolling back meets the same checks as going forward, and activating an older version can drop resources added since. Rolling back an agent doesn't roll back its functions or widgets: it uses whatever version of each is published now.

> **Tip:** Try a rollback once before you need it in a hurry.

## When a connected system changes

A system you connect to can go down, be retired or start returning something different.

- **Disable** on a connection's **Overview** stops every call through it, and marks everything that calls it unusable until you press **Enable**. Use it while the finance team migrates their system.
- **Archive** deletes a connection for good. If anything live depends on it, the dialog names each dependent first, and **Archive anyway** deletes.
- A **contract break** is a successful call that comes back without a field the operation has established. Only what reads that field turns unusable, and **Monitor → Resources** lists it under "Broken by a change to something they depend on". Read what the operation returns now with **Show recent responses** on the connection's **Operations** tab, then change the script or function, or restore the field.
- Rotating a credential, changing the base URL or re-registering an operation lapses its tested status. Nothing live stops, but the next version that puts it live needs a successful call first.

## What you decide

- Whether the change is worth what it costs in speed and spend.
- Who must know before it goes live, and who after.
- Whether an untested operation goes live anyway. That's an admin's call, on the record.

## Done when

- You knew which agents the change would reach before you made it.
- You tried the version and its tests passed before you activated it.
- You know where **Withdraw approval**, **Disable** and the rollback actions are.

## In the Studio

On the agent, edit any tabs, then **Save as version**. **Versions & Availability** lists every version with its status. Tick two and choose **Compare the two selected**, or open a row's menu to **Activate version N**, **Open version N** or **Delete version N**. The **Chat** tab's version picker talks to any saved version, and each reply shows "Answered by version N". Functions and widgets publish and roll back from their own **Versions** tab.

![The Versions & Availability tab, listing four versions with version 4 active.](https://docs.mindset.ai/images/docs/studio/agent-versions.png)
