"Assume your frontend will be compromised some day. Design so that when it is, the damage is bounded."
The Webview Is the Untrusted Half
Your frontend runs in a webview, and webviews render web content — which is exactly the surface attackers target. A cross-site scripting (XSS) bug, a malicious string that reaches innerHTML, or a compromised npm dependency can all end up executing JavaScript you didn't write inside your app. In a framework where the frontend has full native access (or where you forgot to lock an allowlist), that injected script inherits the keys to the whole machine: read any file, run any command. That's the nightmare Tauri is built to prevent.
Deny by Default Bounds the Blast Radius
Tauri 2 starts from zero: the webview can render and call only the specific commands you exposed, and only if a capability grants permission. So even if an attacker runs arbitrary JS in your frontend, they can't read ~/.ssh or spawn a shell unless you explicitly granted filesystem or shell access — scoped to exactly what your feature needs. The compromise is contained to the powers you deliberately opened, not the entire OS.
Least Privilege Is the Whole Game
Every permission you grant is attack surface you accepted. The discipline is least privilege: grant the narrowest power that makes the feature work, scope it to the smallest path or domain, and give different windows different capabilities (your settings window rarely needs filesystem access). Security in Tauri isn't a wall you build once — it's a series of small, deliberate yeses against a default of no.