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
Recommended configuration
Add these lines to yourmdm.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_renewwith 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.- Personal access token
- Browser sign-in session

The sign-in popup with an auto-renewed personal access token.
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.
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.
The warning shown when a key can't be renewed automatically.
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.
@alldeploys 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
- 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
Run the job now on a pilot device
Run the job now on a pilot device
To show the popup without waiting for the next scheduled run, start the job as the employee:
Related
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.