Safety and destructive operations

Important

XBOX Docs are now on docs.xbox.com! This page is kept as an archive and is no longer being updated. Visit our documentation on docs.xbox.com for the latest information and updates.

Visit the latest docs on docs.xbox.com

The XBOX CLI acts with your permissions, often on production titles and sellers. This page covers which commands only read, which ask before they change something, the few that do something their names don't tell you, and what to do when a change's outcome is unknown. For what an AI agent must ask before a change, see Using the XBOX CLI from agents.

A command takes its title, seller, or sandbox from a flag, an XBOX_ environment variable, or a value saved with xbox context set. A command that changes something names on stderr each value you didn't pass on its command line, so check it before a production change. See Context.

What's read-only

A PlayFab operation is read-only only if its name starts with Get, List, or Search, such as /Admin/GetTitleData or /MultiplayerServer/ListBuildSummariesV2. Every other operation changes something. This matters most for xbox playfab api <api-path>, where you type the operation's path, not a command name.

A command's Help has a SAFETY section that says whether it reads or changes something.

What asks first

Most commands that change something run without asking. These ask first in a terminal, and without one, they refuse unless you pass --confirm (--yes, -y):

Command When it needs confirmation
Any PlayFab Delete* or Shutdown* operation, through any command, including playfab api Always
playfab economy inventory operation execute When the batch contains a Delete operation. It refuses without --confirm, even in a terminal.
playfab api-policy set --overwrite Always. It refuses without --confirm, even in a terminal.
audience create, audience update Always, except audience update --dry-run, which only reads.
game create Always
playtest create, update, publish, delete Always
sandbox create Always
test-account batch create, update, delete Always
xbl binding create, delete Always
xbl business-partner create Always
xbl global-storage delete Always
xbl relying-party create Always
xbl web-service delete, certificate create Always
xbl config publish To RETAIL, CERT, or CERT.DEBUG, with --scope title or --scope account, or from another sandbox. Never with --validate-only.
xbl config save, xbl config publish by --title-id When other titles share the configuration. --allow-shared-configuration skips the question; --confirm doesn't.
pc sandbox set Always

What a command's name doesn't tell you

  • game create, sandbox create, and xbl business-partner create make something that cannot be deleted by the CLI or in Partner Center.
  • xbl relying-party create registers the relying party's name across XBOX services at once, though its settings wait for an account publish. Nobody can rename, delete, or reuse the name.
  • If playfab service-principal set fails, the service principal might have no access in the studio until a set succeeds, which can stop a pipeline that signs in as it. Pass --expected-version so set fails instead of overwriting someone else's change.
  • playfab privacy export emails the player's data, from every title of the publisher they played, to the title's notification email address. The export and its email can't be recalled.
  • xbl config publish from another sandbox replaces the destination's global title storage files with the source's, and deletes files only the destination has. The deleted files can't be recovered.
  • xbl config publish --scope title publishes the title-wide configuration, which every sandbox uses, RETAIL included. Its stats system, privilege, and single sign-on changes go live in each sandbox only when that sandbox publishes.
  • xbl binding create publishes the title-wide configuration of both games, and xbl binding delete publishes the game's own, as xbl config publish --scope title does. A title-wide change that was saved but not published, such as an embargo in productdeveloper.xml, goes live in every sandbox, RETAIL included.
  • A save to the title draft changes no sandbox, but the next publish of any sandbox, RETAIL included, makes the title draft's stats and achievements systems, privileges, and single sign-on endpoints live there, whoever runs it. See XBOX services settings.
  • xbl web-service certificate create creates a certificate that works for about 18 months and that neither the CLI nor Partner Center can revoke; Web services says how to have XBOX revoke one whose key leaked. xbl web-service delete doesn't take away the web service's access, so its certificates keep working, with that access, until they expire.

An interrupted write reports that its outcome is unknown

If a change is interrupted after the CLI sends it, such as by Ctrl+C, a timeout, or a lost connection, or the service answers with an HTTP 5xx error, the change might have been applied. The command says its outcome is unknown, as in this PlayFab error:

Request failed: /Admin/SetTitleData may have reached PlayFab, but the request was canceled, so its outcome is unknown. Check whether it was applied before retrying.
Commands Exit code when the outcome is unknown
audience create and update, playtest create, update, publish, and delete, sandbox create, test-account batch create, update, and delete, xbl binding create and delete, xbl business-partner create and save, xbl config save and publish, xbl global-storage upload and delete, xbl relying-party create and save, and xbl web-service create, update, delete, and certificate create 3
Other commands, including every playfab command 1, except game create, which exits 130 when you press Ctrl+C after it sends the request. When PlayFab answered with error JSON, the JSON on stderr also has an outcomeUnknown field.

Read the affected state before running the change again. Commands outside playfab print a read-only command to check with. After xbl web-service certificate create, there's nothing to read: a certificate created then can't be retrieved, so run the command again. The CLI never retries a change on its own.

Some commands that wait for a job exit with 4 when the request was accepted but the wait ended. Don't run them again; see the command's page for how to keep waiting. The exception is xbl config publish --scope account, which is safe to run again.