Skip to main content

authentik Agent settings and policies

The authentik Agent has settings that control its SSH agent, authorization prompts, profiles, and telemetry. They can be configured in two places:

  • User settings: each user sets them in the Agent's configuration file on their device.
  • Policy: an administrator enforces them on a device. A setting that is enforced by a policy overrides the user's setting.

Both use the same setting names. Only the SSH fallback agent can also be configured in the authentik Agent app.

Agent version

Settings and policies require authentik Agent 0.73 or later.

Settings reference​

SettingTypeDefaultDescription
debugBooleanfalseLog at trace level instead of info level.
ssh.enabledBooleantrueProvide the SSH agent.
ssh.agent_tunnelBooleantrueAllow ak on remote hosts to reach this Agent through a forwarded SSH agent. Refer to Agent forwarding.
ssh.builtin_passthrough_hostsBooleantrueSend connections to github.com and gitlab.com directly to the fallback agent.
ssh_fallback_agent.socket_pathStringNot setAbsolute path of the socket of another SSH agent that is used for hosts that aren't managed by authentik. ~ isn't expanded.
ssh_fallback_agent.extra_passthrough_hostsList of stringsEmptyAdditional hosts that are always sent directly to the fallback agent, as known_hosts lines, for example the output of ssh-keyscan git.company.
profile_management.allowed_urlsList of stringsAny URLauthentik URLs that profiles can be created for. A URL must match exactly; case and a trailing / are ignored.
profile_management.allow_deleteBooleantrueAllow profiles to be deleted.
profile_management.allow_plaintext_tokensBooleantrueAllow tokens to be stored in the configuration file when the device has no keyring. When set to false on a device without a keyring, profiles can't be created.
profile_management.require_dpopBooleanfalseOnly allow profiles whose tokens are bound to a key on the device. Requires key binding to be enabled on the provider. Existing profiles that aren't key-bound stop working until the user adds them again.
authorization.remember.<operation>.allowIntegerVariesNumber of seconds that an allowed request is remembered. Refer to Authorization prompts for the operations and their defaults.
authorization.remember.<operation>.denyIntegerVariesNumber of seconds that a denied request is remembered.
authorization.allowed_exchange_audiencesList of stringsAnyAudiences that tokens can be exchanged for: the Client ID of a provider for ak auth, or the UUID of an application for the MCP server. Values must match exactly.
telemetry.update_checkBooleantrueCheck at most once a day whether a newer authentik Agent release exists.
telemetry.error_reportingBooleantrueSend errors and performance traces of the user agent, including the authentik Agent app, to authentik's Sentry.

In addition, the following environment variables can be set to true for the authentik Agent app:

  • AUTHENTIK_DISABLE_UPDATE_CHECK: disables the update check.
  • AUTHENTIK_DISABLE_STARTUP_ANALYTICS: disables the anonymous analytics request that the app sends when it starts. No setting exists for this request.

User settings​

User settings are stored in the Agent's configuration file:

PlatformFile
Linux~/.config/authentik/config.json
macOS~/Library/Application Support/authentik/config.json
Windows%APPDATA%\authentik\config.json

The Agent stores your profiles in the same file, under active_profile and profiles. Add settings as top-level keys next to profiles, and don't remove or replace the existing content:

{
"active_profile": "default",
"profiles": {},
"ssh_fallback_agent": {
"socket_path": "/Users/jdoe/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock",
"extra_passthrough_hosts": [
"git.company ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOaqAd1R5Dj3tCCRFK1Mlud+OVuLltFYXfOnCBdGM8ck"
]
},
"authorization": {
"remember": {
"token_exchange": {
"allow": 300
}
}
},
"telemetry": {
"error_reporting": false
}
}

In this example, profiles is empty. In your file, it contains the profiles that the Agent created.

Don't manage this file with deployment tools

The configuration file belongs to the user, and the Agent writes to it, for example when a profile is added. Don't deploy or overwrite it with MDM or configuration management tools. To configure settings for the users of a device, enforce them with a policy instead.

Note the following:

  • The Agent reads the file when it starts, and rewrites it while it runs, for example when it renews a token. Quit the authentik Agent app before you edit the file, and start it again afterwards. On Linux devices without the app, use systemctl --user stop ak-agent and systemctl --user start ak-agent instead.
  • The Agent doesn't start if the file isn't valid JSON or if a setting has a value of the wrong type.
  • Settings with an unknown name are ignored and are removed the next time the Agent saves the file. Check the spelling of setting names.

Authorization prompts​

When a program requests access to your authentik account, the authentik Agent asks you to approve the request. The Agent remembers your answer for the same program and the same target for a limited time. The time depends on the operation:

OperationRequested byAllowed answer remembered forDenied answer remembered for
whoamiPrograms that read your account information, such as ak whoamiNot rememberedNot remembered
current_tokenPrograms that use your authentik session token, such as ak api5 minutes15 minutes
token_exchangePrograms that request a token for another application, such as ak auth30 minutes1 second
ssh_loginSSH connections to hosts that are managed by authentik30 minutes5 minutes
authorizeThe authentik PAM module, for example for sudo on a Linux device, including through a forwarded SSH agent2 hours5 minutes

