Human approval
Some commands are too important to run without a person saying yes: a large refund, a production change. Add a policy that requires approval, and Swytchcode will ask a human first.
Approvals are set up per workspace, so each workspace can send requests to its own Slack or Telegram channel. Approval workflows are available on the Business plan and above.
This is different from allow / deny rules in policies.json, which block a request immediately. Approval holds a matching command until someone responds.
How it works
- You run a command that matches an approval policy.
- Swytchcode sends an approval request to your team’s Slack or Telegram channel. Your terminal is free right away and doesn’t wait.
- Someone taps Approve or Deny.
- If approved, the command runs automatically, exactly once. If denied, it doesn’t run.
- If nobody responds within 48 hours, the request expires and the command doesn’t run.
Use swy policy add to create the rule, and swy policy list to see what’s configured. Past blocked or held commands show up in swy audit policy. Managing rules (swy policy) is separate from viewing that history (swy audit policy).
Setting it up
- Open the workspace’s settings, choose Slack or Telegram, and enter the channel details. You can use Swytchcode’s default bot or connect your own.
- Only the workspace owner and admins can change these settings.
- A workspace without a channel set up can’t send approval requests, so set it up before relying on an approval policy.
- Approval workflows are available on the Business plan and above.
See Workspaces and teams for roles, and Plans for which plans include approval workflows.
When to use approval vs. a hard block
- Use an allow / deny rule when the action should never run in this environment (for example, deleting production resources from a sandbox).
- Use human approval when the action is allowed, but only after a person confirms it (for example, refunds above a threshold).
Related
Policies overview
How policies decide what can execute before a request reaches the provider.
Policy Rules
Write conditions, operators, and allow / deny actions in policies.json.
Workspaces and teams
Per-workspace log and approval settings, roles, and seats.
Production Guardrails
Recommended safeguards for running agents against production systems.