Terminal copilots — Microsoft AI Shell, Warp's AI, Claude Code — will happily suggest, and increasingly run, real commands against real systems. Adopting one without a written execution policy means the boundary between "suggest" and "execute" is set by the tool's defaults and your fatigue level at 2 a.m. Write the policy first.
Tier: Core · Workflow area: Scripting & automation · ~30 minutes
This playbook produces a one-page execution policy for AI in your shell — what the assistant may run unprompted, what it may only suggest, and what it must never touch — then wires that policy into the tools' actual permission mechanisms so it is enforced by configuration, not intention.
Draft the three-tier policy. One page, three lists, written for your estate. Have the model draft it from your context and then edit:
Draft a terminal-AI execution policy for an IT ops team. Three tiers:
AUTO-ALLOWED (AI may execute without per-command approval):
read-only diagnostics — get/list/show/test commands, log reads,
status queries. Nothing that writes.
SUGGEST-ONLY (AI proposes; human reads, edits, runs manually):
anything that changes state on a single object; anything piping to
a shell; installs; service restarts on non-critical hosts.
NEVER (AI neither runs nor is asked to compose against live targets):
bulk/destructive ops (mass delete, format, forced moves), identity
and security-config changes, production database writes, firewall
rules, anything touching backup infrastructure, certificate ops.
Context: Windows-heavy estate, M365 + on-prem AD, RMM-managed.
Format as a table: operation class | tier | example commands | why.
Edit ruthlessly — the model's draft is generic; your NEVER list must name your crown jewels (the backup server, the PAM vault, the domain controllers).
Wire the policy into Claude Code. Permission rules live in settings; encode the tiers directly:
{
"permissions": {
"allow": [
"Bash(Get-*)", "Bash(kubectl get *)", "Bash(git status)",
"Bash(Test-NetConnection *)"
],
"deny": [
"Bash(Remove-Item * -Recurse *)", "Bash(rm -rf *)",
"Bash(Set-ADUser *)", "Bash(New-NetFirewallRule *)"
]
}
}
Everything not allowed prompts for approval — which is your suggest-only tier. Deny rules are the NEVER list's hard backstop.
Wire it into AI Shell and Warp. Microsoft AI Shell keeps suggestion and execution separate by design — the assistant proposes into the prompt line; your policy rule is "read before Enter, always, no exceptions for long commands." In Warp, review the AI settings: disable any autonomous-execution features beyond your AUTO-ALLOWED comfort, and turn off sharing/telemetry options your data policy requires. Document the exact settings per tool in the policy page.
Add the two behavioral rules no config can enforce. Rule one: read the whole command before it runs — especially generated one-liners with pipes into sh, Invoke-Expression, or redirects; these are the suggest-tier's escape hatches. Rule two: never paste secrets into the AI pane — the shell assistant sees your terminal context; credentials go through the secret store, not the conversation.
Trial the boundary for two weeks with a log. Each tech notes near-misses: commands the AI ran that surprised them, suggest-tier commands they wish were auto-allowed, NEVER-tier requests that felt legitimate. A real log entry:
08-04 | Claude Code proposed "Restart-Service spooler" during print
triage — prompted for approval as designed. Fine. But it batched it
with a Get- command in one line, so approval covered both. Rule
added: no compound commands mixing tiers.
Review and ratify. Adjust tiers from the log, fix the config to match, and have the team lead sign the page. The signed policy goes next to the AI-usage policy (pb-49); new starters get it in the enablement pack (pb-20).
Re-review on every tool update. Terminal-AI capabilities move fast; a tool update that adds autonomous features silently expands your AUTO tier. Diff the settings after each significant update — put it on the patch-cycle checklist.
systemctl status, journalctl, df, deny dd, mkfs, iptables -F, and treat curl | bash as NEVER-tier composition regardless of target.Terminal AI sees your command history, environment variables and output — which can include tokens, connection strings and customer data; configure each tool's data handling to your org's policy, and keep secrets out of both commands and conversation panes.
The dangerous moment is not the AI writing a bad command — it is the human approving a good-looking one unread; a written three-tier policy, enforced in tool config and refreshed on every update, keeps the judgment where it belongs.