configuring-tauri-scopes

Configure Tauri v2 command scopes for filesystem, HTTP, and capability-based access control.

Updated Jun 7, 2026
One-click install
npx skills add https://github.com/dt418/better-shot-x --skill configuring-tauri-scopes-dt418
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: configuring-tauri-scopes
Source: https://github.com/dt418/better-shot-x/tree/main/.agents/skills/configuring-tauri-scopes
Command: npx skills add https://github.com/dt418/better-shot-x --skill configuring-tauri-scopes-dt418

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Tauri v2 applications need fine-grained permission boundaries beyond basic command access, and misconfigured scopes either block legitimate operations or expose sensitive paths and URLs. This Skill guides developers through defining, restricting, and dynamically managing scopes so commands only access intended resources. ## Core Features & Use Cases - Filesystem Scope Configuration: Define allow and deny rules with glob patterns and path variables like $APPDATA and $DOCUMENT in capability JSON files. - HTTP and Remote URL Scopes: Restrict network access with URL patterns and control which remote origins can invoke application commands. - Dynamic Runtime Scopes: Expand filesystem access at runtime from Rust using the FsExt trait with validated paths. - Use Case: A desktop notes app needs read access to $DOCUMENT but must never touch $HOME/.ssh. Use this Skill to write a capability file with allow rules for documents and explicit deny rules for sensitive directories. ## Quick Start Ask the AI to configure a Tauri capability file that allows read access to the documents folder while denying access to hidden directories.

Frequently Asked Questions about configuring-tauri-scopes

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure filesystem scopes in Tauri v2?

Define filesystem scopes in capability files at src-tauri/capabilities/default.json using the fs:scope or command-specific identifiers like fs:allow-read-text-file. Add allow and deny arrays with path patterns using variables like $APPDATA and glob syntax such as $DOCUMENT/**.

How do allow and deny scopes work together in Tauri?

Deny rules always take precedence over allow rules in Tauri scopes. When both exist for a permission, any path matching a deny pattern is blocked even if it also matches an allow pattern, which is useful for excluding sensitive subdirectories.

Can I expand Tauri filesystem scope at runtime?

Yes, use the FsExt trait from tauri_plugin_fs in Rust to call fs_scope().allow_directory() or allow_file() at runtime. Always validate that paths exist and never expand scope based on unvalidated user input.

Why does Tauri say path not allowed on the configured scope?

This error means the requested path falls outside your capability's allow list or matches a deny rule. Check path variable spelling, verify glob patterns match the target paths, and confirm no deny rule is blocking the location.

What path variables are available in Tauri scope patterns?

Tauri provides runtime-injected variables including $APPDATA, $APPCONFIG, $DOCUMENT, $HOME, $DOWNLOAD, $RESOURCE, and $TEMP among others. These map to platform-specific directories and are preferred over hardcoded paths for portability.