CitadelSuite

Docs · CitadelGate

Adding your own scripts

Your script library is what the AI operator, and later automatic fixes, can use. Any technician can add a script; a different administrator must review and approve it before it can be proposed or run.

The fields that matter

FieldWhat to put
NameShort and specific: "Clear print queue and restart spooler".
LanguagePowerShell, Bash, Python or Batch.
PlatformWindows, WindowsServer, Linux, MacOS, Microsoft365 or Any. The AI only proposes scripts for a matching platform.
AI descriptionWhat it does, when to use it, what it changes and how to verify it worked. The AI reads this to decide whether the script fits.
ParametersNamed inputs with type, required flag and an allowed-values list where possible. The AI can only fill parameters you define, and values are validated.
Risk levelProposed by the author, confirmed by the reviewer. See below.

Risk levels

LevelMeaningExamples
ReadOnlyReads information only; changes nothingList services, check pending reboot, read event log
LowHarmless if run when not needed, or easily reversedStart a stopped service, clear print queue, flush DNS
MediumChanges configuration; reversible with effortReinstall a driver, reset a network adapter
HighSignificant or hard-to-reverse change (default for unclassified scripts)Reset Windows Update components, install software
CriticalCould cause data loss or outageDisk, user or security-policy changes

Approval workflow

  1. Draft: create the script (Technician, Admin or Owner).
  2. Submit for review: the author submits it.
  3. Approve or reject: a different Admin or Owner reviews the code, confirms the risk level and approves it. Approval records a SHA-256 fingerprint of the exact content.
  4. Edits reset approval: any change returns the script to Draft and clears the fingerprint.

The API calls for each step are in the API reference.

Writing good library scripts

  • Make scripts idempotent: running twice should be safe.
  • Check before changing, and exit with a clear message when nothing needs doing.
  • Print a verification line at the end, for example the new service state.
  • Never hard-code passwords or secrets.

Need ideas? Start with our 10 PowerShell fixes for common helpdesk tickets.

Frequently asked questions

Can I approve my own script?

No. The reviewer must be a different Admin or Owner from the author.

What happens when I edit an approved script?

It goes back to Draft, its version increases and its fingerprint is cleared. It must be reviewed and approved again before it can be used.

Which scripts can ever run automatically?

Only approved scripts with a reviewer-assigned risk of ReadOnly or Low, and only when the client's automation policy allows it. That policy arrives in a coming release and is off by default.