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

# Safe agent sessions

> Simple checklist for running agents on real Windows PCs.

Glasswarp gives an agent **eyes and hands** on a Windows PC you own. You supply
the **brain**. Treat full desktop control as powerful — start small, watch it,
then open the throttle.

Glasswarp handles **session controls** (consent, on-screen indicator, kill
switch, audit, Live View). Your agent code handles **what it’s allowed to do**.

See also: [Safety and consent](/concepts/safety-and-consent) ·
[Live View](/guides/live-view)

## Checklist

### On the Glasswarp side

* [ ] Use a **dedicated rig** when you can — not your everyday PC
* [ ] Turn **API access** on only when you need it (Console → Rigs)
* [ ] Scope API keys to **one rig** when possible
* [ ] Keep **Live View** open on first runs; kill from Console if needed
* [ ] Always **`end_session`** when finished

### In your agent code

* [ ] **Ask a human** before delete, send, purchase, install, or security changes
* [ ] **Allowlist** apps the agent may launch
* [ ] Set a **max steps / max minutes** budget
* [ ] Don’t put **passwords or secrets** in prompts
* [ ] **Log** what the agent is about to do

## Simple split

| Glasswarp                                  | Your agent                              |
| ------------------------------------------ | --------------------------------------- |
| Consent, indicator, kill, audit, Live View | Approvals, allowlists, budgets, prompts |

You need both.

## Patterns

**Watch first.** Open [Live View](/guides/live-view) (or the
[`live_view_hitl`](/examples/templates) template) before full autonomy.

**Confirm risky acts.**

```python theme={null}
def maybe_act(gw, sid, action):
    if action.get("risk") in ("delete", "send", "purchase", "install"):
        if not human_approved(action):
            return
    apply_action(gw, sid, action)
```

**Budget + always clean up.**

```python theme={null}
MAX_STEPS = 40
session = gw.create_session(rig_id=rig.id, mode="desktop")
sid = session.session_id
try:
    for step in range(MAX_STEPS):
        obs = gw.observe(sid, max_width=1280, mark=True)
        action = decide(obs)
        if action is None or action.get("type") == "done":
            break
        maybe_act(gw, sid, action)
finally:
    gw.end_session(sid)
```

## Console

| Action            | Where              |
| ----------------- | ------------------ |
| API access on/off | Console → Rigs     |
| Keys              | Console → API Keys |
| Watch / kill      | Console → Sessions |

## In our examples

Helpers live in `sdk/python/examples/safe_session.py` (budgets, intent logs,
allowlist, optional `REQUIRE_CONFIRM=1`). Templates and demos use them. Long
showcases (Paint / Minesweeper) stay unattended by default — set
`REQUIRE_CONFIRM=1` if you want prompts.

```bash theme={null}
export REQUIRE_CONFIRM=1
export MAX_STEPS=40
export ALLOWED_APPS=notepad.exe,mspaint.exe,chrome.exe
```

## Related

* [Safety and consent](/concepts/safety-and-consent)
* [Build an agent loop](/guides/agent-loop)
* [Templates](/examples/templates)
