Overview
Safe Mode gives you complete control over code execution. In this mode, Sphinx writes code but requires your explicit approval before executing each cell. This is the most conservative interaction mode, ideal for sensitive operations or when you want to carefully review every step.In Safe Mode, Sphinx writes code and allows you to manually review and execute each cell. Nothing runs without your approval.
How It Works
When you submit a prompt in Safe Mode:- Code generation — Sphinx writes the code to accomplish your task
- Review — The code is presented for your inspection
- Approval decision — You approve or reject the execution
- Execution — Only approved code runs
- Iteration — Sphinx continues based on results or your feedback
The Approval Workflow
For each code cell, you can:- Approve — Execute the code as written
- Reject — Decline execution; Sphinx will adapt its approach
When to Use Safe Mode
Safe Mode is essential for:- Sensitive data — Financial, medical, or personal information
- Production environments — When mistakes have real consequences
- Learning — Understanding each step Sphinx takes
- Unfamiliar code — Reviewing operations before they execute
Safe Mode vs Guardrails
Safe Mode and guardrails serve different purposes:| Feature | Safe Mode | Guardrails |
|---|---|---|
| Scope | All code requires approval | Only flagged operations |
| Control | Maximum | Selective |
| Speed | Slower | Faster |
| Use case | Sensitive work | General protection |
Guardrails are always active, even in Agent Mode. Safe Mode adds universal approval requirements on top of the existing guardrail protections.
Best Practices
- Start with Safe Mode when working with new datasets or unfamiliar analyses
- Review outputs carefully — check not just the code, but the results
- Switch to Agent Mode once you’re comfortable with the workflow
- Use for teaching — Safe Mode is great for demonstrating AI-assisted analysis