- rules
- guards
PowerShell guard
Windows only: a second look before destructive PowerShell, and rules for a careful session on this machine.
What it does
Parts for the agent stay off until you approve them.
- rulesRules the agent follows while the morph is on, as seriously as your project’s own instructions.
- guardsA check on every matching action the agent tries: refuse it, or ask you first.
Rules the agent follows
This is a Windows machine. Use PowerShell syntax, not bash. Prefer Remove-Item on a named path over wildcards. Never edit the registry without saying which key.
Guards on agent actions
- ask
*Remove-Item*-Recurse*onshell, Recursive delete on Windows. - deny
*Format-Volume*onshell, Formatting a volume is never part of a coding task. - ask
*Set-ItemProperty*HKLM:*onshell, A machine-wide registry write. - deny
*Stop-Computer*onshell, No shutdowns from an agent. - deny
*Restart-Computer*onshell, No reboots from an agent.
Install
proxysoul/Empryo/morphs/powershell-guard.json- Copy the reference above.
- In the Empryo desktop app, open Cells & Morphs → Start from… → Install from GitHub and paste it.
- Or ask the agent to “install proxysoul/Empryo/morphs/powershell-guard.json”.
Will it run for you
Requirements
- Empryo
- 3.7.2+Empryo 3.7.2+, runs on 3.10.2-beta
- Platforms
- Windows only
- Works in
- Desktop app and Terminal app
Runs on Empryo 3.10.2-beta, the current release.
Network access
Declares no network access outside your machine.
Rules and guards stay off until you approve them in Cells & Morphs.
Source
This morph lives at morphs/powershell-guard.json in proxysoul/Empryo.
Read the whole file
{
"schemaVersion": 1,
"name": "PowerShell guard",
"description": "Windows only: a second look before destructive PowerShell, and rules for a careful session on this machine.",
"requires": {
"empryo": ">=3.7.2",
"platforms": [
"windows"
]
},
"instructions": "This is a Windows machine. Use PowerShell syntax, not bash. Prefer Remove-Item on a named path over wildcards. Never edit the registry without saying which key.",
"guards": [
{
"tool": "shell",
"match": "*Remove-Item*-Recurse*",
"decision": "ask",
"reason": "Recursive delete on Windows."
},
{
"tool": "shell",
"match": "*Format-Volume*",
"decision": "deny",
"reason": "Formatting a volume is never part of a coding task."
},
{
"tool": "shell",
"match": "*Set-ItemProperty*HKLM:*",
"decision": "ask",
"reason": "A machine-wide registry write."
},
{
"tool": "shell",
"match": "*Stop-Computer*",
"decision": "deny",
"reason": "No shutdowns from an agent."
},
{
"tool": "shell",
"match": "*Restart-Computer*",
"decision": "deny",
"reason": "No reboots from an agent."
}
],
"signature": {
"alg": "ed25519",
"key": "MCowBQYDK2VwAyEAy6SPFCi/cYx+XTFd5b7LjJnM5YUMNqsNGKU3fPCLU8Y=",
"sig": "N9+Rr3dfjQHasijyoR2lVcNQYcbKSKGKmLqr7DbUG3OYcbSaaFdFatl8Hz0pUW/ZTS0znYJeBsot4HWwVwO0BQ=="
}
}