Skip to main content
Safety Mode controls how strictly Foenix validates and restricts the PHP code it generates before executing it on your WordPress site. You can set it per session. There are three levels:

Safe

The most restrictive mode. Foenix operates within a strict whitelist of allowed operations. Allowed:
  • Editing files only in /wp-content/themes/[current_theme]/ and /wp-content/uploads/
  • Database operations only via WordPress APIs (wp_insert_post, update_option, WP_Query, etc.)
Blocked:
  • Any access to /wp-admin/, /wp-includes/, /wp-content/plugins/, root files (wp-config.php, .htaccess, robots.txt)
  • A large list of PHP functions and constructs including eval(), exec(), file_get_contents(), fopen(), shell_exec(), $wpdb direct queries, and many more
  • No outgoing HTTP requests without explicit instruction
  • No schema changes (CREATE, ALTER, DROP)
  • All inputs must be sanitized, all outputs must be escaped
Use Safe mode on production sites when you want maximum protection and are willing to accept that some tasks may not be possible.

Balance

A middle ground. Foenix can operate in a wider scope but still respects core safety boundaries. Allowed:
  • Same file system scope as Safe mode
  • Database read/write via WordPress API
Blocked:
  • /wp-admin/, /wp-includes/, /wp-content/plugins/, root files
  • Critical dangerous functions: eval(), create_function(), exec(), shell_exec(), system(), passthru(), base64_decode()
  • No outgoing HTTP requests to payment gateways without explicit user confirmation
  • No raw SQL schema changes
Balance mode is suitable for most development tasks where you need more flexibility than Safe but still want meaningful restrictions.

Hard

The least restrictive mode. No safety policy is applied - Foenix generates code without additional constraints. This gives the most power and flexibility, but also the highest risk of something breaking. Use with caution on production sites.

Which mode to choose

SituationRecommended mode
Production site, content tasksSafe or Balance
Active development on stagingBalance or Hard
Complex plugin or theme workHard (with backup)
Autonomous agentsSafe or Balance
Each session and each agent has its own Safety Mode setting. Please set this at your own discretion and risk. Always make a backup before running any edits regardless of which mode you choose. Backups →