> For the complete documentation index, see [llms.txt](https://docs.3techagency.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.3techagency.com/documentation/reference-and-help/sandbox.md).

# Sandbox

Review AI-generated Elementor widgets and PHP snippets before they go live, and recover with safe mode.

The Sandbox holds code your AI generated, isolated under `wp-content/emcp-sandbox`, never in your theme, WordPress core or other plugins. Open **WP AI Manager > Settings > Sandbox**. Each area needs administrator access.

| Area         | What it holds                                                                | Status in 1.3.0                   |
| ------------ | ---------------------------------------------------------------------------- | --------------------------------- |
| Widgets      | Custom Elementor widgets, shown in the Elementor panel under "Custom (EMCP)" | Available with Elementor          |
| PHP Snippets | Small snippets that run as a shortcode or on a hook                          | Available; off until you allow it |
| Blocks       | Custom Gutenberg blocks                                                      | Not included in this build        |

The overview shows how many items are active and how many are drafts.

## Review a widget

1. Open **Widgets** and inspect the draft and its files.
2. Test it on a draft or staging page.
3. Activate it when you are satisfied.

## Activate a PHP snippet

{% stepper %}
{% step %}

### Allow AI-written code

Turn on **Settings > Advanced > Allow AI-written code**. Until then, the snippet tools are not offered to the assistant at all.
{% endstep %}

{% step %}

### Review the draft

Open **PHP Snippets**. Every snippet starts as a draft. Read the code, its hook or shortcode, and the validator results.
{% endstep %}

{% step %}

### Activate by hand

Activate the one snippet you reviewed. The assistant can never activate a snippet.
{% endstep %}
{% endstepper %}

## If a snippet breaks the site

* A fatal error automatically deactivates the last activated snippet.
* Add `?wam_safe_mode=1` to any URL to skip every snippet for that request, then deactivate the bad one.

Imported bundles create new drafts; they never overwrite or activate existing items. Large sandbox publishes may need a verified database checkpoint, which does not include files. Keep a full-site backup and test on staging for production sites.

The **Draft Sandbox** for pages is different: it is the copy of a page that Chat edits before you publish. See [Build pages and forms](/documentation/workflows/build-pages-and-forms.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.3techagency.com/documentation/reference-and-help/sandbox.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
