---
title: "Keep serving when the flag service is down · Agent Wranglers"
url: https://agentwranglers.se/playbook/engineering/feature-flags/flag-service-outage
id: ENG-47
level: Recommended
updated: 2026-10-22
tokens: 914
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Keep serving when the flag service is down

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Feature flags](https://agentwranglers.se/playbook/engineering/feature-flags.md).

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

- ID: ENG-47
- Level: Recommended
- Chapter: [Feature flags](https://agentwranglers.se/playbook/engineering/feature-flags.md)
- Rule: Give every flag a default value in the code and evaluate flags from a local copy. When the flag service cannot be reached, the app keeps serving with the last values it had, or the defaults.
- Check: Block the flag service on staging and restart the app. Every request still succeeds, and each flag returns its last known value or its default.
- How: A flag service is called on almost every request, so its outage becomes yours unless the client survives it. Use a client that downloads the rules and decides locally, as Unleash server SDKs and many OpenFeature providers do. Set a short timeout on the download, as [Set timeouts on every call](https://agentwranglers.se/playbook/api-design/reliability/timeouts.md) says. Choose each default so a missing value keeps today's behaviour, as [Separate deploying from releasing](https://agentwranglers.se/playbook/engineering/running-in-production/deploy-is-not-release.md) says. Flag files in the repository follow [Roll out settings and data files like code](https://agentwranglers.se/playbook/engineering/build-test-and-deploy/staged-config-rollouts.md).

## 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.

### TypeScript example

```ts
const flags = new FlagClient({ url: FLAG_URL, refreshIntervalMs: 15_000, timeoutMs: 1_000, cacheFile: '/var/cache/app/flags.json' });

export const isNewCheckoutOn = (user: User) => flags.isEnabled('new-checkout', { user, defaultValue: false });
```

### Python example

```python
flags = FlagClient(url=FLAG_URL, refresh_interval=15, timeout=1.0, cache_file="/var/cache/app/flags.json")

def is_new_checkout_on(user: User) -> bool:
    return flags.is_enabled("new-checkout", user=user, default=False)
```

## Sources

- [OpenFeature specification: Flag evaluation](https://openfeature.dev/specification/sections/flag-evaluation)

## Related rules

- API-35 [Set timeouts on every call](https://agentwranglers.se/playbook/api-design/reliability/timeouts.md) in API design
- ENG-25 [Separate deploying from releasing](https://agentwranglers.se/playbook/engineering/running-in-production/deploy-is-not-release.md) in Engineering
- ENG-12 [Roll out settings and data files like code](https://agentwranglers.se/playbook/engineering/build-test-and-deploy/staged-config-rollouts.md) in Engineering

**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/engineering/feature-flags/flag-service-outage">Agent Wranglers engineering playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Hand flags to a new owner when people leave](https://agentwranglers.se/playbook/engineering/feature-flags/flag-owner-handover.md)
- Next: [Log every flag change in production](https://agentwranglers.se/playbook/engineering/feature-flags/flag-change-log.md)
- [Feature flags](https://agentwranglers.se/playbook/engineering/feature-flags.md)
