# AMC SQL Sandbox Validation Before Production

Canonical page: https://www.kuudo.com/guides/amc-sql-sandbox-validation/

Use AMC SQL sandbox validation to test syntax, joins, and output shape, then check real identifiers and runtime on a short advertiser-instance window.

Author: Thomas Spicer
Updated: Oct 19, 2026

## Summary

- Run the exact production SQL in the AMC sandbox to catch invalid tables, columns, joins, grouping, and output grain before the first advertiser-instance run.
- Keep aggregation controls on for a production-like reporting check. Turn them off only to inspect event-level synthetic rows or preview a table.
- Synthetic signals cannot validate real campaign or ASIN IDs, representative distributions, or production-scale runtime. Confirm those on a short advertiser window.

AMC SQL sandbox validation in [Amazon Marketing Cloud (AMC)](/features/amc/) uses a three-gate Skill: check the query against current AMC guidance, run the same SQL on sandbox synthetic signals, then confirm it on a short advertiser-instance window. A sandbox pass removes structural uncertainty. It does not predict your brand's results or production-scale runtime.

The [Amazon Ads MCP](/features/amazon-ads-mcp/) supplies the authorized AMC context and execution tools; [Amazon Agent Atlas](/features/agent-atlas/) grounds the checks in Amazon's current sandbox rules.

The operator question was specific: *“Can we test an AMC query before it runs against production and we wait an hour to learn it was wrong?”* I wanted the agent to catch a missing column, bad grouping choice, or invalid join before the expensive run, without turning synthetic output into a media recommendation.

### Keep sandbox checks with the production context

[ChatGPT, Claude, Perplexity, Microsoft Copilot, and whatever comes next](/features/ai-clients/) know nothing about your business out of the box. Your competitors use those tools too. Kuudo gives those same tools your edge: **your data**, **your rules**, and **the way your business operates**. That means **your account as it is right now**, **your judgment running every time**, and **your call before anything changes**.

The [Amazon Ads MCP](/features/amazon-ads-mcp/) reads and tests against your authorized instance, [Skills](/features/skills/) preserve the rules your team expects, [Amazon Agent Atlas](/features/agent-atlas/) supplies Amazon-specific guidance, and approval controls keep activation and other consequential changes with you.

| Gate | Proves | Cannot prove |
| --- | --- | --- |
| Atlas and schema | Names, rules, intended grain | Runtime or results |
| AMC sandbox | Syntax, joins, output shape | Real IDs or scale |
| Short production run | Real data and runtime | Long-window capacity |

## A sandbox pass proves structure, not the business result

The Skill starts with the exact SQL intended for production. It does not rewrite a simplified “test query” and hope the two versions behave alike. Atlas retrieved both **Introduction to AMC Sandbox** and **Working with AMC sandbox**, which document that the sandbox uses synthetic signals while providing the same AMC functionality and table structure needed for query iteration.

This query keeps the grouping from the reconstructed **Create and execute an ad hoc workflow** source, then fixes its cost-unit boundary before using the result for spend reporting. It establishes one row per advertiser and campaign from `dsp_impressions`:

```sql
SELECT
  advertiser,
  campaign,
  SUM(total_cost / 100000.0) AS spend,
  SUM(impressions) AS impressions,
  COUNT(DISTINCT user_id) AS reach
FROM
  dsp_impressions
GROUP BY
  advertiser,
  campaign
```

`total_cost` is stored in 1/100,000 currency units, so the query converts it to currency before labeling the result as `spend`. The sandbox can accept a query with the raw sum; execution success alone would not catch that unit error.

The sandbox run answers structural questions: Does the SQL compile? Do the table and columns exist? Does the grouping produce the intended grain? Do the joins and aggregations return the expected shape? If one of those fails, the Skill returns the error with the failed gate instead of spending the production run on a preventable mistake.

> **The AI is shared. The moat is yours.**
> - **Your account, as it is right now.** The shared AI cannot see which AMC instance, table, or execution your team is using. You must paste the SQL and error into chat, and your data is now exposed. The MCP reads the authorized context directly.
> - **Your call, before anything changes.** A chat can suggest edited SQL, but you must submit it to the sandbox and retrieve the result yourself. The Skill runs the exact saved query and records the outcome.
> - **Your judgment, running every time.** Generic SQL advice cannot establish whether `dsp_impressions` and its fields match current AMC guidance. Atlas grounds that check in Amazon's playbooks.

