How DefenseClaw knows who a user is
See how DefenseClaw learns who ran an agent from the operating system alone on Linux, Windows and macOS, what is verified or claimed, and the limits.
DefenseClaw ties each agent action to a person without integrating with your identity provider. It makes no directory API calls to Active Directory, Okta or Entra, and it needs no credentials, tokens, service accounts or app registrations. It reads what the operating system already knows about the account running the agent, and says how far each fact can be trusted.
This page is the reference for what is read, where, and how much to trust it. For the overview and the checks, see Identity and authentication.
| Identity setup | Status |
|---|---|
| Local accounts on Linux, Windows and macOS | Supported |
| Active Directory over Kerberos with SSSD on RHEL 9 and Ubuntu 24.04, per-user and managed | Supported |
| Domain-joined Windows: the AD account and UPN on a per-user install; group-based profiles with local groups on a managed computer | Supported |
| Domain-joined Windows on a managed computer: AD domain groups for profile assignment | Supported. A group applies only while the user has a desktop session (Windows groups) |
| AD-bound Mac | Supported |
| Okta: the Okta LDAP Interface on Linux, Platform SSO or Okta Device Access on macOS | Preview |
| Microsoft Entra ID, every setup | Preview |
What it never does
- It makes no identity-provider or directory API calls. A lookup is a call to the host's own account database (
getent, SSSD, the Windows token and registry, Open Directory). - On a domain-bound Mac, the root guardian probes TCP port 389 on a domain controller to detect directory recovery. It sends no LDAP query and no credentials.
- It holds no identity credentials: no passwords, tokens, tickets or keys. It records the Kerberos principal name, not the ticket contents. On macOS it may run
/usr/bin/klist --jsonto read the default API cache. - It adds no sign-in step and changes no identity setting on the host.
Verified and claimed
Every fact has an assurance level, recorded as defenseclaw.user.principal.assurance.
| Assurance | Who vouches for it | Used for |
|---|---|---|
verified | The gateway took the uid or SID from how it authenticated the caller, never from anything the caller sent (see how). The gateway or the root enumerator then read the facts from the OS account database. | Attribution, and selecting a guardrail profile |
claimed | The hook, which runs as the user and can be changed by the user: the Kerberos principal in the ticket cache, the SSH variables, the Windows logon session. | Attribution only. Never selects a profile |
List view for small screens. Use the expand button to open the drawing.
TrustedZ0 · Operating system (root)
- Caller proof, account datavouch for the uid or SID
- vouchesGatewayZ2
RestrictedZ2 · Gateway (service or user)
- Gatewayresolves the facts itself
- verified onlyProfile matcher
- records bothAudit record
- Profile matcherverified facts only
- adds profile, reasonAudit record
UntrustedZ4 · User session (the user)
- Hookreports session facts
- claimsGatewayZ2
- Audit recordassurance: verified or claimed
Text version of this diagram
Trusted: Z0 · Operating system (root)
- Caller proof, account data: vouch for the uid or SID (data store)
- vouches to Gateway (Z2 · Gateway (service or user))
Restricted: Z2 · Gateway (service or user)
- Gateway: resolves the facts itself (gateway)
- verified only to Profile matcher
- records both to Audit record
- Profile matcher: verified facts only (policy layer)
- adds profile, reason to Audit record
Untrusted: Z4 · User session (the user)
- Hook: reports session facts (connector)
- claims to Gateway (Z2 · Gateway (service or user))
- Audit record: assurance: verified or claimed (data store)
A record carries verified facts whenever the gateway resolved some, and claimed facts fill in only what nothing verified. When the gateway resolved no directory facts at all, the record carries the principal the hook reported, with assurance claimed and source hook_reported. Profiles ignore such a record.
How the gateway learns who called
The gateway never takes the user from a request. It takes the uid or SID from how it authenticated the request, and the install decides how.
| Install | How the caller is authenticated | The user the gateway takes |
|---|---|---|
| Per-user, any OS | The gateway, hook or ACP token in the user's own files. The gateway runs as that account | The account the gateway runs as |
| Standalone enterprise, Linux and macOS | The kernel's peer credentials on the hook socket. On loopback TCP, a per-user credential accepted only from a process of the uid it is bound to | The peer's uid, or the uid the credential is bound to |
| Standalone enterprise, Windows | A per-user credential on loopback TCP (127.0.0.1:18970). Windows gives the gateway no kernel check of a TCP caller | The SID the credential is bound to |
| Sandbox of a per-user install | The sandbox binding's credential, which only that sandbox holds | The host user recorded on the binding |
A per-user credential is an HMAC-SHA256 of the connector and the uid or SID, under a per-machine key that no user holds. The hook guardian writes each enrolled user's credentials into that user's own hook files. The gateway reads the identity the presented credential is bound to, and refuses with 403 a request whose identity headers name anyone else.
On Windows the SID is therefore bound to a credential, not verified by the kernel. Another standard user cannot present it, because it is in the first user's files. A process of the same user, or an Administrator or SYSTEM that can read those files, can present it; the gateway cannot tell those callers from the user's own hook.
A per-user gateway takes its own account as the user of every request that authenticated. A request that proves nothing, such as a provider key alone on the LLM proxy, has no verified user. A gateway that runs as a service account, as every standalone enterprise install does, never falls back to its own account.
What each OS tells us and where we read it
Linux
| What the OS knows | Where DefenseClaw reads it | Assurance |
|---|---|---|
| Which user made the request | Enterprise: kernel peer credentials, or the uid of a per-user credential. Per-user: the account the gateway runs as | Verified |
| Account name and backend | NSS (getent passwd). Each service on the passwd line of nsswitch.conf is asked for the uid in turn (sss, winbind, ldap, himmelblau, aad). An account no directory service knows, or one /etc/passwd holds under its name and uid, is local | Verified |
| Domain | SSSD: the joined domain that holds the account by its SID (When Linux attributes a principal). winbind: the domain its name reports, in lower case, with a NetBIOS domain reported by its realm's DNS name. nss_ldap (nslcd): none | Verified |
| Groups | initgroups plus a group lookup through NSS. An SSSD account keeps only the groups of its SID's domain, its local groups and its primary group | Verified |
| Directory type and realm | realmd on the system bus (owner checked to be uid 0). active_directory for an AD realm, ldap for an IPA realm. Any account may read it, so per-user installs get it too | Verified |
| UPN | SSSD InfoPipe, read by the root hook guardian (enterprise only). Without it the principal is account@realm. A winbind host has no InfoPipe and no UPN. An Entra account named by its UPN (aad, or Himmelblau with cn_name_mapping = false) reports that UPN on every install | Verified |
| Directory type of a domain no realm covers | InfoPipe's id provider for the domain: ldap or ipa gives ldap, ad gives active_directory (enterprise only) | Verified |
| SSH or local session | The hook claims its logind session and terminal. The gateway confirms it with systemd-logind GetSession or /run/utmp | Verified when confirmed, otherwise claimed |
| Kerberos principal | The default principal of a FILE:, DIR: or KCM credential cache. KEYRING: caches are reported by type only | Claimed |
Things to know on Linux:
- Himmelblau groups. Himmelblau answers a group only by gid or Entra object ID, not by name, so DefenseClaw does not warn that a group is unknown on a host whose
groupline listshimmelblau. - Unnamed groups. An answer with a group that is only a number (a directory that did not answer for it) is kept 2 minutes instead of 15.
- Bare
usersentries with several domains. With more than one joined AD domain or a listed child domain, the same entry selects the account of that name in each of those domains. The default and permissive policy tiers still match and warn, naming every account it selects. The strict policy tier refuses a request when that ambiguity could change its profile. Write the qualified principal, or the uid, to select one account. - A local uid that SSSD also holds. When
passwdlistssssafterfiles, only root can confirm that SSSD's "no such account" is final. On enterprise the root guardian checks each enrolled account. A per-user gateway takes its own groups from its kernel credentials (sourceprocess_credentials), and ausersentry that names the account refuses withthe account holder is unconfirmed. Ausersentry by uid ("1020") still matches. - What needs privilege. The NSS, SSSD SID and realmd lookups run on every install without privilege. Only the InfoPipe facts need the enterprise root guardian.
When Linux attributes a principal
SSSD serves Active Directory, IPA and plain LDAP domains side by side, and an account's name does not say which domain holds it. So DefenseClaw decides an SSSD account's domain from its uid. The gateway asks SSSD which SID it holds for the uid (sss_nss_getsidbyuid), which any account may do.
| Case | Result |
|---|---|
A joined domain (realmd, client sssd) holds a user of the account's name with the same SID, and SSSD maps the SID back to the same uid | The realm, its directory type and the principal account@realm |
Fully qualified names (alice@corp.example.com, what realm join writes) | Only the domain the name gives is asked: the joined domain, or a listed child domain |
Short names (use_fully_qualified_names = False) | Each joined domain and each listed child domain is asked |
| An account of a plain LDAP domain (no SID) | No realm, principal or directory type from the joined domain, whatever its name |
A name that only looks qualified, such as an LDAP bob@corp.example.com or CORP\bob | No domain, and no users entry selects it by name. Select it by uid |
| An account of another domain with its own SIDs | Never the realm of an AD account it shares a name with |
The SSSD domain must carry the joined domain's name, as realm join writes it ([domain/corp.example.com]), and keep the default AD or IPA name expression.
Groups. Two SSSD domains may hold the same short name. The gateway keeps the groups SSSD holds a SID for in the account's own domain (or the groups without a SID, for an account without one), plus the host's /etc/group groups and the primary group. /etc/group groups count only when nsswitch.conf lists files or compat on its initgroups line, or on group when there is no initgroups line. Two plain LDAP domains with the same short name are not told apart; give them fully qualified names.
Child domains of the joined realm
An account of a child domain of the joined realm, such as gail@emea.corp.example.com on a host joined to corp.example.com, is verified only when you list its domain in ai_discovery.trusted_ad_child_domains. Nothing a per-user gateway can ask proves that a domain below the joined one is a trusted child, so DefenseClaw fails closed.
| List | Result for a child-domain account |
|---|---|
| Empty (the default) | Only accounts of the joined domain are verified |
| Domain not listed | The account keeps its uid and name but gets no domain, realm, directory type or principal. Only groups, connectors or agents assignments, or the default profile, can select it |
| Domain listed | When SSSD holds a user of that name with the account's SID in the listed domain, the account gets the domain, its realm (EMEA.CORP.EXAMPLE.COM), the joined realm's directory type and the principal gail@emea.corp.example.com |
A listed domain that is not below a joined Active Directory realm trusts nothing.
ai_discovery:
trusted_ad_child_domains:
- emea.corp.example.com
- apac.corp.example.com- Each entry is a DNS domain of at least two labels, compared without regard to case or a trailing dot.
- Validation refuses a wildcard (
*.corp.example.com), a NetBIOS name (EMEA), an account (alice@...orEMEA\alice) and a duplicate. - The gateway applies a changed list at reload; the guardian at its next pass.
- List only domains your joined domain's controllers trust: a listed domain is trusted for every account SSSD holds in it.
On a managed Linux host, the administrator runs sudo /opt/defenseclaw/bin/defenseclaw-gateway config validate ./config.yaml; per-user installs use defenseclaw config validate (which commands a managed host runs).
On a managed Linux host, check an account as root:
sudo /opt/defenseclaw/bin/defenseclaw-gateway enterprise linux profile-explain --user gail@emea.corp.example.com --json- The per-user
defenseclaw guardrail profile explainanddefenseclaw config getcommands refuse there. The configured list is in the administrator's/etc/defenseclaw/config.yaml. - For an account of an unlisted child domain,
subject.directoryandsubject.principalare empty, and the text output shows the account name with no realm. Thesubjectobject has no domain field:subject.principalcarries the realm of an account a listed or joined domain confirms. - A
usersassignment that names only a principal (alice@CORP.EXAMPLE.COM) matches only while the account has that principal. Add the uid when the account must match while SSSD does not answer. profile-explainalso names a sandbox refusal a hook call does not make:refused_pathslistssandbox, withsandbox_refused_reasonand a warning.
Windows
| What the OS knows | Where DefenseClaw reads it | Assurance |
|---|---|---|
| Which user made the request | Enterprise: the SID a per-user credential is bound to, over loopback TCP (not kernel-verified). Per-user: the account the gateway runs as | Verified |
| Account name and domain | LookupAccountSid. The domain is reported in lower case | Verified |
| AD UPN | TranslateNameW. The first lookup waits up to 1.5 seconds when a users or groups assignment exists, otherwise it runs in the background. Cached 5 minutes. A failed lookup is retried after 2 minutes; the last good answer is kept during the outage for profile matching. Agent identity rows leave that kept UPN out until a lookup verifies one and the agent hooks again | Verified |
| Entra UPN, provider and tenant | HKLM\SOFTWARE\Microsoft\IdentityStore\Cache\<SID> and the CloudDomainJoin\JoinInfo join state, on Entra-joined and hybrid-joined computers | Verified |
| Groups | The SYSTEM enumerator's cache of each user's sign-in token groups: local and AD groups, and the Entra groups a built-in local group lists (Entra groups on Windows). Enterprise only | Verified |
| Remote desktop, logon type, logon session UPN and Kerberos principal | LsaGetLogonSessionData for the hook's own logon session | Claimed |
| SSH session | SSH_CONNECTION | Claimed |
Windows groups follow the sign-in token:
- A user added to or removed from a group gets a new token after signing out and back in. A new Entra group SID may also need
dsregcmd /refreshprtand another sign-in. - After the sign-in the enumerator records the new groups. The next hook request, a few seconds later at most, uses the new profile.
- Windows groups are known only while the user has a desktop session (console or Remote Desktop). An SSH, scheduled-task or
runassession does not count. - For a user who is signed out or never signed in at the desktop,
profile-explain --usershowsgroup_count0andgroupsnull: the groups are unknown, not empty. When agroupsassignment exists,matchisdefault_lookup_failed,unproven_factslistsgroups:unknown,refusedistrue, and a warning names the cause (no active desktop session, or no identity record yet).
So a domain group applies only after the user signs in at the desktop. Until then, and again after they sign out, profile-explain refuses for a groups assignment and the strictest of the candidate profiles applies. To check a group assignment, explain the user while they are signed in at the desktop.
macOS
| What the OS knows | Where DefenseClaw reads it | Assurance |
|---|---|---|
| Which user made the request | Enterprise: kernel peer credentials, or the uid of a per-user credential. Per-user: the account the gateway runs as | Verified |
| Account name and groups | Open Directory. Every install reports directory local and source macos_opendirectory | Verified |
| Kerberos principal and AD mobile account | dscl /Search AuthenticationAuthority (enterprise only) | Verified |
| AD domain | dsconfigad -show (enterprise only) | Verified |
| Device SSO provider (Entra or Okta) | app-sso platform -s: Microsoft Company Portal for Entra ID, an Okta Verify bundle for Okta (Preview; enterprise only) | Verified |
| The user's Platform SSO login | AltSecurityIdentities of the account record (PlatformSSO:<upn>), which only privileged code can write. It becomes the account's UPN and principal; accounts that never registered stay local (enterprise only) | Verified |
| Entra or Okta groups through Platform SSO | None reach the macOS group database | None |
| Kerberos principal of the session | The default API: cache from /usr/bin/klist --json at most once per 5 minutes, or a FILE: cache named by KRB5CCNAME or krb5.conf | Claimed |
| SSH session | SSH_CONNECTION | Claimed |
When the Platform SSO listing fails or is slow, the account stays local. Then only a UPN or DOMAIN\name entry waits for the guardian's record; a bare name does not select it.
Which install resolves what
| Fact | Per-user (OSS) | Standalone enterprise |
|---|---|---|
| Account, name, uid or SID | Gateway | Gateway |
| Linux groups, domain, source | Gateway, through NSS | Gateway, through NSS |
| Linux directory type and realm | Gateway, through realmd and the SID of the uid | The same; the root guardian drops a realm when InfoPipe holds the uid in another SSSD domain |
| Linux UPN, and the directory type of a domain no realm covers | Only the UPN of an Entra account (aad, or Himmelblau with cn_name_mapping = false) | Root guardian; the UPN of an Entra account from the gateway |
| Windows groups | Not available | SYSTEM enumerator |
| Windows AD UPN, Entra UPN and tenant | Gateway | Gateway |
| macOS directory, domain, SSO provider and Platform SSO UPN | Not available | Root enumerator |
| Session and Kerberos principal | Hook, claimed (Linux SSH confirmed by the gateway) | The same |
How Okta and Entra users appear
DefenseClaw sees the accounts the OS sees, so the way an Okta or Entra user appears depends on how the directory reaches the machine. Okta and Entra ID are Preview. Setup steps are in Okta on Linux and Microsoft Entra ID.
| Your setup | What DefenseClaw reports |
|---|---|
| Okta or Entra provisions users into AD, and the machine is AD-joined | The AD account: directory active_directory, the AD UPN, groups and domain |
Okta LDAP Interface through SSSD (id_provider = ldap) or nss_ldap | The LDAP account: uid, name and Okta groups, also per-user. Directory ldap through nss_ldap, and through SSSD on enterprise. No domain unless SSSD uses fully qualified names; no UPN unless SSSD maps the Okta login to it |
| Mac with Platform SSO or Okta Device Access and Okta Verify | A registered account: directory okta, source macos_platform_sso, its login UPN (enterprise only) |
| Linux with an Okta agent that creates local accounts | The local account, directory local. No Okta NSS module is recognized |
| Entra-joined or hybrid-joined Windows | Directory entra_id, source windows_identity_store, the UPN and the tenant ID. Entra group SIDs (S-1-12-1-...) only for groups a built-in local group lists, enterprise only |
| Mac with Platform SSO and Company Portal | A registered account: directory entra_id, source macos_platform_sso, the UPN and its domain (enterprise only). No Entra groups |
Linux with the aad NSS module | Directory entra_id, source nss_aad, the UPN and its domain. Only the account's private group, so no groups assignment can name an Entra group |
| Linux with Himmelblau | Directory entra_id, source himmelblau, the user's Entra groups by name. The UPN and domain only with cn_name_mapping = false |
| Linux joined to Microsoft Entra Domain Services | The AD account of the managed domain: directory active_directory, the synced Entra groups, the UPN through InfoPipe on enterprise |
Entra groups on Windows
An Entra-joined computer puts an Entra group's SID into a user's sign-in token only when one of the built-in local groups lists that group: Administrators, Users, Guests, Power Users, Remote Desktop Users or Remote Management Users. Membership in any other Entra group never reaches the computer. A groups assignment, or an enrollment include_groups or exclude_groups entry, that names such a group matches no one.
Name the group by its SID; the computer cannot resolve an Entra group's name. The steps to read the SID and add it to the built-in Users group are in Entra ID on Windows.
Limits, stated plainly
- Local accounts have no directory groups. A local account has only the groups its OS account database lists, no domain and no UPN.
- Windows group naming is bounded. DefenseClaw names at most 128 groups per account within the two-second lookup budget. The rest stay as SIDs, so use the SID in a group assignment when needed.
- Group changes take time. The gateway caches a user's directory facts for 15 minutes (2 minutes for an answer with an unnamed group, or an SSSD account still waiting for its UPN on enterprise). A Windows user must also sign out and in. Himmelblau and SSSD add their own caches.
- A reused uid gets its own facts. On Linux and macOS a new account given a removed account's uid gets its own facts within 5 minutes, never the old holder's.
- A first lookup can be slow. A cold SSSD or AD answer can take seconds; the first request waits up to two seconds. An assignment that needs the unanswered fact refuses the request until the lookup is retried; otherwise the proven match or the default applies.
- Some facts need the enterprise profile. The Linux UPN, the Windows group list and the bound-Mac facts are read with privilege by the root guardian or enumerator.
- The Kerberos principal and the session can be changed by the user. They are always
claimed, except a Linux SSH session the gateway confirmed through logind or utmp. - Two plugins send no Kerberos principal. The OpenCode and Amp plugins run inside the agent process and do not read the ticket cache. Hooks that go through the DefenseClaw hook runner read it.
What a record carries
Every identity attribute is listed in End-user identity. The values of defenseclaw.user.identity.source are:
| Source | OS facility |
|---|---|
nss_files, sssd, sssd_infopipe, winbind, nss_ldap | Linux NSS, SSSD and InfoPipe, winbind, nslcd |
himmelblau, nss_aad | Linux Entra ID modules |
process_credentials | A per-user Linux gateway's own kernel credentials |
windows_lsa, windows_identity_store | Windows LSA and the Entra identity store |
macos_opendirectory, macos_platform_sso | Open Directory and Platform SSO |
hook_reported | Only the hook's claim; profiles ignore it |
A low-rate identity.observed record, once per user per cache lifetime, carries defenseclaw.user.group_count and never group names.
Next steps
Identity and authentication
Supported identity types, agent identity, checks and troubleshooting.
Active Directory on Linux
SSSD join and what DefenseClaw learns.
User- and group-based policies
Write profiles and assignments, and read the audit record.
End-user identity
Every identity attribute and how to join records.
Identity and authentication
See which directory identities DefenseClaw attributes agent activity to on Linux, Windows and macOS, check what it knows about a user, and turn it off.
Active Directory on Linux
Join a RHEL 9 or Ubuntu 24.04 host to Active Directory with SSSD and InfoPipe, sign in with Kerberos and assign a guardrail profile to an AD group.