К основному содержанию
команда CX Codex официальный · Anthropic

update-user-attrs — команда для Claude Code: настройка и установка

Команда update-user-attrs для Claude Code задаёт пользовательские параметры через атрибуты расширения Microsoft Entra ID. Она обновляет значения в профиле одного пользователя или загружает их из CSV.

Apache-2.0 ★ 41 441 обновлён 2026-09-21

Установить в Claude Code · Через маркетплейс плагинов Все способы и платформы ↓
/plugin marketplace add anthropics/financial-services
/plugin install claude-for-msft-365-install@claude-for-financial-services
Открыть на GitHub

Что делает update-user-attrs

Команда записывает пользовательские настройки в атрибуты расширения Microsoft Entra ID через Microsoft Graph. Среди доступных ключей — gateway_token, gateway_url, gcp_project_id, gcp_region, aws_role_arn и aws_region; значение каждого атрибута ограничено 256 символами. Работают только восемь ключей, зарегистрированных в приложении Anthropic.

Для одного пользователя команда использует az rest и запрос PATCH; для массового обновления обрабатывает CSV через Bash на macOS/Linux или PowerShell на Windows. Секреты при одиночной записи попадают в историю оболочки и транскрипт чата, поэтому для них описан CSV-путь. Нужны Azure CLI, вход через az login и разрешение Graph User.ReadWrite.All.

В манифесте требуется entra_sso=1, иначе надстройка не получает токен Entra и не читает атрибуты. Новые значения могут появиться в надстройке с задержкой до часа из-за кеширования утверждений токена; полный перезапуск приложения Office запрашивает новый токен.

Какие задачи решает

  • записать регион или ID проекта GCP для пользователя
  • назначить командам разные шлюзы и роли Bedrock
  • обновить атрибуты пользователей из CSV
  • проверить записанное значение через Microsoft Graph

Примеры запросов агенту

  • Задай пользователю [email protected] регион europe-west4 через update-user-attrs.
  • Обнови gateway_token для пользователей из users.csv, не выводя секреты в чат.
  • Проверь атрибут gcp_project_id пользователя [email protected].

Как установить update-user-attrs

1Через маркетплейс плагинов

/plugin marketplace add anthropics/financial-services
/plugin install claude-for-msft-365-install@claude-for-financial-services

2Вручную: положить файлы

.claude/commands/update-user-attrs.md

Вызов — /update-user-attrs. Для всех проектов — ~/.claude/commands/

Вопросы об update-user-attrs

Как установить update-user-attrs в Claude Code?

Выполни /plugin marketplace add anthropics/financial-services, затем /plugin install claude-for-msft-365-install@claude-for-financial-services. Команда также доступна по пути .claude/commands/update-user-attrs.md.

Что делает update-user-attrs?

Команда задаёт пользовательские параметры Microsoft Entra ID через атрибуты расширения и Microsoft Graph. Она умеет обновлять одного пользователя или обрабатывать CSV.

Что нужно для работы update-user-attrs?

Нужны Azure CLI с выполненным az login, разрешение Graph User.ReadWrite.All и entra_sso=1 в манифесте. Для массовой записи нужны CSV и Bash на macOS/Linux либо PowerShell на Windows.

Исходный текст

update-user-attrs.md · Apache-2.0
---
description: Set per-user config (tokens, region overrides) via Azure AD extension attributes
---

# Per-user config via extension attributes

The eight attributes below are already registered on Anthropic's app
(`c2995f31-…`) — you don't create schema, you just write values. You write
`extension_c2995f3111e74882b7a7ef9def0a0266_<key>` on the user with Graph; the
add-in reads it back as the `extn.<key>` claim in the user's ID token.

**Requires `entra_sso=1` in the manifest.** Without it the add-in never
acquires an Entra token, so these attributes are never read — they silently do
nothing.

**Only these eight keys work this way on Anthropic's app** — it issues `extn.*`
claims for no other attribute, so a value under any other attribute name never
reaches the add-in. Attrs override manifest params, and a [bootstrap](bootstrap.md)
response overrides both. All values are 256 chars max.

| Key | Per-user use case |
|---|---|
| `gateway_token` | Per-user API key (rotation) |
| `gateway_url` | Route different teams to different gateways |
| `gcp_project_id` | Different teams on different GCP projects |
| `gcp_region` | Data-residency override |
| `google_client_id` `google_client_secret` | Different OAuth client per team (uncommon) |
| `aws_role_arn` `aws_region` | Different Bedrock roles by team |

