Skip to content
<- Guides
AMC · Advanced

Validate AMC SQL in the Sandbox First

Ground the query, prove its structure on synthetic signals, then use one short advertiser run to test what the sandbox cannot.

Validate AMC SQL syntax, joins, and output shape in the sandbox before confirming real identifiers and runtime on a short production window.

Kuudo
Reviewed by Kuudo Engineering
A ChatGPT client running an AMC SQL validation Skill through three gates: Atlas and schema checks, an AMC sandbox run on synthetic signals, and a short advertiser-instance confirmation that widens when threshold suppression makes the first window inconclusive.
The sandbox removes structural doubt; the short advertiser run tests reality.
TL;DR
  • 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.

Validate Amazon Marketing Cloud (AMC) SQL with 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. The Amazon Ads MCP supplies the authorized AMC context and execution tools; Amazon Agent Atlas grounds the checks in Amazon's current sandbox rules. A sandbox pass removes structural uncertainty. It does not predict your brand's results or production-scale runtime.

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.

ChatGPT, Claude, Perplexity, Microsoft Copilot, and whatever comes next can explain SQL and measurement patterns to any advertiser, including your competitors. That shared intelligence is the starting line, not the advantage. Kuudo turns it into an AMC operating edge with your account as it is right now, your judgment running every time, and your call before anything changes. The Amazon Ads MCP reads and tests against your authorized instance, Skills preserve the rules your team expects, Amazon Agent Atlas supplies Amazon-specific guidance, and approval controls keep activation and other consequential changes with you. The result is private, owned, and specific to your business.

GateProvesCannot prove
Atlas and schemaNames, rules, intended grainRuntime or results
AMC sandboxSyntax, joins, output shapeReal IDs or scale
Short production runReal data and runtimeLong-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:

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.

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:

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.

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 findingWhat it does not establish
Query returns rowsYour campaign IDs exist
Join produces outputYour distribution is representative
ASIN field is populatedYour ASINs are covered
Query finishes quicklyProduction 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.

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.

This is where sandbox validation and AMC query-performance review 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.

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. 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 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 with repeatable execution and run evidence.

Private beta

Stop using production runs as syntax tests

Bring us the AMC query your team keeps validating by hand. We will map the Amazon Ads MCP, sandbox-validation Skill, and Atlas grounding with you.

Validate an AMC workflow in beta

What you need to run this

MCP
Amazon Ads MCP for authorized AMC query context, sandbox execution, advertiser-instance confirmation, and result retrieval
Skill
amc-sql-sandbox-validation, the reusable ground, sandbox, confirm, and widen sequence
Atlas collection
amazon_ads (playbooks: Introduction to AMC Sandbox; Working with AMC sandbox; Understanding the sandbox components; Create and execute an ad hoc workflow; Data aggregation thresholds in AMC)
access
An AMC account with access to a sandbox instance. Amazon says sponsored ads advertisers using instant self-service cannot use the sandbox.
validation boundary
Sandbox proves query structure on synthetic signals. A short advertiser-instance run proves real identifiers, real-data output, and initial runtime.

What success and failure look like

resultinterpretation
The query fails in the sandboxFix the table, column, join, grouping, or output-grain issue before using advertiser data.
The query passes but returns no synthetic rowsRemove real campaign or ASIN filters that the synthetic dataset cannot satisfy, then test those identifiers in the advertiser instance.
The sandbox is fast but production times outThe sandbox proved structure, not production scale. Reduce the real-data window and run the query-performance review.
The one-day advertiser run returns no usable rowsTreat the result as inconclusive when aggregation-threshold suppression is plausible. Widen the window, broaden a restrictive filter, or group less granularly before rejecting the query.
The sandbox instance is missingConfirm account access with the AMC administrator. Instant self-service sponsored ads access does not include a sandbox instance.
Related reading

Keep exploring this topic

Use these companion guides to understand the inputs, follow-on analysis, and adjacent workflows behind this playbook.

FAQ

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