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

# Add Policy

> Low-level instruction to add a Squads instruction constraint policy to the vault

# createAddPolicyInstruction

Builds a raw instruction to add a Squads instruction constraint policy to the vault. Policies define what strategy interactions the vault's Squads smart account is allowed to execute, gating which programs and instructions can be called. Requires the manager role.

## Usage

```typescript theme={null}
import { createAddPolicyInstruction } from "@exponent-labs/exponent-sdk/client/vaults";
import { PublicKey } from "@solana/web3.js";

const ix = createAddPolicyInstruction(
  {
    payer: wallet.publicKey,
    vault: vaultAddress,
    squadsSettings: squadsSettingsPda,
    squadsSettingsTransaction: squadsSettingsTransactionPda,
    squadsProposal: squadsProposalPda,
    squadsPolicy: squadsPolicyPda,
    squadsProgram: SQUADS_PROGRAM_ID,
    systemProgram: SYSTEM_PROGRAM_ID,
  },
  {
    policyConfig: {
      programId: targetProgramId,
      instructionDiscriminator: discriminatorBytes,
      accountConstraints: [],
    },
  }
);
```

## Accounts

| Name                        | Signer | Writable | Description                     |
| --------------------------- | ------ | -------- | ------------------------------- |
| `payer`                     | Yes    | Yes      | Fee payer for account creation  |
| `vault`                     | No     | Yes      | The Strategy Vault account      |
| `squadsSettings`            | No     | Yes      | Squads settings account         |
| `squadsSettingsTransaction` | No     | Yes      | Squads settings transaction PDA |
| `squadsProposal`            | No     | Yes      | Squads proposal PDA             |
| `squadsPolicy`              | No     | Yes      | Squads policy PDA to create     |
| `squadsProgram`             | No     | No       | Squads v4 program               |
| `systemProgram`             | No     | No       | System program                  |

## Args

| Name           | Type           | Description                                                                       |
| -------------- | -------------- | --------------------------------------------------------------------------------- |
| `policyConfig` | `PolicyConfig` | The policy configuration defining program, discriminator, and account constraints |

## Returns

`TransactionInstruction` — a transaction instruction ready to be added to a transaction.
