> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Bach builds Windows installers from one bach.toml with the bach command: bach init, bach check, bach preview, bach build. Installs are per user and need no administrator rights by default. installer.scope = "machine" installs for every user after one Windows prompt. On Windows, run setup files with Start-Process -Wait -PassThru in PowerShell, and give signtool arguments that start with the word sign.

# [[firewall]]: Windows Firewall rules

> Allow your program or ports through Windows Firewall during a machine-wide install, with every setting and how rules are added and removed.

If other computers need to connect to your app, for example to a local server it runs, Windows Firewall may block them. `[[firewall]]` adds a rule that allows it. It needs `installer.scope = "machine"`.

```toml bach.toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
[installer]
scope = "machine"

[[firewall]]
name = "Hello server"
ports = "8080,9000-9010"
protocol = "tcp"
networks = ["private", "domain"]

[[firewall]]
name = "Hello agent"
file = "agent/agent.exe"
```

| Setting | Default | Meaning |
| - | - | - |
| `name` | required | Rule name, up to 128 characters, without `"` or `\`, and not `all` |
| `file` | none | A packaged `.exe` the rule is for. Give `file`, `ports` or both. |
| `ports` | none | Local ports: `8080` or `"8080,9000-9010"`. Needs `protocol` `tcp` or `udp`. |
| `protocol` | `"any"` | `"any"`, `"tcp"` or `"udp"` |
| `direction` | `"in"` | `"in"` (others connect to you) or `"out"` |
| `networks` | all | `"domain"`, `"private"`, `"public"` or a list |

Rules only allow traffic; Bach doesn't add blocking rules. A rule is added after the files are in place, replacing an older one with the same name, and removed on uninstall. The removal matches the rule's program, direction, protocol and ports, so another program's rule with the same name stays.

`bach build --msi` refuses apps with firewall rules. `bach inspect` shows them as `Firewall`. Windows only.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.