## Aggregation controls must match the question being tested

The sandbox offers two distinct views of synthetic data. With aggregation controls on, the result behaves like advertiser-instance reporting: aggregated and anonymous. With controls off, the sandbox can expose event-level synthetic rows so I can inspect how fields and tables relate. Amazon says that event-level view is not available in advertiser instances.

I keep controls on for the production-like validation pass. I turn them off only to investigate record shape or use table preview. The sandbox query editor's preview can inspect up to 100 rows and automatically runs that preview with aggregation controls off. Those rows explain the schema; they are not the report I plan to ship.

The Skill run record makes the mode explicit:

```yaml
skill: amc-sql-sandbox-validation
query: campaign-reach-and-spend.sql
sandbox:
  synthetic_data: required
  aggregation_controls: on
checks:
  - query_compiles
  - output_grain_is_advertiser_campaign
  - expected_metrics_are_present
production_confirmation:
  initial_window: "1 day"
  on_empty_or_suppressed: "widen to 7 days or reduce output granularity"
  reuse_exact_query: true
```

For API-driven sandbox executions, Amazon's documented control is `requireSyntheticData: true`. The related `disableAggregationControls` setting determines whether the synthetic run keeps normal aggregation protections or exposes event-level records. The Skill owns that distinction so the operator does not accidentally compare two different output modes.

> **The AI is shared. The moat is yours.**
> - **Your account, as it is right now.** The shared AI cannot see which aggregation mode was used for the submitted execution. The MCP reads the execution context and the Skill stores the mode with the result.
> - **Your call, before anything changes.** A chat cannot rerun the saved query with controls on and off. You would have to coordinate both executions and compare their output by hand.
> - **Your judgment, running every time.** A generic answer may treat event-level output as a production option. Atlas retrieves Amazon's sandbox-specific rule: event inspection is synthetic and unavailable in advertiser instances.

## Synthetic signals create a hard validation boundary

Sandbox signals are programmatically generated to mimic the structure, statistical properties, and logical cross-table relationships of AMC signals. They are not tied to a real advertiser campaign, customer ID, or ASIN. Amazon explicitly says not to use sandbox results to inform media strategy or implementation.

That boundary rules out four conclusions:

| Sandbox finding | What it does not establish |
| --- | --- |
| Query returns rows | Your campaign IDs exist |
| Join produces output | Your distribution is representative |
| ASIN field is populated | Your ASINs are covered |
| Query finishes quickly | Production will avoid timeout |

Amazon also documents cases the sandbox may not reproduce well: filters for specific campaign or ASIN identifiers, extremely granular output, varied distributions or outliers, and compute failures caused by a particular time window. A successful sandbox result is evidence about query structure, never evidence about campaign performance.

> **The AI is shared. The moat is yours.**
> - **Your account, as it is right now.** The shared AI cannot compare synthetic output with your real campaign and ASIN coverage. The first authorized advertiser-instance run supplies that evidence.
> - **Your call, before anything changes.** A chat cannot test whether a real identifier resolves. You must copy the suggestion into AMC and inspect the result yourself.
> - **Your judgment, running every time.** “It worked in test” is too broad. Atlas gives the Skill Amazon's named sandbox limitations, so it blocks business conclusions that the synthetic result cannot support.

## A short advertiser run closes the remaining gap

After the sandbox passes, the Amazon Ads MCP submits the unchanged query to the advertiser instance for the smallest useful window, starting with one day. That first production run has a narrow job: confirm real identifiers resolve, validate the output grain on real signals, and establish that the workload completes.

An empty one-day result is not automatically a failure. AMC removes output that does not clear its aggregation thresholds, so a low-volume advertiser or granular campaign grouping can produce no usable rows even when the identifiers and SQL are valid. When threshold suppression is plausible, the Skill marks the result **inconclusive**, widens the window to seven days, broadens a restrictive filter, or groups less granularly, then retries.

Invalid identifiers and execution errors fail the gate; a threshold-limited result changes the test window.

### Move from structural validation to runtime diagnosis

