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

# Program access

> Choose which Solana programs a role may call.

## Introduction

Program permissions control which Solana applications a role may invoke.

* **Use when:** a role needs to transfer, swap, or interact with a particular Solana application.
* **For:** integrations that delegate wallet execution to an application signer or session key.

## How it works

1. Identify the programs invoked by the intended transaction.
2. Grant the matching program permission on the role.
3. Add the [spending limits](https://build.onswig.com/solana/permissions/spending-limits.md) needed for the assets involved.
4. Authorize the operation with that role through [Signing](https://build.onswig.com/solana/transactions/signing.md).

## Permissions

| Permission | SDK builder | Access |
| - | - | - |
| `Program` | `programLimit({ programId })` | One named program |
| `ProgramScope` | No supported Classic helper for this flow | Advanced checks on an observed account field |
| `ProgramCurated` | `programCurated()` | The deployed protocol's curated program set |
| `ProgramAll` | `programAll()` | Unrestricted program invocation |

* Prefer `Program` for a known integration and add each required program explicitly.
* `ProgramScope` is not a standalone program allowlist. Classic's `programScopeBasic()` does not provide a usable scoped flow; use `programLimit()` for an explicit program allowlist.
* `ProgramCurated` depends on the deployed program's list; use explicit IDs when the application needs a fixed allowlist.
* `ProgramAll` is highly privileged. Use it only when arbitrary program invocation is intended.

## SDK example

Allow System Program transfers.

```typescript theme={null}
import { SystemProgram } from "@solana/web3.js";
import { Actions } from "@swig-wallet/classic";

const actions = Actions.set()
  .programLimit({ programId: SystemProgram.programId })
  .solLimit({ amount: 100_000_000n })
  .get();
```

Pass `actions` to [Add a role](https://build.onswig.com/solana/add-role.md). This grants System Program
access and a total 0.1 SOL budget. For a routed swap, identify every required
program and asset allowance before collecting the user's authorization.


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