# build_snapshot

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/workspace_diagnostics/build_snapshot)

Extract the allowlisted, reportable policy snapshot from a payload.

## Signature

```python
build_snapshot(
    workspace_payload: Mapping[str, Any],
) -> dict[str, object]
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `workspace_payload` | `Mapping[str, Any]` | Yes | The full `ServerConfig.to_workspace_payload()` dict persisted with the binding. |

## Returns

`dict[str, object]`

Canonical snapshot mapping restricted to `SAFE_SNAPSHOT_FIELDS`.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/2069079e09546060f5b52b2cd4f0e3c813e820f3/libs/code/deepagents_code/workspace_diagnostics.py#L95)