This is where sandbox validation and [AMC query-performance review](/guides/amc-sql-query-performance/) meet. If the query is structurally valid but the short run is still slow, the next action is to filter earlier, reduce intermediate rows, inspect join grain, or test a smaller scope. The agent no longer wastes that investigation on a syntax error the sandbox could have caught.

The run record keeps the query text, sandbox aggregation mode, structural checks, short production window, execution identifiers, and result shape together. That evidence makes “validated” a reproducible state instead of a comment in Slack.

> **The AI is shared. The moat is yours.**
> - **Your account, as it is right now.** The shared AI cannot see the advertiser-instance result or compare its grain with the sandbox result. The MCP retrieves both under the authorized connection.
> - **Your call, before anything changes.** A chat cannot submit the short confirmation, watch its status, or widen the window when the first result is inconclusive. The Skill performs each gate in order.
> - **Your judgment, running every time.** A chat may call sandbox success production validation or mistake threshold suppression for an invalid query. Atlas keeps both boundaries explicit, and the Skill requires a conclusive real-data confirmation before the full run.

## What happens next: save the validation as a recurring Skill and attach its evidence {#what-happens-next}

Once the short advertiser run returns a conclusive result, I save the validation as a recurring Skill and attach its evidence to the [Amazon Agent Data layer](/features/amazon-agent-flow/). The Amazon Ads MCP handles AMC execution, Atlas grounds the checks, and Skills preserve the gate order. If an ads workflow needs catalog or ASIN context, the [Selling Partner MCP](/features/amazon-selling-partner-mcp/) can supply that upstream without changing what the sandbox is allowed to prove.

The useful pattern is simple: use synthetic data to remove structural doubt, then spend the first production run testing reality.

*Next: [turn the validated AMC query into an agent Skill](/guides/amc-agent-workflows/) with repeatable execution and run evidence.*


## Frequently asked questions

### What can I validate in the AMC sandbox?

You can validate SQL syntax, table and column references, joins, grouping, and output shape against synthetic AMC signals. A sandbox pass does not validate campaign performance, real identifier coverage, or production-scale runtime.

### Does the AMC sandbox use the same tables as production?

Amazon says the sandbox provides functionality identical to advertiser instances while using synthetic signals that mimic AMC structure and cross-table relationships. Run the exact intended SQL so the structural test remains meaningful.

### Should AMC sandbox aggregation controls be on or off?

Keep aggregation controls on for the production-like reporting check. Turn them off only for sandbox-only event-level inspection or table preview; event-level output is not available in advertiser instances.

### Why does my AMC query work in sandbox but time out in production?

The sandbox uses a smaller synthetic dataset and cannot prove compute behavior for your real time window. Confirm the query on a short advertiser window, then widen it only after the real-data run completes.

### Can I test real campaign IDs or ASINs in the AMC sandbox?

No. Sandbox signals are not tied to your advertiser campaigns, customer IDs, or ASINs, so filters for real identifiers may return nothing even when the SQL is valid.

### Why can't I find an AMC sandbox instance?

Ask your AMC account administrator to confirm your sandbox access. Amazon's current documentation also says sponsored ads advertisers using instant self-service do not receive a sandbox instance.

### Do I still need a production run after the sandbox passes?

Yes. Start with a short advertiser-instance window to confirm real identifiers, output grain, and runtime. If a one-day run is empty because aggregation thresholds may have suppressed the output, treat it as inconclusive and retry with a wider window or less granular grouping before rejecting the query.


## Sources

- [Working with AMC sandbox](https://advertising.amazon.com/API/docs/en-us/guides/amazon-marketing-cloud/amc-sandbox)

- [Introduction to AMC Sandbox](https://advertising.amazon.com/marketing-cloud/use-cases/4c77137c-08b7-4326-9d45-b4f7639d726c)

- [Amazon Marketing Cloud sandbox](https://advertising.amazon.com/help/GRRNHKR8QV6DGS4T)

- [Understanding the sandbox components](https://advertising.amazon.com/help/G8P6Q5ZJDZALQKGV)

- [Create and execute an ad hoc workflow](https://advertising.amazon.com/API/docs/en-us/guides/amazon-marketing-cloud/reporting/ad-hoc-workflow)

- [Data aggregation thresholds in AMC](https://advertising.amazon.com/API/docs/en-us/guides/amazon-marketing-cloud/aggregation-threshold)

