Skip to main content

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:
  1. Code generation — Sphinx writes the code to accomplish your task
  2. Review — The code is presented for your inspection
  3. Approval decision — You approve or reject the execution
  4. Execution — Only approved code runs
  5. 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
Rejecting code doesn’t stop Sphinx—it signals that the approach needs adjustment. Sphinx will consider your rejection when planning its next action.

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 helps you learn by showing each step before execution. Review Sphinx’s reasoning to pick up data science techniques.

Safe Mode vs Guardrails

Safe Mode and guardrails serve different purposes:
FeatureSafe ModeGuardrails
ScopeAll code requires approvalOnly flagged operations
ControlMaximumSelective
SpeedSlowerFaster
Use caseSensitive workGeneral protection
Guardrails are always active, even in Agent Mode. Safe Mode adds universal approval requirements on top of the existing guardrail protections.

Best Practices

  1. Start with Safe Mode when working with new datasets or unfamiliar analyses
  2. Review outputs carefully — check not just the code, but the results
  3. Switch to Agent Mode once you’re comfortable with the workflow
  4. Use for teaching — Safe Mode is great for demonstrating AI-assisted analysis