On Anthropic's app, anything else that varies per user — `azure_api_key`,
`disabled_features`, `available_models`, `inference_headers`,
`gateway_api_format`, the `otlp_*` telemetry keys — goes in a
[bootstrap endpoint](bootstrap.md) response, and `bootstrap_url` itself goes in
the manifest, one value for everyone; the endpoint tells users apart by the
Entra token it validates.

**Bring-your-own Entra app (`graph_client_id`):** the token comes from *your*
app, so the `extension_c2995f31…_<key>` attributes do nothing there. Either use
a bootstrap endpoint, or, for each key you need, register a directory extension
on your app named exactly as the config key, add it as an ID-token optional
claim (it reaches the add-in as `extn.<key>`), and swap your app's ID (no
hyphens) into the `extension_…_<key>` commands below. Any config key works this
way except `entra_sso`, `graph_client_id`, `graph_cloud`, `entra_scope`,
`gateway_auth_source` and `allow_1p`, which the add-in reads from the manifest
only. The 256-character limit still applies, so a longer value, such as most
`access_policies` arrays, goes in the manifest or a bootstrap response.

## One user

Substitute `<key>` with the attribute name from the table. For non-secret keys
(regions, project IDs) this is the normal path. For secrets (`gateway_token`,
`google_client_secret`) the value lands in shell history and this conversation's
transcript — use the bulk CSV path below if that's a problem.

```bash
az rest --method PATCH \
  --uri "https://graph.microsoft.com/v1.0/users/<upn>" \
  --body '{"extension_c2995f3111e74882b7a7ef9def0a0266_<key>":"<value>"}'
```

Success is silent — PATCH returns 204 with an empty body. To verify:

```bash
az rest --method GET --uri "https://graph.microsoft.com/v1.0/users/<upn>?\$select=extension_c2995f3111e74882b7a7ef9def0a0266_<key>"
```

Graph reads are immediately consistent with the write — no lag. To dump every
extension attr on a user (without knowing exact key names), use `/beta/`:

```bash
az rest --method GET --uri "https://graph.microsoft.com/beta/users/<upn>" | jq 'to_entries | map(select(.key | startswith("extension"))) | from_entries'
```

## Bulk (CSV, values never enter this chat)

Have the admin prepare `users.csv`. First column is UPN; remaining column
headers are the attribute keys. Empty cells skip that attr for that user.

```
upn,gateway_token,gcp_region
[email protected],sk-live-aaa,
[email protected],sk-live-bbb,europe-west4
[email protected],,europe-west4
```

**macOS/Linux** — write this to `apply.sh` next to their CSV (the `read -a` array syntax is
bash-only; a bare paste into zsh breaks). They review it, then run
`bash apply.sh`. You only see ✓/✗ — don't `cat` either file.

```bash
#!/bin/bash
EXT=extension_c2995f3111e74882b7a7ef9def0a0266_
{
  IFS=, read -ra keys
  while IFS=, read -ra vals; do
    upn="${vals[0]}"
    for i in "${!keys[@]}"; do
      [ "$i" -eq 0 ] || [ -z "${vals[$i]}" ] && continue
      az rest --method PATCH --uri "https://graph.microsoft.com/v1.0/users/$upn" \
        --body "{\"${EXT}${keys[$i]}\":\"${vals[$i]}\"}" \
        && echo "✓ $upn ${keys[$i]}" || echo "✗ $upn ${keys[$i]}"
    done
  done
} < users.csv
```

**Windows** — write this to `apply.ps1` next to their CSV. `Import-Csv` reads
the header as the schema directly; they run `.\apply.ps1` in PowerShell.

```powershell
$EXT = 'extension_c2995f3111e74882b7a7ef9def0a0266_'
Import-Csv users.csv | ForEach-Object {
  $upn = $_.upn
  $_.PSObject.Properties | Where-Object { $_.Name -ne 'upn' -and $_.Value } | ForEach-Object {
    $body = @{ "$EXT$($_.Name)" = $_.Value } | ConvertTo-Json -Compress
    az rest --method PATCH --uri "https://graph.microsoft.com/v1.0/users/$upn" --body $body
    if ($?) { "OK $upn $($_.Name)" } else { "FAIL $upn $($_.Name)" }
  }
}
```

