> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Running the iCommerce Agent in Sandbox

> How to execute iCommerce agent workflows inside StateSet Sandbox.

# Running the iCommerce Agent in Sandbox

This guide explains how to run the iCommerce agent inside StateSet Sandbox for secure, isolated execution.

## Why Sandbox

* Isolated runtime for agent execution
* Controlled access to tools and data
* Deterministic workflows with auditability

## High-Level Flow

1. Provision a sandbox environment.
2. Start the iCommerce agent process.
3. Use MCP tools or the CLI for queries and actions.
4. Stream outputs and capture logs.

## Sandbox Setup

Create a sandbox and run a simple command:

```bash theme={null}
curl -X POST https://api.sandbox.stateset.app/api/v1/sandbox/create \
  -H "Authorization: ApiKey YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"timeout_seconds": 300}'
```

## Run the Agent

Inside the sandbox, run the `stateset` CLI in read-only mode first, then apply actions explicitly:

```bash theme={null}
stateset "show me pending orders"
stateset --apply "ship order #12345 with tracking FEDEX123"
```

## Logging and Auditing

* Stream command output for review
* Record actions, inputs, and outcomes
* Keep explicit write intent for audit trails

## Related Documentation

* [Sandbox API Flow](/stateset-sandbox-api-flow)
* [CLI Safety Model](/stateset-icommerce-cli-safety)
* [iCommerce Agent](/stateset-icommerce-agent)
