> AI agents: this is one page from PostHog's docs. Full index of Markdown docs for LLMs: https://posthog.com/llms.txt # PostHog Desktop environments An **environment** is how you tell PostHog Desktop how to set up a repo so the agent can start work in it. There are two types of environments, one for each side of where tasks run. | Type | Used by | What it controls | | --- | --- | --- | | Local environment | [Worktree tasks](/docs/posthog-desktop/worktrees.md) | A setup script that runs when a worktree is created | | Cloud environment | [Cloud runs](/docs/posthog-desktop/cloud-runs.md) | Network access rules and the secrets and environment variables the cloud workspace gets | Local mode tasks don't use environments. They run on your computer in the repo as it already exists, so nothing needs to be prepared. ## Local environments [Worktrees](/docs/posthog-desktop/worktrees.md) run in a different directory than your local checkout, so they don't have the dependencies or files that aren't tracked by git. A local environment fills that gap with a setup script that runs once, when a new worktree is created. Use it to: - Install dependencies - Run migrations - Start background services - Do anything else needed to get coding Local environments live in the repo, so they're committable and shared with your team. Once one is in place, every new worktree gets a project that's already installed and ready. You can manage your worktree environments in PostHog Desktop in the **Settings**. ## Cloud environments A cloud environment controls how a [cloud run](/docs/posthog-desktop/cloud-runs.md) is configured: what network it can reach, and what secrets and environment variables get injected into the workspace. Tasks using a cloud environment consume credits for their model usage and cloud compute. See [pricing](/docs/posthog-desktop/pricing.md) for current rates. Network access can be configured with three different levels: - **Trusted.** A curated allowlist (GitHub, npm, PyPI, and similar). - **Full.** Anywhere on the internet. - **Custom.** Your own allowlist of domains, optionally with the trusted set included. Manage cloud environments in PostHog Desktop under **Settings**. ### Still have questions? Ask PostHog AI ### Was this page useful? HelpfulCould be better