Skip to main content

Run Approved OS Commands from Service Suite

InLast reviewed: September 30, 2026

Use this article only when a Service Suite thescenario execmust APIrun willan helpapproved you in executing commands that you want to execute using aoperating-system command prompt.

through

You can store the commands to be executedAIQ in a locker,controlled execution environment.

What changed in this article

  • Reframed command-prompt execution as a controlled Service Suite capability instead of a general command-running shortcut.
  • Added security checks for command allowlisting, execution host, working directory, quoting, secrets handling, stdout/stderr review, timeout behavior, and thenleast-privilege whilepermissions.
  • Removed executingunsafe sample-command emphasis and replaced it with validation guidance that avoids encouraging arbitrary local command execution.

Validation workflow

  1. Confirm the exec command youis canapproved retrievefor the commandstarget fromAIQ environment and cannot expose credentials or modify unintended files.
  2. Validate the lockerworking directory, arguments, permissions, expected output, timeout, and thenfailure callbehavior themin a non-production run.
  3. Review stdout, stderr, exit status, and Service Suite logs before using the exec API.

    Sample Code and Execution

    Sample Code

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    locker.put("COMMAND","cd..");
    locker.put("PATH", "C:\Users\91831");

    var MyCommand = locker.get("COMMAND");
    var MyPath = locker.get("PATH");
    var res = exec('',"cd C:")
    log("Status: " + res.status);
    log("Output: " + res.output);
    //Log("Error: " + res.error);
    log("Output: " + res1.output);
    • In line 1 you are saving the command to be executed in a variable.

      scheduled or shared workflow.

    InReview linenote: 6This youpage areis invokingnow intentionally cautious because OS command execution can affect the command.execution host.


    Last updated: AugustSeptember 10,30, 20232026

    If you have any feedback on this topic, please contact us at documentation@appvance.ai.