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

# Set Up Personal Agent Protocol Manually

> Configure your tenant, API, web app, and agents for the Personal Agent Protocol with the Management API, and write your discovery files by hand.

> [!WARNING]
>
> **The Support for Personal Agent Protocol (Poppy) feature is in [Beta](https://auth0.com/docs/troubleshoot/product-lifecycle/product-release-stages.md).**
>
> By using this feature, you agree to the applicable Free Trial terms in Okta's [Master Subscription Agreement](https://www.okta.com/legal).

This article lists every setting the [Auth0 CLI](https://auth0.com/docs/ai-agents-mcp/personal-agents/set-up-with-auth0-cli.md) applies, so you can configure them yourself or review what the CLI changed. You can use the Auth0 Dashboard or the Management API for each step. Agents compare your discovery files with your tenant character for character. After manually writing your discovery files, run `auth0 poppy doctor` to verify that they match.

## Prerequisites

* A tenant with the Personal Agent Protocol (Poppy) beta enabled.
* An existing API with an `https` identifier and a description for every scope.
* An existing first-party Regular Web Application for your website.
* A Management API access token with `update:tenant_settings`, `update:resource_servers`, `update:clients`, `create:clients`, `create:client_grants`, and `create:agents`.

## Configure tenant settings

| Setting | Value | Why |
| - | - | - |
| `personal_agent_protocol_company_domains` | Your company domains as bare, lowercase hostnames, up to 5 | Auth0 lists `https://{domain}` in `protected_resources` of its metadata. Agents reject your company without it |
| `client_id_metadata_document_supported` | `true` | Lets you register agents from their CIMD URL |
| `authorization_response_iss_parameter_supported` | `true` | Agents reject authorization responses without `iss` |
| `resource_parameter_profile` | `compatibility` | Agents send the `resource` parameter of RFC 8707 |
| `default_audience` | Your API's identifier | Agents don't send an `audience`. Their default token is for this API |

`authorization_response_iss_parameter_supported`, `resource_parameter_profile`, and `default_audience` apply to every application in your tenant. With a default audience, applications that send no `audience` receive tokens for your API.

> [tab] Auth0 Dashboard
>
> 1. Navigate to **Dashboard > Settings > General**. Under **API Authorization Settings**, set **Default Audience** to your API's identifier, and select **Save**.
> 2. Navigate to **Dashboard > Settings > Advanced**.
> 3. Under **Personal Agent Company Domains**, add each of your company domains. To remove a domain, remove it from the list.
> 4. Turn on **Client ID Metadata Document** support, **Issuer (`iss`) in authorization responses**, and the **Resource Parameter Compatibility Profile**.
> 5. Select **Save**.

> [tab] Management API
>
> The following `PATCH` request to `/api/v2/tenants/settings` configures your tenant for Poppy:
>
> ```bash theme={null}
> curl --request PATCH \
>   --url 'https://YOUR_AUTH0_DOMAIN/api/v2/tenants/settings' \
>   --header 'Content-Type: application/json' \
>   --header 'Authorization: Bearer YOUR_MGMT_API_TOKEN' \
>   --data '{
>     "personal_agent_protocol_company_domains": ["shop.example"],
>     "client_id_metadata_document_supported": true,
>     "authorization_response_iss_parameter_supported": true,
>     "resource_parameter_profile": "compatibility",
>     "default_audience": "https://api.shop.example"
>   }'
> ```

## Configure your API

| Setting | Value | Why |
| - | - | - |
| `use_for_personal_agent_protocol` | `true` | Lists the API in `protected_resources` and its scopes in `scopes_supported`. Requires an `https` identifier without a fragment. Up to 5 APIs per tenant |
| `agent_subject_claims` | `auth0-v1` | Puts the agent in the access token's `act` claim |
| `allow_offline_access` | `true` | Lets Auth0 issue refresh tokens to agents |
| `skip_consent_for_verifiable_first_party_clients` | `true` | A browser join ends in a login to your web application that can't show any screen. Without this, a user's first login to the web application needs a consent screen, and the join fails |
| `scopes` | Your scopes, each with a description, plus `poppy:browser-sign-in` | Agents choose scopes from the descriptions. A signed-in browser join needs `poppy:browser-sign-in` |

> [tab] Auth0 Dashboard
>
> 1. Navigate to **Dashboard > Applications > APIs** and select your API.
> 2. On the **Settings** tab, turn on **Available to Personal Agents**.
> 3. Under **Access Token Settings**, turn on **Include agent subject claims**.
> 4. Under **Access Settings**, turn on **Allow Skipping User Consent** and **Allow Offline Access**.
> 5. Select **Save**.
> 6. Select the **Permissions** tab. Make sure every scope has a description, and add `poppy:browser-sign-in` with the description "Use the website on your behalf, with the permissions you approve".

> [tab] Management API
>
> `PATCH` replaces the whole `scopes` array, so include your existing scopes:
>
> ```bash theme={null}
> curl --request PATCH \
>   --url 'https://YOUR_AUTH0_DOMAIN/api/v2/resource-servers/YOUR_API_ID' \
>   --header 'Content-Type: application/json' \
>   --header 'Authorization: Bearer YOUR_MGMT_API_TOKEN' \
>   --data '{
>     "use_for_personal_agent_protocol": true,
>     "agent_subject_claims": "auth0-v1",
>     "allow_offline_access": true,
>     "scopes": [
>       { "value": "orders:read", "description": "See your orders and their status. Read only." },
>       { "value": "checkout", "description": "Place orders and pay with your saved card. Can'\''t be undone." },
>       { "value": "poppy:browser-sign-in", "description": "Use the website on your behalf, with the permissions you approve" }
>     ]
>   }'
> ```

If your website gives a signed-in agent the account's full access, describe `poppy:browser-sign-in` that way instead, such as "Use the website on your behalf, with full access to your account", and set `web.unscoped` in `poppy.json`. Auth0 doesn't enforce this setting: your website does.

### Allow guest access tokens (optional)

After a signed-out browser join, your web application receives an access token for your API only if the API allows anonymous users for that application. Skip this if your web application calls only public endpoints for guests.

> [tab] Auth0 Dashboard
>
> 1. Navigate to **Dashboard > Applications > APIs** and select your API.
> 2. On the **Settings** tab, under **Application Access Policy**, set **Anonymous Access** to **per-app authorization**.
> 3. Select **Save**.

> [tab] Management API
>
> Set `subject_type_authorization.anonymous_user.policy` to `require_client_grant` on your API.

Then grant your web application the scopes guests may use, as described in [Allow guest access tokens](#allow-guest-access-tokens-for-your-web-app-optional) in your web app. To learn more, read [Configure Anonymous Sessions](https://auth0.com/docs/manage-users/sessions/anonymous-sessions/configure-anonymous-sessions.md).

## Configure your web app

| Setting | Value | Why |
| - | - | - |
| `allow_personal_agent_browser_join` | `true` | Turns on the Auth0-hosted browser join for this application. First-party applications only |
| `initiate_login_uri` | Your SDK's login route, such as `https://shop.example/auth/login` | Auth0 sends the agent's browser there at the end of a join |
| `callbacks` | Your callback route | The login that ends the join returns there |

> [tab] Auth0 Dashboard
>
> 1. Navigate to **Dashboard > Applications > Applications** and select your web application.
> 2. On the **Settings** tab, turn on **Allow Personal Agent Browser Join**.
> 3. In the **URLs** tab, set **Application Login URI** to your application's login route, and make sure **Allowed Callback URLs** includes your callback route.
> 4. Select **Save Changes**.

> [tab] Management API
>
> The following `PATCH` request to `/api/v2/clients/WEB_APP_CLIENT_ID` configures your web app for Poppy:
>
> ```bash theme={null}
> curl --request PATCH \
>   --url 'https://YOUR_AUTH0_DOMAIN/api/v2/clients/WEB_APP_CLIENT_ID' \
>   --header 'Content-Type: application/json' \
>   --header 'Authorization: Bearer YOUR_MGMT_API_TOKEN' \
>   --data '{
>     "allow_personal_agent_browser_join": true,
>     "initiate_login_uri": "https://shop.example/auth/login",
>     "callbacks": ["https://shop.example/auth/callback"]
>   }'
> ```

Your browser join endpoint is `https://YOUR_AUTH0_DOMAIN/poppy/WEB_APP_CLIENT_ID/browser-session`. Use your custom domain if you have one.

### Allow guest access tokens for your web app (optional)

If you set the API's **Anonymous Access** to per-app authorization, grant your web application the scopes guests may use.

> [tab] Auth0 Dashboard
>
> 1. Navigate to **Dashboard > Applications > Applications** and select your web application.
> 2. Select the **API Access** tab, find your API, and select **Edit**.
> 3. Under **Anonymous Access**, select the scopes guests may use.
> 4. Select **Save**.

> [tab] Management API
>
> Create a client grant for your web application with `"subject_type": "anonymous_user"` and the scopes guests may use:
>
> ```bash theme={null}
> curl --request POST \
>   --url 'https://YOUR_AUTH0_DOMAIN/api/v2/client-grants' \
>   --header 'Content-Type: application/json' \
>   --header 'Authorization: Bearer YOUR_MGMT_API_TOKEN' \
>   --data '{
>     "client_id": "WEB_APP_CLIENT_ID",
>     "audience": "https://api.shop.example",
>     "scope": ["catalog:read"],
>     "subject_type": "anonymous_user"
>   }'
> ```

### Skip MFA during joins

A join can't show prompts, so it fails if MFA or any other prompt would run. If you require MFA, skip it when an actor is present in a post-login Action. To learn more, read [Customize MFA Selection](https://auth0.com/docs/secure/multi-factor-authentication/customize-mfa.md).

## Add the refresh token Action

Agents that follow the protocol may not request `offline_access`. Add a post-login Action that requests it for agents that sign in to your API, and bind it as the last Action of the post-login flow:

```javascript theme={null}
const POPPY_APIS = ['https://api.shop.example']; // Your Poppy API identifiers

exports.onExecutePostLogin = async (event, api) => {
  // An agent is acting when the client is linked to an agent record.
  if (!event.agent || !event.agent.agent_id) {
    return;
  }

  // Only a sign-in to a Poppy API needs a refresh token.
  if (!POPPY_APIS.includes(event.resource_server?.identifier)) {
    return;
  }

  const targetScopes = event.transaction?.target_scopes ?? [];
  if (targetScopes.includes('offline_access')) {
    return;
  }

  api.transaction.addTargetScope('offline_access');
};
```

> [tab] Auth0 Dashboard
>
> 1. Navigate to **Dashboard > Actions > Library** and select **Create Action > Build from scratch**.
> 2. Enter a name, such as `Poppy refresh tokens`, select the **Login / Post Login** trigger, and select **Create**.
> 3. Paste the code above, set `POPPY_APIS` to your Poppy API identifiers, and select **Deploy**.
> 4. Navigate to **Dashboard > Actions > Triggers** and select **post-login**.
> 5. In the **Custom** tab, drag the Action to the end of the flow and select **Apply**.

> [tab] Management API
>
> Create the Action with `POST /api/v2/actions/actions` using the code above, deploy it with `POST /api/v2/actions/actions/{id}/deploy`, and bind it with `PATCH /api/v2/actions/triggers/post-login/bindings`. To learn more, read [Actions API](https://auth0.com/docs/customize/actions.md).

## Register agents

For each personal agent you allow:

1. **Manually create its application from its CIMD URL.** In **Dashboard > Applications > Applications**, select **Create Application > Import from URL**, enter the agent's URL, select **Preview**, and then **Create**. To use the Management API, read [Register Applications with CIMD](https://auth0.com/docs/get-started/auth0-overview/create-applications/register-applications-with-cimd.md).
2. **Link it to an agent.** Create an agent with the application's `client_id`. To learn more, read [Register an Agent](https://auth0.com/docs/ai-agents-mcp/agent-as-principal/register-an-agent.md). Without a link, the web application's tokens name the agent by its CIMD URL.
3. **Grant it scopes on your API:** Create a client grant that authorizes the agent's application to get access tokens for your API on behalf of signed-in users for a specific set of scopes you define.

> [tab] Auth0 Dashboard
>
> 1. Navigate to **Dashboard > Applications > Applications** and select the agent's application.
> 2. Select the **APIs** tab and find your API.
> 3. Turn on access for your API and select the scopes the agent may request, including `poppy:browser-sign-in`.
> 4. Select **Update**.

> [tab] Management API
>
> ```bash theme={null}
> curl --request POST \
>   --url 'https://YOUR_AUTH0_DOMAIN/api/v2/client-grants' \
>   --header 'Content-Type: application/json' \
>   --header 'Authorization: Bearer YOUR_MGMT_API_TOKEN' \
>   --data '{
>     "client_id": "AGENT_APP_CLIENT_ID",
>     "audience": "https://api.shop.example",
>     "scope": ["orders:read", "checkout", "poppy:browser-sign-in"],
>     "subject_type": "user"
>   }'
> ```

Auth0 accepts ES256, PS384, and RS256 signatures. An agent's metadata document can have at most 6 signing keys. When the document sets `token_endpoint_auth_signing_alg`, Auth0 stores only the keys of that algorithm; when it omits it, Auth0 stores every key. When an agent rotates its keys, select **Refresh Client Metadata** on its application.

To block an agent, delete its application, which revokes its refresh tokens. Already issued access tokens stay valid until they expire.

## Serve the discovery files

Serve both files on your company domain, at the root, over HTTPS. The Auth0 web SDKs serve them for you.

`/.well-known/oauth-protected-resource`:

```json theme={null}
{
  "resource": "https://shop.example",
  "authorization_servers": ["https://auth.shop.example/"]
}
```

| Field | Value |
| - | - |
| `resource` | Exactly `https://` and your company domain, with no path or trailing slash |
| `authorization_servers` | Your issuer exactly as Auth0 publishes it in `/.well-known/oauth-authorization-server`, including the trailing slash |

`/.well-known/poppy.json`:

```json theme={null}
{
  "protocol_version": "1.0",
  "organization": { "name": "Shop", "domain": "shop.example" },
  "auth": {
    "issuer": "https://auth.shop.example/",
    "scopes": {
      "orders:read": "See your orders and their status. Read only.",
      "checkout": "Place orders and pay with your saved card. Can't be undone.",
      "poppy:browser-sign-in": "Use the website on your behalf, with the permissions you approve"
    },
    "scope_hints": {
      "orders:read": { "changes": "none", "personal_data": true },
      "checkout": { "changes": "irreversible", "personal_data": true }
    }
  },
  "apis": [
    { "type": "openapi", "url": "https://api.shop.example/openapi.json", "description": "Orders and checkout" }
  ],
  "web": {
    "browser_session_endpoint": "https://auth.shop.example/poppy/WEB_APP_CLIENT_ID/browser-session"
  }
}
```

| Field | Description |
| - | - |
| `organization.domain` | The host that serves the file, exactly |
| `auth.issuer` | Your issuer exactly as in `authorization_servers`, including the trailing slash |
| `auth.scopes` | A description for each scope agents can request |
| `auth.scope_hints` | For each scope, `changes` (`none`, `reversible`, or `irreversible`) and `personal_data` (`true` or `false`) |
| `apis` | Your OpenAPI documents, each with a short description |
| `web.browser_session_endpoint` | Your Auth0-hosted browser join endpoint |
| `web.unscoped` | `true` only if your website treats `poppy:browser-sign-in` as the account's full access |

## Next steps

* [Check your setup with the doctor](https://auth0.com/docs/ai-agents-mcp/personal-agents/set-up-with-auth0-cli.md#check-your-setup)
* [Add Personal Agent Protocol to your web app](https://auth0.com/docs/ai-agents-mcp/personal-agents/add-to-your-web-app.md)
* [Add Personal Agent Protocol to your API](https://auth0.com/docs/ai-agents-mcp/personal-agents/add-to-your-api.md)
