---
title: "Show which environment a tool is connected · Agent Wranglers"
url: https://agentwranglers.se/playbook/app-ui/resilience/environment-label
id: APP-80
level: Recommended
updated: 2026-10-22
build: a2a6bdfed830
tokens: 726
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Show which environment a tool is connected to

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Resilience](https://agentwranglers.se/playbook/app-ui/resilience.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers.md). Updated 2026-10-22.

- ID: APP-80
- Level: Recommended
- Chapter: [Resilience](https://agentwranglers.se/playbook/app-ui/resilience.md)
- Rule: Every screen of an admin or internal tool names its environment, such as Production or Staging, in text at the top of the screen. The page title starts with the same name.
- Check: A browser test opens the start page in each environment. The header text and `document.title` both contain the name in that server's environment setting.
- How: People keep staging and production open side by side, and both look the same. Read the name from the server's own configuration, never from the address the browser used. A wrong DNS entry then cannot mislead anyone. Label production too, so a missing label never reads as safe. Say it in words, as [never use colour as the only signal](https://agentwranglers.se/playbook/accessibility/seeing-and-reading/not-color-alone.md) says. Destructive actions still ask as [let people undo or confirm destructive actions](https://agentwranglers.se/playbook/app-ui/feedback-and-dialogs/confirm-or-undo.md) says.

## Examples

**Using these examples:** they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

### Python example

```python
@app.context_processor
def environment_name():
    return {"environment": os.environ["APP_ENVIRONMENT"].title()}
```

### TypeScript example

```ts
export function labelEnvironment(environment: string) {
  document.title = `${environment} | ${document.title}`;
  document.querySelector('[data-environment]')!.textContent = environment;
}
```

## Related rules

- AXS-4 [Never use colour as the only signal](https://agentwranglers.se/playbook/accessibility/seeing-and-reading/not-color-alone.md) in Accessibility
- APP-44 [Let people undo or confirm destructive actions](https://agentwranglers.se/playbook/app-ui/feedback-and-dialogs/confirm-or-undo.md) in Web app interface

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/app-ui/resilience/environment-label">Agent Wranglers web app interface playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Read feature flags before the first paint](https://agentwranglers.se/playbook/app-ui/resilience/feature-flags-in-ui.md)
- [Resilience](https://agentwranglers.se/playbook/app-ui/resilience.md)
