---
schema_version: "1"
id: 04f3fbb3960675f290c532573f005edcc922320965568d525111d5675be45ddc
title: Use Agentforce Vibes in a Scratch Org
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/salesforcedx/agentforcevibes/guides/files/afv-scratch-orgs.md
canonical_url: https://developer.salesforce.com/docs/platform/agentforcevibes/guide/afv-scratch-orgs.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: e5a2fec9264a13cc690f04676776367f3fe16f6d79fb5cb7545c4a68a2e030d0
products:
  - Agentforce Vibes Developer Guide
  - salesforcedx
---
# Use Agentforce Vibes in a Scratch Org

Agentforce Vibes works in scratch orgs without admin involvement. Developers control access through the definition file. Depending on your Agentforce Vibes license, you can enable unmetered or Flex Credit (metered) access.

## How It Works

To control access for a specific scratch org, edit `config/project-scratch-def.json` in your Salesforce DX project.

### Supported Editions

Agentforce Vibes is available in these scratch org editions:

- Developer Edition
- Enterprise Edition

## Create Scratch Orgs with Unmetered Access

Add `AgentforceVibesUnmeteredAccess` to the `features` array in `config/project-scratch-def.json` to enable unmetered access. The Dev Hub must have unmetered access enabled before you create the scratch org. See [Enable Unmetered Agentforce Vibes](https://developer.salesforce.com/docs/platform/agentforcevibes/guide/afv-entitlement-setup.html#add-unmetered-access).

After creating the org, assign the required permission set to your user.

### Create the Unmetered Scratch Org

Add the feature flags to `config/project-scratch-def.json`:

```json
{
  "orgName": "AFV Unmetered Scratch Org",
  "edition": "Developer",
  "features": ["AgentforceVibesUnmeteredAccess", "EnableSetPasswordInApi", "EinsteinGPTPlatform"],
  "settings": {
    "einsteinGptSettings": {
      "enableEinsteinGptPlatform": true
    }
  }
}
```

Then create the scratch org:

```shell
sf org create scratch --definition-file config/project-scratch-def.json --alias my-scratch-org
```

Or use the VS Code command, **SFDX: Create a Default Scratch Org...**.

### Assign the Unmetered Permission Set

Follow the steps in [Create and Assign the Unmetered Permission Set](https://developer.salesforce.com/docs/platform/agentforcevibes/guide/afv-entitlement-setup.html#create-the-custom-unmetered-permission-set) to create and assign the unmetered permission set to your user.

After you authenticate to this scratch org in the Agentforce Vibes extension, Agentforce Vibes recognizes your user as an unmetered user.

### Models and Limits (Unmetered)

Scratch orgs with `AgentforceVibesUnmeteredAccess` get the same model access and limits as the standard unmetered tier.

## Create Scratch Orgs with Flex Credit Access

Add `AgentforceVibesFlexCreditsAccess` to the `features` array in `config/project-scratch-def.json` to enable Flex Credit (metered) access. The Dev Hub must have Flex Credit access enabled before you create the scratch org. See [Enable Flex Credit Access for Agentforce Vibes](https://developer.salesforce.com/docs/platform/agentforcevibes/guide/afv-entitlement-setup.html#set-up-flex-access).

After creating the org, assign the required permission set to your user.

### Create the Flex Credit Scratch Org

Add the feature flag to `config/project-scratch-def.json`:

```json
{
  "orgName": "AFV Flex Credit Scratch Org",
  "edition": "Developer",
  "features": ["AgentforceVibesFlexCreditsAccess", "EnableSetPasswordInApi", "EinsteinGPTPlatform"],
  "settings": {
    "einsteinGptSettings": {
      "enableEinsteinGptPlatform": true
    }
  }
}
```

Then create the scratch org:

```shell
sf org create scratch --definition-file config/project-scratch-def.json --alias my-scratch-org
```

Or use the VS Code command, **SFDX: Create a Default Scratch Org...**.

### Assign the Flex Credit Permission Set

Follow the steps in [Create and Assign the Flex Credit Permission Set](https://developer.salesforce.com/docs/platform/agentforcevibes/guide/afv-entitlement-setup.html#confirm-the-flex-permission-set-assignment) to create and assign the Flex Credit permission set to your user.

After you authenticate to this scratch org in the Agentforce Vibes extension, your user can use Agentforce Vibes with Flex Credit billing.

### Models and Limits (Flex Credit)

Scratch orgs with `AgentforceVibesFlexCreditsAccess` get the same model access as the standard Flex Credit tier. Each request consumes Flex Credits from your org's balance. For model availability, see [Large Language Model Support](https://help.salesforce.com/s/articleView?id=ai.generative_ai_large_language_model_support.htm&type=5).

## Disable Agentforce Vibes in a Scratch Org

To disable Agentforce Vibes for a specific scratch org, add the opt-out setting to `config/project-scratch-def.json`:

```json
{
  "settings": {
    "AgentforceForDevelopersSettings": {
      "agentforceForDevelopersOptOut": true
    }
  }
}
```

These changes take effect for new scratch orgs created from this definition file. This change doesn't affect active scratch orgs.

## Considerations

- **No admin setup required.** Unlike production and sandbox orgs, the developer controls scratch org access through the definition file, not through Setup.
- **Dev Hub is the gate.** If your Dev Hub doesn't have Agentforce Vibes enabled, scratch orgs don't have it either, regardless of what you put in the definition file. Contact your admin to confirm the Dev Hub state.

## See Also

- [Usage and Billing for Agentforce Vibes](https://developer.salesforce.com/docs/platform/agentforcevibes/guide/afv-admin-billing.md)
- [Assign Licenses for Agentforce Vibes](https://developer.salesforce.com/docs/platform/agentforcevibes/guide/afv-entitlement-setup.md)
- [Install Agentforce Vibes Extension](https://developer.salesforce.com/docs/platform/agentforcevibes/guide/afv-extension-setup.md)
- [Scratch org definition file configuration values](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_scratch_orgs_def_file_config_values.htm)
- [Large Language Model Support](https://help.salesforce.com/s/articleView?id=ai.generative_ai_large_language_model_support.htm&type=5)
- [Unmetered Platform Developer and Admin AI User permission set license](https://help.salesforce.com/s/articleView?id=platform.users_license_types_psl_unmetered.htm&type=5)