Report the ✓ and ✗ counts. 404 means the UPN is wrong; 403
means `az login` lacks `User.ReadWrite.All` — they need to re-consent or use
an admin account.

## Propagation delay

Graph writes succeed immediately, but the add-in reads these via the user's
ID token at NAA sign-in — and Azure's STS caches token claims. Expect **up to
an hour** before the new value appears for a given user. If they open the
add-in right after the PATCH and it behaves as if unconfigured, that's the
cache, not a failure. Tell them to wait and retry; quitting the Office app
fully (not just closing the taskpane) forces a fresh NAA token on next launch.

© Anthropic · Apache-2.0 · anthropics/financial-services

Похожие слэш-команды

Все слэш-команды по теме «Облака: AWS, Azure, GCP» →
entra-agent-id Microsoft Скилл entra-agent-id создаёт идентичности AI-агентов в Microsoft Entra и настраивает обмен OAuth 2.0-токенами через Microsoft Graph. CX Codex +1 69установок entra-agent-user официальный github Скилл entra-agent-user проводит агента через создание agent user в Microsoft Entra ID, чтобы он работал как цифровой сотрудник с почтой и Teams. CX Codex +1 8 600установок entra-app-registration Microsoft Скилл entra-app-registration для Claude Code проводит через регистрацию приложения в Microsoft Entra ID, настройку OAuth 2.0 и подключение MSAL. Охватывает настройку пользовательской и сервисной аутентификации. CX Codex +1 2установок msgraph-sdk официальный github Скилл msgraph-sdk помогает подключать Microsoft Graph SDK к проектам на .NET, TypeScript/JavaScript и Python. Подходит для работы с данными Microsoft 365. CX Codex +1 57установок Microsoft Graph MCP Servosity Подключает агентов к Microsoft Graph API и находит неиспользуемые лицензии или риски доступов через локальное хранилище. Помогает MSP-командам автоматизировать администрирование тенантов. CX Codex +1 ★ 87звёзд репо entra-news darrenjrobinson Ищет по архиву рассылки Entra.news о продуктах Microsoft Entra. Помогает находить утилиты сообщества и разборы функций прямо в диалоге с ИИ. CX Codex +1 ★ 7звёзд репо

Из того же набора116

Весь набор →
market-researcher Субагент market-researcher для Claude Code готовит обзор отрасли или темы с конкурентами, сравнением компаний и инвестиционными идеями; запускается для вводного анализа, а не обновления анализа отдельной компании. CX Codex ★ 41 441звёзд репо kyc-screener Субагент kyc-screener для Claude Code, Codex и Cursor, который автоматизирует проверку документов при онбординге клиентов. Выполняет KYC/AML-проверки, сверяет данные со списками санкций и PEP, а также выявляет пробелы для эскалации. CX Codex ★ 41 441звёзд репо gl-reconciler Субагент gl-reconciler для Claude Code сверяет главную книгу с субрегистрами по дате сделки. Запускается для ежедневной или месячной сверки и готовит отчёт об исключениях на согласование. CX Codex ★ 41 441звёзд репо earnings-reviewer Субагент earnings-reviewer для Claude Code автоматизирует обработку финансовой отчётности. Он анализирует стенограммы звонков и отчёты, обновляет аналитические модели и составляет черновики заметок для инвесторов. CX Codex ★ 41 441звёзд репо setup Команда setup настройки для Claude Code, проводящая администратора через подключение надстройки Claude Office к облачной инфраструктуре. CX Codex +1 ★ 41 441звёзд репо manifest Команда manifest для Claude Code собирает XML-манифест надстройки с настройками облачного провайдера. Для Outlook она выбирает отдельный шаблон, а перед развёртыванием требует согласия администратора Microsoft Graph. CX Codex +1 ★ 41 441звёзд репо export-data Команда export-data для Claude Code копирует локальную историю чатов, скиллы и настройки надстройки перед пересборкой машины. CX Codex +1 ★ 41 441звёзд репо entra-app Команда entra-app для Claude Code описывает регистрацию приложения Microsoft Entra в собственном тенанте. Она помогает настроить вход для Outlook, шлюза, Foundry или sovereign cloud. CX Codex +1 ★ 41 441звёзд репо

Спонсоры проекта

Компании, которые помогают держать аналитику открытой