Permissions
Tank enforces a strict permission model to prevent malicious skills from accessing unauthorized resources. Skills must declare all required permissions upfront in theirskills.json manifest.
Permission Model
Permissions are declarative, explicit, and enforced at runtime:- Declared in
skills.jsonbefore publishing - Reviewed during security scanning
- Locked in
skills.lockat install time - Enforced by the runtime (AI agent or execution environment)
Schema
Permissions are defined using Zod schemas inpackages/shared/src/schemas/permissions.ts:
Permission Categories
Network
Controls outbound network access to specific domains. Fields:outbound— Array of allowed domains (supports glob patterns)
*.example.com— Matchesapi.example.com,www.example.com, etc.example.com— Exact match only**.example.com— Matchesapi.v1.example.com(multiple subdomains)
- HTTP/HTTPS requests to unlisted domains are blocked
- DNS lookups for unlisted domains may be blocked (runtime-dependent)
- WebSocket connections follow the same rules
Network permissions currently only support outbound access. Inbound network access (listening on ports) is not supported in the permission model.
Filesystem
Controls read and write access to files and directories. Fields:read— Array of glob patterns for readable pathswrite— Array of glob patterns for writable paths
./**— All files in current directory and subdirectories./src/**/*.py— All Python files under./src/./config/*.json— JSON files directly in./config/(not recursive)~/.tank/**— Tank cache directory (absolute path)
- Paths are resolved before checking (symlinks are followed)
- Attempts to access unlisted paths throw errors
- Write permissions do not imply read permissions (must declare both)
Subprocess
Controls the ability to spawn subprocesses (shell commands, scripts, etc.). Type:boolean
Example:
falseor omitted — Cannot spawn any subprocessestrue— Can spawn subprocesses (subject to other limits like filesystem access)
- Subprocess access is powerful and can bypass other restrictions
- Skills with
subprocess: trueshould undergo extra scrutiny during security scanning - Consider requiring additional review for skills that request subprocess access
Subprocess permissions are binary (true/false). There is currently no support for allowlisting specific commands. If you need subprocess access, you get full subprocess capabilities.
Complete Example
Here’s a complete permission declaration for a data analytics skill:Permission Enforcement
Permissions are enforced by the runtime environment (AI agent, execution sandbox, etc.):Runtime Checks
- Before execution — The runtime loads permissions from
skills.lock - During execution — Each resource access is validated against declared permissions
- On violation — The operation is blocked and an error is thrown
Example: Network Access
Example: Filesystem Access
Permission Diffs
When updating a skill, Tank shows permission changes:FAQ: Why are permissions stored in both skills.json and skills.lock?
FAQ: Why are permissions stored in both skills.json and skills.lock?
skills.json is the source of truth — it’s what the skill author declares and what gets published to the registry.skills.lock is a snapshot — it records what permissions were declared at the time you installed the skill. This serves as an audit trail and allows you to detect changes during updates.When you run
tank update, Tank compares the lockfile snapshot to the new manifest and shows a diff if permissions changed.Security Scanning
Duringtank publish, the security scanner validates permissions:
Permission-Code Alignment
The scanner checks whether declared permissions match actual code behavior:| Finding | Severity | Description |
|---|---|---|
| Undeclared network access | Critical | Code makes HTTP requests to domains not in network.outbound |
| Undeclared file write | High | Code writes to paths not in filesystem.write |
| Undeclared subprocess | High | Code spawns processes without subprocess: true |
| Overly broad permissions | Medium | Declared ./** but only accesses ./config/ |
| Unused permissions | Low | Declared permissions that are never used |
Permission Red Flags
Certain permission patterns trigger extra scrutiny:subprocess: true+ broad filesystem access → Potential arbitrary code executionnetwork.outbound: ["*"]→ Unrestricted network access (not allowed)- Write access to
~/.ssh/**or~/.aws/**→ Credential theft risk
Best Practices
Principle of Least Privilege
Bad:Documenting Permissions
Always explain why permissions are needed in yourSKILL.md:
Avoid Wildcards
Use specific domains instead of wildcards: Bad:Test Permissions Locally
Before publishing, test that your skill works with declared permissions:Advanced Topics
Admin Permission Schemas
Tank also defines admin-related permission types for registry management:Next Steps
- Security Scanning — How Tank validates permissions
- Manifest — Full skills.json schema
- Lockfile — How permissions are locked during install