# 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

1. You run a command that matches an approval policy.
2. Swytchcode sends an approval request to your team's Slack or Telegram channel. Your terminal is free right away and doesn't wait.
3. Someone taps **Approve** or **Deny**.
4. If approved, the command runs automatically, exactly once. If denied, it doesn't run.
5. 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](/guides/workspaces/) for roles, and [Plans](/guides/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](https://docs.swytchcode.com/policies/overview/) - How policies decide what can execute before a request reaches the provider.
- [Policy Rules](https://docs.swytchcode.com/policies/policy-rules/) - Write conditions, operators, and allow / deny actions in policies.json.
- [Workspaces and teams](https://docs.swytchcode.com/guides/workspaces/) - Per-workspace log and approval settings, roles, and seats.
- [Production Guardrails](https://docs.swytchcode.com/policies/production-guardrails/) - Recommended safeguards for running agents against production systems.
