---
name: mux-directive-automation
description: Run a Mux Robots Directive automatically on new assets, optionally only on assets that match conditions on duration, aspect ratio, ingest type, metadata, and other asset properties. Use for setting up Directive automation, changing or pausing it, or auditing which Directives run on new uploads in an environment.
---

# Mux Directive automation

Read https://www.mux.com/docs/prompts/directive-automation.md?ref=skill for the canonical procedure. In a browser, open https://www.mux.com/docs/prompts/directive-automation and expand **View the full agent instructions**. If the prompt is unavailable, identify the missing reference before implementing API operations from memory.

Start at **Start with the request**. Determine whether the task is setting up automation, changing or pausing it, or auditing an environment. Resolve the listed choices from the user and project context, then ask only for missing choices that change the work. Use the API, MCP, CLI, repository, or computer-use capabilities available in the environment, along with the project's existing upload code.

Follow the prompt for choosing the Directive, writing conditions, enabling automation, updating upload code, and testing with new uploads. Its critical distinctions are:

- Automation is a setting on a v1 Directive, changed with `PATCH /robots/v1/directives/{DIRECTIVE_ID}` and an `automation` object. Only `name` and `automation` can change; bindings and resources can't.
- Conditions are evaluated once, when a new asset becomes ready. Automation never backfills existing assets and doesn't re-evaluate an asset after its metadata or tracks change.
- A missing field fails every comparison, including `not_equals` and `not_in`. There's no presence check.
- Sending `conditions` replaces the whole tree, `null` selects all eligible new assets without disabling automation, and `"enabled": false` pauses while keeping the conditions. Changes take up to one minute to apply.
- An attachment and automation on the same Directive start one run. Two different Directives each start a run and each bill.
- Enabling automation makes every matching upload a billable run. Show a cost estimate and get the user's approval first.

When processing existing assets, estimate the cost and get approval before starting manual runs, and save run IDs so another invocation can resume. When auditing, work read-only until the user approves changes.

Use **Verify the result** for the handoff. Distinguish configuration that was saved from behavior that was tested with real uploads. Report anything that still needs credentials, test media, or the user's approval.
