Mechanism: Playground
One-sentence definition
A playground is an isolated environment — branch, directory, sandbox repo, or local-only config — where agent experiments cannot damage production code, data, or shared branches.
The problem
You vibe directly on main or against production API keys. The agent “just tries” a migration, rewrites config, or hits a live endpoint. Something breaks for everyone, or you fear trying bold ideas because rollback feels hard.
Without a playground, every session is production stakes. That kills learning and encourages timid prompts.
Symptoms:
- Experiments on
mainor shared develop - Production credentials in agent context
- “Do not deploy” notes instead of structural isolation
- Deleted data or config with no cheap undo
How it works
Define where unsafe work is allowed:
Production / main (protected)
│
▼
Playground (agent-friendly)
├── git branch or worktree
├── sandbox repo / fork
├── local docker compose profile
└── fixture data, not prod DBRules: agents default to playground; merge only through checkpoint + verify. Playground is not “careless” — it is bounded risk.
When to use it
- New patterns, unfamiliar tools, aggressive refactors
- Agent loops and best-of-N attempts
- Learning a repo or spike implementations
- Any task where failure should be cheap
When not to use it
- Trivial doc typo on main — playground ceremony does not pay
- Playground so stale it no longer mirrors prod — refresh or document drift
- Using playground to skip code review — still checkpoint before promote
Failure modes
Fake playground — Same branch as teammates, called “sandbox” in chat. Fix: Structural isolation (branch, env, data).
Prod data in playground — Copy of real PII for tests. Fix: Synthetic fixtures.
Playground never promoted — Months of experiments, zero merges. Fix: Vertical slice with promote path.
Playground drift — Sandbox config unlike prod. Fix: Periodic sync or document differences.
No rollback in playground — Still afraid to experiment. Fix: Rollback even in sandboxes.
Minimal example
Context: Try a new health details shape before committing API contract.
Steps:
git checkout -b playground/health-details-shape- Agent freely edits types and routes on branch only.
- Compare with curl; discard branch or open PR after checkpoint.
Done when: main unchanged until you explicitly merge.
Tool instances (optional deep-dive)
Portable idea above; this section is tool-specific. Date: June 2026.
Cursor
- Agent on feature/playground branches by default in team rules.
- Separate workspace folder for throwaway spikes if needed.
.env.localfor playground keys; never prod in agent context.
Other tools
Docker dev profile, staging env, GitHub forks — same isolation principle.
Related mechanisms
- Branch-per-experiment — playground often is a branch
- Rollback — undo inside playground
- Scope fence — playground bounds the fence
Try it yourself
Exercise: Name your default playground for agent work (branch pattern, env, or folder). Write one rule: agents never edit X without Y.
You need: One minute
Done when: You can start an experiment without touching main.