To change these times, set authorization.remember.<operation>.allow and authorization.remember.<operation>.deny in seconds. A value of 0 means that the Agent always prompts.

Remembered answers are cleared when the Agent restarts. The authentik Agent app lists recent requests and shows which ones were answered from a remembered answer.

The prompt depends on the platform:

PlatformPrompt
macOSA system dialog that asks for Touch ID, Apple Watch, or your login password.
WindowsWindows Hello, using a PIN, fingerprint, or face recognition. Windows Hello must be set up; otherwise, all requests are denied.
LinuxThe authentication dialog of your desktop environment, provided by polkit. The dialog doesn't show which program made the request.

Linux and polkit​

On Linux, the authentik Agent checks each request with polkit, using one of the following actions:

Operationpolkit action
whoamiio.goauthentik.platform.whoami
current_tokenio.goauthentik.platform.current-token
token_exchangeio.goauthentik.platform.token-exchange
ssh_loginio.goauthentik.platform.ssh-login
authorizeio.goauthentik.platform.authorize

By default, polkit itself keeps an approval for about five minutes. During that time, further requests for the same action from any program are approved without a prompt.

Administrators can use polkit rules to allow an action without a prompt. For example, the following rule in /etc/polkit-1/rules.d/50-authentik-agent.rules allows the programs of the user alice to request tokens for other applications:

polkit.addRule(function (action, subject) {
if (
action.id == "io.goauthentik.platform.token-exchange" &&
subject.user == "alice" &&
subject.local &&
subject.active
) {
return polkit.Result.YES;
}
});

A polkit rule can't distinguish which program made a request or which application a token is requested for.

polkit is required

If the authentik Agent can't connect to polkit over the system D-Bus on a Linux device, it allows all requests without a prompt. Ensure that polkit is installed and running on devices where prompts are required.

Enforce settings with a policy​

A policy uses the same settings as the user's configuration file and is applied as follows:

  • A setting in the policy overrides the user's setting. Settings that aren't in the policy remain under the user's control.
  • For authorization.remember times, the shorter time applies. Users can shorten a time that is set in the policy but can't extend it.
  • When the policy configures ssh_fallback_agent, it replaces the user's fallback agent configuration, including the user's passthrough hosts. The Fallback agent form in the authentik Agent app becomes read-only.
  • The policy is read when the Agent starts. After you change a policy, users need to quit and reopen the authentik Agent app, or log out and back in. On Linux devices without the app, run systemctl --user restart ak-agent.
Test a policy before deploying it

If a policy exists but can't be read, for example because it's invalid or has the wrong permissions, the authentik Agent doesn't start and logs an error that starts with failed to load agent policy.

The following examples configure the same policy:

  • Profiles can only be created for https://authentik.company, can't be deleted, and must be key-bound. Tokens are never stored in plain text.
  • An allowed request for the session token is remembered for at most 60 seconds, and an allowed SSH login for at most 15 minutes.
  • Tokens can only be exchanged for the application with the client ID internal-tools.
  • Remote hosts can't reach the Agent through a forwarded SSH agent, and the update check is disabled.

These examples are also available in the authentik Platform GitHub repository.

Create the file /etc/authentik/agent-policy.json. The file must be owned by root and must not be writable by the group or by others. Users need to be able to read it, so use the permissions 0644.

{
"profile_management": {
"allowed_urls": ["https://authentik.company"],
"allow_delete": false,
"allow_plaintext_tokens": false,
"require_dpop": true
},
"authorization": {
"remember": {
"current_token": {
"allow": 60
},
"ssh_login": {
"allow": 900
}
},
"allowed_exchange_audiences": ["internal-tools"]
},
"ssh": {
"agent_tunnel": false
},
"telemetry": {
"update_check": false
}
}

For example, to install the file with the correct owner and permissions:

sudo install -o root -g root -m 0644 agent-policy.json /etc/authentik/agent-policy.json

Policy error messages​

The authentik Agent doesn't show which settings are enforced by a policy, apart from the read-only Fallback agent form in the authentik Agent app. Users see one of the following messages when a policy prevents an action:

MessageCause
authentik URL '<url>' is not allowed by policyThe URL isn't listed in profile_management.allowed_urls.
key binding (DPoP) is required by policy, but the provider doesn't support itprofile_management.require_dpop is set, but key binding isn't enabled on the provider.
profile is not key-bound (DPoP), which is required by policyThe profile isn't key-bound, for example because it was added before key binding was enabled on the provider. Enable key binding and add the profile again with the same name.
deleting profiles is disabled by policyprofile_management.allow_delete is set to false.
token exchange for '<client_id>' is not allowed by policyThe client ID isn't listed in authorization.allowed_exchange_audiences.