# Resources and state

> Native resource identities and durable app data.

- Canonical page: https://docs.userland.fun/concepts/resources-and-state/
- Docs index for agents: https://docs.userland.fun/llms.txt

> **For agents:** Inspect current Account authority, exact revisions and native capabilities before acting.

Apps declare native bindings in Wrangler configuration. Userland assigns owned D1 databases and private R2 buckets to an app environment, and supplies secret revisions separately. Application code uses those native bindings directly.

A code deployment that retains the same resource and secret identities preserves saved notes, attachments and sessions. Changing a database binding or signing secret changes those assumptions. Record the exact identities and verify the target behavior rather than equating code rollback with data rollback.

Migrations are explicit SQL with a tracked history. Incompatible or failed changes block activation. Full recovery archives require a signed-in owner/admin; bounded queries require full publishing authority because rows may contain credentials or personal data.

Stopping or deleting execution does not delete durable resources or promise retained storage is free. Follow the explicit retention and deletion state reported by the platform.
