Run an editor script
Have your AI client write a Python script for the editor, check it against the safety gate, and run it — destructive scripts wait for your approval in the editor.
Your AI client can write Python that runs inside your editor — batch renames, redirector fix-ups, report generation, anything you'd otherwise paste into the Python console. The connector's script runner keeps this safe: every script is classified before it runs, and the destructive ones wait for you in the editor. Editor scripts are free — they run locally in the editor, never in the cloud.
Before you start
- The connector is installed and your AI client is connected to the editor.
Check the script first
Ask your client to check a script before running it — describe what you want done:
Write a script that fixes the naming violations in my project, then check it.check_script classifies the script without running it and returns:
- Tier —
read,write, ordestructive, decided by the classifier, not by what the script claims to be. Calls to unknown APIs count as destructive. - Findings — what the script does, issue by issue, with a suggested fix for each. A script can also be refused outright (
ok=false) — for denylisted operations, dynamic constructs, or syntax errors. - Affected assets — what the script would touch, from the live project registry.
Iterate here until the classification and the affected list look right — checking is free and touches nothing.
Run it
Run the script.What happens depends on the tier:
- Read and write tiers run immediately, inside one undo step — a single undo reverts the whole script, and a script that fails partway rolls its edits back.
- Destructive scripts park as pending while a persistent notification in the editor lists the affected assets. Approve runs it (same single-undo path); Decline returns
SCRIPT_DECLINEDto your client. There is no timeout — the notification waits for you, and the script runs only after you approve.
By default the affected packages are left dirty in the editor, like an unsaved edit — you review and save from the editor as usual. Say the word in your prompt when you want the script to save them on success.
Every run — executed, approved, or declined — lands in the project's run journal and ships a script-run capture if capture consent is on.
Verify
- The tool result shows the script's tier, its stdout, and what it changed.
- One undo step in the editor reverts the whole run.
- A destructive run reports
SCRIPT_DECLINEDback to your client when you decline it.
Next steps
- Audit your project's assets — produce the findings a script then acts on
- Captures and consent — what the editor records about each run
Was this page helpful?