---
title: Detached
description: What another process needs to adopt a VM handed off by Sandbox.detach().
---

```python
@final
class Detached
```

What another process needs to adopt a VM handed off by `Sandbox.detach()`.

Pass the fields to `Sandbox.adopt(region, microvm_id, endpoint, agent_token, port=port)`.
`agent_token` is a credential: keep it (or `to_dict()`) in private encrypted storage. It
never appears in repr.

## Constructor

`Detached` declares no `__new__` or `__init__`, so it is not constructed directly: an instance comes back from another call in this package.

## Properties

### `agent_token`

```python
agent_token: str
```

The bearer the VM's daemon accepts. Store only in a private encrypted record.

### `endpoint`

```python
endpoint: str
```

The HTTPS endpoint its daemon answers on.

### `microvm_id`

```python
microvm_id: str
```

The VM's identifier.

### `port`

```python
port: int
```

The daemon port the endpoint's proxy tokens are minted for.

### `region`

```python
region: Region
```

The region the VM runs in.

## Methods

### `to_dict`

```python
def to_dict() -> dict
```

Every field, token included, as a JSON-safe dict for a private store.

## Special methods

### `__repr__`

```python
def __repr__() -> str
```

## Provenance

This page is generated from `bindings/microvms-py/microvms.pyi` by Griffe 2.3.0, run from `site/scripts/gen-reference.mjs` on every `pnpm run sync`, so an edit made here is overwritten by the next run.

To change the page, change the doc comment in the binding's Rust source, then regenerate the declarations with `mise run stubs`. `mise run stubs:check` fails when the committed file no longer matches the source.