Skip to main content
This page explains how employees stay signed in after an MDM rollout: which sign-in method to choose, what employees see when they need to act, and how credentials, MCP servers, and Skills are kept up to date without a browser. It requires tfy-local-ai-setup v3.0.2 or later.

Choose a sign-in method

For most rollouts, use an auto-renewed personal access token. A personal access token (PAT) is a TrueFoundry token that belongs to one employee and carries their permissions. Choose OIDC if your organization requires every sign-in to go through its identity provider. The first two methods both use mode = "api-key", which is the setting’s name in mdm.toml. auto_renew chooses between them.

Claude and ChatGPT subscriptions

Subscriptions don’t work with OIDC. If you bill Claude Code to employees’ Claude Enterprise or Team seats, or Codex to their ChatGPT Business or Enterprise seats, use a personal access token or a browser sign-in session.
  • Codex: with OIDC, auth_mode = "chatgpt-subscription" fails validation, and the run stops with a configuration error.
  • Claude Code: with OIDC, Claude Code sends the TrueFoundry token in place of the employee’s Claude login, so their seat is never used. Setup doesn’t warn about this, so check your sign-in method before you roll out.
Add these lines to your mdm.toml:
mdm.toml
auto_renew is off by default, so set it explicitly; without it, employees get browser sign-in sessions. Each employee signs in once in the browser. Setup then creates a PAT for them, stores it on their device, and renews it before it expires. pat_expiry_days accepts 7 to 3650 days and defaults to 365. Your organization’s maximum PAT lifetime still applies, and a change takes effect the next time a key is created or renewed. Keep mcp_servers and skills at the top of the file, before the first [table] line.

Use browser sign-in sessions instead

Replace the [auth] table with:

Use OIDC instead

Follow Set up OIDC sign-in to create the client and add [auth.oidc] to mdm.toml. What employees see with OIDC is described there.
  • Claude Code, Codex (CLI and desktop app), and Claude Desktop sign in through OIDC directly. Other agents don’t, so prefer a personal access token or a browser sign-in session if your fleet uses a wider mix of agents.
  • Don’t set auto_renew with OIDC. No key is created, and the file fails validation.
  • Claude Desktop with @all: when MCP servers, Skills, or additional models use @all, signing in to Claude Desktop also lets MDM runs look them up in the background.

What employees see

MDM runs never open a browser. When an employee needs to sign in, a background job in their session asks them with a popup. This also covers the first sign-in on a new device: the popup appears the next time the job runs, within an hour by default.
TrueFoundry popup saying the sign-in has expired, with Later and Sign in buttons and the tfy-local-ai-setup login --mdm command

The sign-in popup with an auto-renewed personal access token.

Employees can also sign in from a terminal with tfy-local-ai-setup login --mdm.
  • Sign in opens the browser with a fresh code. After the employee approves it, the next MDM run updates their agents.
  • Later asks again in 24 hours.
  • No answer within two minutes asks again in 4 hours.
Only one popup shows at a time. On Linux it is a notification with the same buttons, and on Windows a toast that stays until the employee picks a button.

Renewal warning

If a key can’t be renewed without help, for example because your organization requires a team on each token and the employee isn’t in one, the employee sees a warning at most once a day. It has no buttons, and the job keeps retrying.
macOS notification from TrueFoundry saying that managed key renewal failed and will be retried, because the employee isn't in a team

The warning shown when a key can't be renewed automatically.

To fix it, add the employee to a team, or review your organization’s PAT settings. If the key expires before it is fixed, the employee signs in again from the popup.

How refresh works

Two schedules keep everything current: the background job that the MDM run installs for each employee, and your scheduled MDM run.
  • A renewed key reaches agent settings on the next MDM run. The previous key stays valid for up to 7 days, so agents keep working in between.
  • Refreshes never open a browser. If sign-in is unavailable or a lookup fails, the current settings stay in place and the next run retries.
  • @all deploys what each employee can access. Employees may still need to authorize individual MCP servers inside their agent, and Claude Desktop Skills are uploaded as ZIP files. See Add MCP servers and Skills.

Background job

The MDM run installs the background job for each employee and keeps it up to date. Keep both schedules running: The background job alone does not update agent settings, so keep scheduling the MDM run. To change the job, set the [background] table:
mdm.toml
The job uses each operating system’s own scheduler:
  • macOS: a LaunchAgent, com.truefoundry.ai-setup.user
  • Linux: a systemd user timer, truefoundry-ai-setup-user.timer
  • Windows: a Task Scheduler task, \TrueFoundry\AI Setup User
It runs a copy of the binary that only administrators can change. For the exact paths, see Files written. On Linux, the job starts at once if the employee’s session is running, otherwise at their next login. If an employee had set up background updates through personal setup, the MDM run replaces that job on macOS and Windows.
To show the popup without waiting for the next scheduled run, start the job as the employee:

Deploy coding agents with MDM

Write mdm.toml, create the deployment script, and roll out to your fleet.

Configuration reference

Every auth and background field, with defaults and accepted values.