Summary
Define when and how to use feature flags to enable concurrent development on overlapping areas without blocking merges, while maintaining system stability and providing clear ownership of flag lifecycle.
Use case and motivation
Problem today:
- Two agents/humans working on related but non-identical features in the same area must serialize — one waits for the other to merge.
- Incomplete features either block the main branch or require long-lived feature branches that diverge painfully.
- SRE and testers need the ability to disable in-progress work without reverting commits.
- No convention exists for how flags are introduced, who owns them, or when they're removed.
After this ADR:
- Concurrent work on partially-conflicting features proceeds via flags
- Incomplete work merges to main behind flags (trunk-based development)
- SRE can disable features in production without code changes
- Flag lifecycle has clear ownership and expiration
Proposed approach
When to use feature flags
| Situation |
Use a flag? |
| Feature spans multiple PRs, incomplete state is unsafe |
Yes |
| Two contributors touch the same module for different purposes |
Yes (isolate each behind a flag) |
| SRE needs a kill switch for a new capability |
Yes |
| Simple refactor with no behavioral change |
No |
| Bug fix |
No |
| One-PR feature that's complete on merge |
No |
Flag ownership
- Every flag has an owner (the issue that introduced it)
- Every flag has an expiration (the issue/PR that removes it)
- Flags without a removal plan are rejected in review
Separation of concerns
- Planners decide which features get flags (issue/RFC level)
- Implementors add/use flags in code (PR level)
- SRE/operators toggle flags in production (runtime level)
- No self-approval — the person who introduces a flag cannot approve its own removal
Open questions
- Flag mechanism: CDK context variables? DynamoDB runtime config? Environment variables?
- Should flags be typed/structured (not just boolean) to support gradual rollout?
- Maximum flag lifetime before mandatory cleanup?
- How do flags interact with the Cedar policy engine (governance of flagged tool-call behavior)?
Alignment
Aligns with Scale and collaboration — enables multiple autonomous agents to merge concurrent work without blocking, and with Observability and safe deploy — kill switches for new capabilities.
Dependencies
- RFC PR: (pending approval)
- Approved by: (pending)
- Reviewed by: (pending)
Summary
Define when and how to use feature flags to enable concurrent development on overlapping areas without blocking merges, while maintaining system stability and providing clear ownership of flag lifecycle.
Use case and motivation
Problem today:
After this ADR:
Proposed approach
When to use feature flags
Flag ownership
Separation of concerns
Open questions
Alignment
Aligns with Scale and collaboration — enables multiple autonomous agents to merge concurrent work without blocking, and with Observability and safe deploy — kill switches for new capabilities.
Dependencies